Source code for daily_med.models.spl_document

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# flake8: noqa

#
# Generated Mon Feb  6 12:07:05 2017 by generateDS.py version 2.24b.
#
# Command line options:
#   ('-o', 'spl.py')
#
# Command line arguments:
#   ../SchemasR2b/SPL.xsd
#
# Command line:
#   generateDS.py -o "spl.py" ../SchemasR2b/SPL.xsd
#
# Current working directory (os.getcwd()):
#   dkuhlman-generateds-8f298b77b9d3
#

import sys
import re as re_
import base64
import datetime as datetime_
import warnings as warnings_
try:
    from lxml import etree as etree_
except ImportError:
    from xml.etree import ElementTree as etree_


Validate_simpletypes_ = True
if sys.version_info.major == 2:
    BaseStrType_ = basestring
else:
    BaseStrType_ = str


def parsexml_(infile, parser=None, **kwargs):
    if parser is None:
        # Use the lxml ElementTree compatible parser so that, e.g.,
        #   we ignore comments.
        try:
            parser = etree_.ETCompatXMLParser()
        except AttributeError:
            # fallback to xml.etree
            parser = etree_.XMLParser()
    doc = etree_.parse(infile, parser=parser, **kwargs)
    return doc

#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
#   in a module named generatedssuper.py.

try:
    from generatedssuper import GeneratedsSuper
except ImportError as exp:

    class GeneratedsSuper(object):
        tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
        class _FixedOffsetTZ(datetime_.tzinfo):
            def __init__(self, offset, name):
                self.__offset = datetime_.timedelta(minutes=offset)
                self.__name = name
            def utcoffset(self, dt):
                return self.__offset
            def tzname(self, dt):
                return self.__name
            def dst(self, dt):
                return None
        def gds_format_string(self, input_data, input_name=''):
            return input_data
        def gds_validate_string(self, input_data, node=None, input_name=''):
            if not input_data:
                return ''
            else:
                return input_data
        def gds_format_base64(self, input_data, input_name=''):
            return base64.b64encode(input_data)
        def gds_validate_base64(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_integer(self, input_data, input_name=''):
            return '%d' % input_data
        def gds_validate_integer(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_integer_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)
        def gds_validate_integer_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    int(value)
                except (TypeError, ValueError):
                    raise_parse_error(node, 'Requires sequence of integers')
            return values
        def gds_format_float(self, input_data, input_name=''):
            return ('%.15f' % input_data).rstrip('0')
        def gds_validate_float(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_float_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)
        def gds_validate_float_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    float(value)
                except (TypeError, ValueError):
                    raise_parse_error(node, 'Requires sequence of floats')
            return values
        def gds_format_double(self, input_data, input_name=''):
            return '%e' % input_data
        def gds_validate_double(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_double_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)
        def gds_validate_double_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    float(value)
                except (TypeError, ValueError):
                    raise_parse_error(node, 'Requires sequence of doubles')
            return values
        def gds_format_boolean(self, input_data, input_name=''):
            return ('%s' % input_data).lower()
        def gds_validate_boolean(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_boolean_list(self, input_data, input_name=''):
            return '%s' % ' '.join(input_data)
        def gds_validate_boolean_list(
                self, input_data, node=None, input_name=''):
            values = input_data.split()
            for value in values:
                if value not in ('true', '1', 'false', '0', ):
                    raise_parse_error(
                        node,
                        'Requires sequence of booleans '
                        '("true", "1", "false", "0")')
            return values
        def gds_validate_datetime(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_datetime(self, input_data, input_name=''):
            if input_data.microsecond == 0:
                _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
                    input_data.year,
                    input_data.month,
                    input_data.day,
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                )
            else:
                _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
                    input_data.year,
                    input_data.month,
                    input_data.day,
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                    ('%f' % (float(input_data.microsecond) / 1000000))[2:],
                )
            if input_data.tzinfo is not None:
                tzoff = input_data.tzinfo.utcoffset(input_data)
                if tzoff is not None:
                    total_seconds = tzoff.seconds + (86400 * tzoff.days)
                    if total_seconds == 0:
                        _svalue += 'Z'
                    else:
                        if total_seconds < 0:
                            _svalue += '-'
                            total_seconds *= -1
                        else:
                            _svalue += '+'
                        hours = total_seconds // 3600
                        minutes = (total_seconds - (hours * 3600)) // 60
                        _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
            return _svalue
        @classmethod
        def gds_parse_datetime(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            time_parts = input_data.split('.')
            if len(time_parts) > 1:
                micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
                input_data = '%s.%s' % (time_parts[0], micro_seconds, )
                dt = datetime_.datetime.strptime(
                    input_data, '%Y-%m-%dT%H:%M:%S.%f')
            else:
                dt = datetime_.datetime.strptime(
                    input_data, '%Y-%m-%dT%H:%M:%S')
            dt = dt.replace(tzinfo=tz)
            return dt
        def gds_validate_date(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_date(self, input_data, input_name=''):
            _svalue = '%04d-%02d-%02d' % (
                input_data.year,
                input_data.month,
                input_data.day,
            )
            try:
                if input_data.tzinfo is not None:
                    tzoff = input_data.tzinfo.utcoffset(input_data)
                    if tzoff is not None:
                        total_seconds = tzoff.seconds + (86400 * tzoff.days)
                        if total_seconds == 0:
                            _svalue += 'Z'
                        else:
                            if total_seconds < 0:
                                _svalue += '-'
                                total_seconds *= -1
                            else:
                                _svalue += '+'
                            hours = total_seconds // 3600
                            minutes = (total_seconds - (hours * 3600)) // 60
                            _svalue += '{0:02d}:{1:02d}'.format(
                                hours, minutes)
            except AttributeError:
                pass
            return _svalue
        @classmethod
        def gds_parse_date(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
            dt = dt.replace(tzinfo=tz)
            return dt.date()
        def gds_validate_time(self, input_data, node=None, input_name=''):
            return input_data
        def gds_format_time(self, input_data, input_name=''):
            if input_data.microsecond == 0:
                _svalue = '%02d:%02d:%02d' % (
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                )
            else:
                _svalue = '%02d:%02d:%02d.%s' % (
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                    ('%f' % (float(input_data.microsecond) / 1000000))[2:],
                )
            if input_data.tzinfo is not None:
                tzoff = input_data.tzinfo.utcoffset(input_data)
                if tzoff is not None:
                    total_seconds = tzoff.seconds + (86400 * tzoff.days)
                    if total_seconds == 0:
                        _svalue += 'Z'
                    else:
                        if total_seconds < 0:
                            _svalue += '-'
                            total_seconds *= -1
                        else:
                            _svalue += '+'
                        hours = total_seconds // 3600
                        minutes = (total_seconds - (hours * 3600)) // 60
                        _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
            return _svalue
        def gds_validate_simple_patterns(self, patterns, target):
            # pat is a list of lists of strings/patterns.  We should:
            # - AND the outer elements
            # - OR the inner elements
            found1 = True
            for patterns1 in patterns:
                found2 = False
                for patterns2 in patterns1:
                    if re_.search(patterns2, target) is not None:
                        found2 = True
                        break
                if not found2:
                    found1 = False
                    break
            return found1
        @classmethod
        def gds_parse_time(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            if len(input_data.split('.')) > 1:
                dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
            else:
                dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
            dt = dt.replace(tzinfo=tz)
            return dt.time()
        def gds_str_lower(self, instring):
            return instring.lower()
        def get_path_(self, node):
            path_list = []
            self.get_path_list_(node, path_list)
            path_list.reverse()
            path = '/'.join(path_list)
            return path
        Tag_strip_pattern_ = re_.compile(r'\{.*\}')
        def get_path_list_(self, node, path_list):
            if node is None:
                return
            tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
            if tag:
                path_list.append(tag)
            self.get_path_list_(node.getparent(), path_list)
        def get_class_obj_(self, node, default_class=None):
            class_obj1 = default_class
            if 'xsi' in node.nsmap:
                classname = node.get('{%s}type' % node.nsmap['xsi'])
                if classname is not None:
                    names = classname.split(':')
                    if len(names) == 2:
                        classname = names[1]
                    class_obj2 = globals().get(classname)
                    if class_obj2 is not None:
                        class_obj1 = class_obj2
            return class_obj1
        def gds_build_any(self, node, type_name=None):
            return None
        @classmethod
        def gds_reverse_node_mapping(cls, mapping):
            return dict(((v, k) for k, v in mapping.iteritems()))
        @staticmethod
        def gds_encode(instring):
            if sys.version_info.major == 2:
                return instring.encode(ExternalEncoding)
            else:
                return instring
        @staticmethod
        def convert_unicode(instring):
            if isinstance(instring, str):
                result = quote_xml(instring)
            elif sys.version_info.major == 2 and isinstance(instring, unicode):
                result = quote_xml(instring).encode('utf8')
            else:
                result = GeneratedsSuper.gds_encode(str(instring))
            return result

    def getSubclassFromModule_(module, class_):
        '''Get the subclass of a class from a specific module.'''
        name = class_.__name__ + 'Sub'
        if hasattr(module, name):
            return getattr(module, name)
        else:
            return None


#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#

## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
##     banner = 'Dropping into IPython',
##     exit_msg = 'Leaving Interpreter, back to program.')

# Then use the following line where and when you want to drop into the
# IPython shell:
#    ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')

#
# Globals
#

ExternalEncoding = 'ascii'
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)

# Change this to redirect the generated superclass module to use a
# specific subclass module.
CurrentSubclassModule_ = None

#
# Support/utility functions.
#


def showIndent(outfile, level, pretty_print=True):
    if pretty_print:
        for idx in range(level):
            outfile.write('    ')


def quote_xml(inStr):
    "Escape markup chars, but do not modify CDATA sections."
    if not inStr:
        return ''
    s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
    s2 = ''
    pos = 0
    matchobjects = CDATA_pattern_.finditer(s1)
    for mo in matchobjects:
        s3 = s1[pos:mo.start()]
        s2 += quote_xml_aux(s3)
        s2 += s1[mo.start():mo.end()]
        pos = mo.end()
    s3 = s1[pos:]
    s2 += quote_xml_aux(s3)
    return s2


def quote_xml_aux(inStr):
    s1 = inStr.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    return s1


def quote_attrib(inStr):
    s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
    s1 = s1.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    if '"' in s1:
        if "'" in s1:
            s1 = '"%s"' % s1.replace('"', "&quot;")
        else:
            s1 = "'%s'" % s1
    else:
        s1 = '"%s"' % s1
    return s1


def quote_python(inStr):
    s1 = inStr
    if s1.find("'") == -1:
        if s1.find('\n') == -1:
            return "'%s'" % s1
        else:
            return "'''%s'''" % s1
    else:
        if s1.find('"') != -1:
            s1 = s1.replace('"', '\\"')
        if s1.find('\n') == -1:
            return '"%s"' % s1
        else:
            return '"""%s"""' % s1


def get_all_text_(node):
    if node.text is not None:
        text = node.text
    else:
        text = ''
    for child in node:
        if child.tail is not None:
            text += child.tail
    return text


def find_attr_value_(attr_name, node):
    attrs = node.attrib
    attr_parts = attr_name.split(':')
    value = None
    if len(attr_parts) == 1:
        value = attrs.get(attr_name)
    elif len(attr_parts) == 2:
        prefix, name = attr_parts
        namespace = node.nsmap.get(prefix)
        if namespace is not None:
            value = attrs.get('{%s}%s' % (namespace, name, ))
    return value

def get_all_values(iter):
    return [r.value for r in iter]


class GDSParseError(Exception):
    pass


def raise_parse_error(node, msg):
    msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
    raise GDSParseError(msg)


class MixedContainer:
    # Constants for category:
    CategoryNone = 0
    CategoryText = 1
    CategorySimple = 2
    CategoryComplex = 3
    # Constants for content_type:
    TypeNone = 0
    TypeText = 1
    TypeString = 2
    TypeInteger = 3
    TypeFloat = 4
    TypeDecimal = 5
    TypeDouble = 6
    TypeBoolean = 7
    TypeBase64 = 8
    def __init__(self, category, content_type, name, value):
        self.category = category
        self.content_type = content_type
        self.name = name
        self.value = value
    def getCategory(self):
        return self.category
    def getContenttype(self, content_type):
        return self.content_type
    def getValue(self):
        return self.value
    def getName(self):
        return self.name
    def export(self, outfile, level, name, namespace, pretty_print=True):
        if self.category == MixedContainer.CategoryText:
            # Prevent exporting empty content as empty lines.
            if self.value.strip():
                outfile.write(self.value)
        elif self.category == MixedContainer.CategorySimple:
            self.exportSimple(outfile, level, name)
        else:    # category == MixedContainer.CategoryComplex
            self.value.export(
                outfile, level, namespace, name, pretty_print=pretty_print)
    def exportSimple(self, outfile, level, name):
        if self.content_type == MixedContainer.TypeString:
            outfile.write('<%s>%s</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeInteger or \
                self.content_type == MixedContainer.TypeBoolean:
            outfile.write('<%s>%d</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeFloat or \
                self.content_type == MixedContainer.TypeDecimal:
            outfile.write('<%s>%f</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeDouble:
            outfile.write('<%s>%g</%s>' % (
                self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeBase64:
            outfile.write('<%s>%s</%s>' % (
                self.name, base64.b64encode(self.value), self.name))
    def to_etree(self, element):
        if self.category == MixedContainer.CategoryText:
            # Prevent exporting empty content as empty lines.
            if self.value.strip():
                if len(element) > 0:
                    if element[-1].tail is None:
                        element[-1].tail = self.value
                    else:
                        element[-1].tail += self.value
                else:
                    if element.text is None:
                        element.text = self.value
                    else:
                        element.text += self.value
        elif self.category == MixedContainer.CategorySimple:
            subelement = etree_.SubElement(element, '%s' % self.name)
            subelement.text = self.to_etree_simple()
        else:    # category == MixedContainer.CategoryComplex
            self.value.to_etree(element)
    def to_etree_simple(self):
        if self.content_type == MixedContainer.TypeString:
            text = self.value
        elif (self.content_type == MixedContainer.TypeInteger or
                self.content_type == MixedContainer.TypeBoolean):
            text = '%d' % self.value
        elif (self.content_type == MixedContainer.TypeFloat or
                self.content_type == MixedContainer.TypeDecimal):
            text = '%f' % self.value
        elif self.content_type == MixedContainer.TypeDouble:
            text = '%g' % self.value
        elif self.content_type == MixedContainer.TypeBase64:
            text = '%s' % base64.b64encode(self.value)
        return text
    def exportLiteral(self, outfile, level, name):
        if self.category == MixedContainer.CategoryText:
            showIndent(outfile, level)
            outfile.write(
                'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
                    self.category, self.content_type, self.name, self.value))
        elif self.category == MixedContainer.CategorySimple:
            showIndent(outfile, level)
            outfile.write(
                'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
                    self.category, self.content_type, self.name, self.value))
        else:    # category == MixedContainer.CategoryComplex
            showIndent(outfile, level)
            outfile.write(
                'model_.MixedContainer(%d, %d, "%s",\n' % (
                    self.category, self.content_type, self.name,))
            self.value.exportLiteral(outfile, level + 1)
            showIndent(outfile, level)
            outfile.write(')\n')


class MemberSpec_(object):
    def __init__(self, name='', data_type='', container=0):
        self.name = name
        self.data_type = data_type
        self.container = container
    def set_name(self, name): self.name = name
    def get_name(self): return self.name
    def set_data_type(self, data_type): self.data_type = data_type
    def get_data_type_chain(self): return self.data_type
    def get_data_type(self):
        if isinstance(self.data_type, list):
            if len(self.data_type) > 0:
                return self.data_type[-1]
            else:
                return 'xs:string'
        else:
            return self.data_type
    def set_container(self, container): self.container = container
    def get_container(self): return self.container


def _cast(typ, value):
    if typ is None or value is None:
        return value
    return typ(value)

#
# Data representation classes.
#


[docs]class PORP_MT050032UV_Author(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', contextControlCode='OP', realmCode=None, typeId=None, templateId=None, noteText=None, time=None, signatureCode=None, signatureText=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.noteText = noteText self.time = time self.signatureCode = signatureCode self.signatureText = signatureText self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Author) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Author.subclass: return PORP_MT050032UV_Author.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Author(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_noteText(self): return self.noteText
[docs] def set_noteText(self, noteText): self.noteText = noteText
[docs] def get_time(self): return self.time
[docs] def set_time(self, time): self.time = time
[docs] def get_signatureCode(self): return self.signatureCode
[docs] def set_signatureCode(self, signatureCode): self.signatureCode = signatureCode
[docs] def get_signatureText(self): return self.signatureText
[docs] def set_signatureText(self, signatureText): self.signatureText = signatureText
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.noteText is not None or self.time is not None or self.signatureCode is not None or self.signatureText is not None or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Author', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Author') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Author', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Author'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "OP" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Author', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.noteText is not None: self.noteText.export(outfile, level, namespace_, name_='noteText', pretty_print=pretty_print) if self.time is not None: self.time.export(outfile, level, namespace_, name_='time', pretty_print=pretty_print) if self.signatureCode is not None: self.signatureCode.export(outfile, level, namespace_, name_='signatureCode', pretty_print=pretty_print) if self.signatureText is not None: self.signatureText.export(outfile, level, namespace_, name_='signatureText', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'noteText': obj_ = ED.factory() obj_.build(child_) self.noteText = obj_ obj_.original_tagname_ = 'noteText' elif nodeName_ == 'time': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.time = obj_ obj_.original_tagname_ = 'time' elif nodeName_ == 'signatureCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.signatureCode = obj_ obj_.original_tagname_ = 'signatureCode' elif nodeName_ == 'signatureText': obj_ = ED.factory() obj_.build(child_) self.signatureText = obj_ obj_.original_tagname_ = 'signatureText' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class PORP_MT050032UV_Author
[docs]class PORP_MT050032UV_Comment(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, text=None, statusCode=None, effectiveTime=None, author=None, subject=None, sequel=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.text = text self.statusCode = statusCode self.effectiveTime = effectiveTime if author is None: self.author = [] else: self.author = author if subject is None: self.subject = [] else: self.subject = subject if sequel is None: self.sequel = [] else: self.sequel = sequel
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Comment) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Comment.subclass: return PORP_MT050032UV_Comment.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Comment(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def add_subject(self, value): self.subject.append(value)
[docs] def insert_subject_at(self, index, value): self.subject.insert(index, value)
[docs] def replace_subject_at(self, index, value): self.subject[index] = value
[docs] def get_sequel(self): return self.sequel
[docs] def set_sequel(self, sequel): self.sequel = sequel
[docs] def add_sequel(self, value): self.sequel.append(value)
[docs] def insert_sequel_at(self, index, value): self.sequel.insert(index, value)
[docs] def replace_sequel_at(self, index, value): self.sequel[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.text is not None or self.statusCode is not None or self.effectiveTime is not None or self.author or self.subject or self.sequel ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Comment', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Comment') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Comment', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Comment'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Comment', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subject_ in self.subject: subject_.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) for sequel_ in self.sequel: sequel_.export(outfile, level, namespace_, name_='sequel', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'text': obj_ = StrucDoc_Text.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'author': obj_ = PORP_MT050032UV_Author.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'subject': obj_ = PORP_MT050032UV_Subject2.factory() obj_.build(child_) self.subject.append(obj_) obj_.original_tagname_ = 'subject' elif nodeName_ == 'sequel': obj_ = PORP_MT050032UV_SequelTo.factory() obj_.build(child_) self.sequel.append(obj_) obj_.original_tagname_ = 'sequel'
# end class PORP_MT050032UV_Comment
[docs]class PORP_MT050032UV_Component1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, section=None, observationMedia=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.section = section self.observationMedia = observationMedia
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Component1) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Component1.subclass: return PORP_MT050032UV_Component1.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Component1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_section(self): return self.section
[docs] def set_section(self, section): self.section = section
[docs] def get_observationMedia(self): return self.observationMedia
[docs] def set_observationMedia(self, observationMedia): self.observationMedia = observationMedia
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.section is not None or self.observationMedia is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Component1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Component1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Component1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Component1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Component1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.section is not None: self.section.export(outfile, level, namespace_, name_='section', pretty_print=pretty_print) if self.observationMedia is not None: self.observationMedia.export(outfile, level, namespace_, name_='observationMedia', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'section': obj_ = PORP_MT050032UV_Section.factory() obj_.build(child_) self.section = obj_ obj_.original_tagname_ = 'section' elif nodeName_ == 'observationMedia': obj_ = PORP_MT050032UV_ObservationMedia.factory() obj_.build(child_) self.observationMedia = obj_ obj_.original_tagname_ = 'observationMedia'
# end class PORP_MT050032UV_Component1
[docs]class PORP_MT050032UV_Component2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, section=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.section = section
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Component2) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Component2.subclass: return PORP_MT050032UV_Component2.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Component2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_section(self): return self.section
[docs] def set_section(self, section): self.section = section
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.section is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Component2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Component2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Component2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Component2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Component2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.section is not None: self.section.export(outfile, level, namespace_, name_='section', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'section': obj_ = PORP_MT050032UV_Section.factory() obj_.build(child_) self.section = obj_ obj_.original_tagname_ = 'section'
# end class PORP_MT050032UV_Component2
[docs]class PORP_MT050032UV_Component3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, nonXMLBody=None, structuredBody=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.nonXMLBody = nonXMLBody self.structuredBody = structuredBody
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Component3) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Component3.subclass: return PORP_MT050032UV_Component3.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Component3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_nonXMLBody(self): return self.nonXMLBody
[docs] def set_nonXMLBody(self, nonXMLBody): self.nonXMLBody = nonXMLBody
[docs] def get_structuredBody(self): return self.structuredBody
[docs] def set_structuredBody(self, structuredBody): self.structuredBody = structuredBody
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.nonXMLBody is not None or self.structuredBody is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Component3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Component3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Component3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Component3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Component3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.nonXMLBody is not None: self.nonXMLBody.export(outfile, level, namespace_, name_='nonXMLBody', pretty_print=pretty_print) if self.structuredBody is not None: self.structuredBody.export(outfile, level, namespace_, name_='structuredBody', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'nonXMLBody': obj_ = PORP_MT050032UV_NonXMLBody.factory() obj_.build(child_) self.nonXMLBody = obj_ obj_.original_tagname_ = 'nonXMLBody' elif nodeName_ == 'structuredBody': obj_ = PORP_MT050032UV_StructuredBody.factory() obj_.build(child_) self.structuredBody = obj_ obj_.original_tagname_ = 'structuredBody'
# end class PORP_MT050032UV_Component3
[docs]class PORP_MT050032UV_Document(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='DOC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, title=None, effectiveTime=None, availabilityTime=None, confidentialityCode=None, languageCode=None, setId=None, versionNumber=None, author=None, verifier=None, legalAuthenticator=None, relatedDocument=None, component=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.title = title self.effectiveTime = effectiveTime self.availabilityTime = availabilityTime self.confidentialityCode = confidentialityCode self.languageCode = languageCode self.setId = setId self.versionNumber = versionNumber if author is None: self.author = [] else: self.author = author if verifier is None: self.verifier = [] else: self.verifier = verifier if legalAuthenticator is None: self.legalAuthenticator = [] else: self.legalAuthenticator = legalAuthenticator if relatedDocument is None: self.relatedDocument = [] else: self.relatedDocument = relatedDocument self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Document) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Document.subclass: return PORP_MT050032UV_Document.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Document(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_availabilityTime(self): return self.availabilityTime
[docs] def set_availabilityTime(self, availabilityTime): self.availabilityTime = availabilityTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_languageCode(self): return self.languageCode
[docs] def set_languageCode(self, languageCode): self.languageCode = languageCode
[docs] def get_setId(self): return self.setId
[docs] def set_setId(self, setId): self.setId = setId
[docs] def get_versionNumber(self): return self.versionNumber
[docs] def set_versionNumber(self, versionNumber): self.versionNumber = versionNumber
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_verifier(self): return self.verifier
[docs] def set_verifier(self, verifier): self.verifier = verifier
[docs] def add_verifier(self, value): self.verifier.append(value)
[docs] def insert_verifier_at(self, index, value): self.verifier.insert(index, value)
[docs] def replace_verifier_at(self, index, value): self.verifier[index] = value
[docs] def get_legalAuthenticator(self): return self.legalAuthenticator
[docs] def set_legalAuthenticator(self, legalAuthenticator): self.legalAuthenticator = legalAuthenticator
[docs] def add_legalAuthenticator(self, value): self.legalAuthenticator.append(value)
[docs] def insert_legalAuthenticator_at(self, index, value): self.legalAuthenticator.insert(index, value)
[docs] def replace_legalAuthenticator_at(self, index, value): self.legalAuthenticator[index] = value
[docs] def get_relatedDocument(self): return self.relatedDocument
[docs] def set_relatedDocument(self, relatedDocument): self.relatedDocument = relatedDocument
[docs] def add_relatedDocument(self, value): self.relatedDocument.append(value)
[docs] def insert_relatedDocument_at(self, index, value): self.relatedDocument.insert(index, value)
[docs] def replace_relatedDocument_at(self, index, value): self.relatedDocument[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassDocument(self, value): # Validate type ActClassDocument, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOC', 'DOCCLIN', 'CDALVLONE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocument' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocument_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocument_patterns_, ))
validate_ActClassDocument_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.title is not None or self.effectiveTime is not None or self.availabilityTime is not None or self.confidentialityCode is not None or self.languageCode is not None or self.setId is not None or self.versionNumber is not None or self.author or self.verifier or self.legalAuthenticator or self.relatedDocument or self.component is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Document', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Document') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Document', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Document'): if self.classCode != "DOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Document', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.availabilityTime is not None: self.availabilityTime.export(outfile, level, namespace_, name_='availabilityTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.languageCode is not None: self.languageCode.export(outfile, level, namespace_, name_='languageCode', pretty_print=pretty_print) if self.setId is not None: self.setId.export(outfile, level, namespace_, name_='setId', pretty_print=pretty_print) if self.versionNumber is not None: self.versionNumber.export(outfile, level, namespace_, name_='versionNumber', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for verifier_ in self.verifier: verifier_.export(outfile, level, namespace_, name_='verifier', pretty_print=pretty_print) for legalAuthenticator_ in self.legalAuthenticator: legalAuthenticator_.export(outfile, level, namespace_, name_='legalAuthenticator', pretty_print=pretty_print) for relatedDocument_ in self.relatedDocument: relatedDocument_.export(outfile, level, namespace_, name_='relatedDocument', pretty_print=pretty_print) if self.component is not None: self.component.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocument(self.classCode) # validate type ActClassDocument value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': obj_ = StrucDoc_Title.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'availabilityTime': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.availabilityTime = obj_ obj_.original_tagname_ = 'availabilityTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'languageCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.languageCode = obj_ obj_.original_tagname_ = 'languageCode' elif nodeName_ == 'setId': obj_ = II.factory() obj_.build(child_) self.setId = obj_ obj_.original_tagname_ = 'setId' elif nodeName_ == 'versionNumber': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.versionNumber = obj_ obj_.original_tagname_ = 'versionNumber' elif nodeName_ == 'author': obj_ = PORP_MT050032UV_Author.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'verifier': obj_ = PORP_MT050032UV_Verifier.factory() obj_.build(child_) self.verifier.append(obj_) obj_.original_tagname_ = 'verifier' elif nodeName_ == 'legalAuthenticator': obj_ = PORP_MT050032UV_LegalAuthenticator.factory() obj_.build(child_) self.legalAuthenticator.append(obj_) obj_.original_tagname_ = 'legalAuthenticator' elif nodeName_ == 'relatedDocument': obj_ = PORP_MT050032UV_RelatedDocument.factory() obj_.build(child_) self.relatedDocument.append(obj_) obj_.original_tagname_ = 'relatedDocument' elif nodeName_ == 'component': obj_ = PORP_MT050032UV_Component3.factory() obj_.build(child_) self.component = obj_ obj_.original_tagname_ = 'component'
# end class PORP_MT050032UV_Document
[docs]class PORP_MT050032UV_ExcerptFrom(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='XCRPT', realmCode=None, typeId=None, templateId=None, highlight=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.highlight = highlight
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_ExcerptFrom) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_ExcerptFrom.subclass: return PORP_MT050032UV_ExcerptFrom.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_ExcerptFrom(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_highlight(self): return self.highlight
[docs] def set_highlight(self, highlight): self.highlight = highlight
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipExcerpt(self, value): # Validate type ActRelationshipExcerpt, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['XCRPT', 'VRXCRPT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipExcerpt' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipExcerpt_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipExcerpt_patterns_, ))
validate_ActRelationshipExcerpt_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.highlight is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.ExcerptFrom', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.ExcerptFrom') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.ExcerptFrom', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.ExcerptFrom'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "XCRPT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.ExcerptFrom', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.highlight is not None: self.highlight.export(outfile, level, namespace_, name_='highlight', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipExcerpt(self.typeCode) # validate type ActRelationshipExcerpt
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'highlight': obj_ = PORP_MT050032UV_Highlight.factory() obj_.build(child_) self.highlight = obj_ obj_.original_tagname_ = 'highlight'
# end class PORP_MT050032UV_ExcerptFrom
[docs]class PORP_MT050032UV_Highlight(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOCSECT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, text=None, effectiveTime=None, subject=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.text = text self.effectiveTime = effectiveTime if subject is None: self.subject = [] else: self.subject = subject
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Highlight) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Highlight.subclass: return PORP_MT050032UV_Highlight.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Highlight(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def add_subject(self, value): self.subject.append(value)
[docs] def insert_subject_at(self, index, value): self.subject.insert(index, value)
[docs] def replace_subject_at(self, index, value): self.subject[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocumentSection(self, value): # Validate type ActClassDocumentSection, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOCSECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocumentSection' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocumentSection_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocumentSection_patterns_, ))
validate_ActClassDocumentSection_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.text is not None or self.effectiveTime is not None or self.subject ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Highlight', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Highlight') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Highlight', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Highlight'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOCSECT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Highlight', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for subject_ in self.subject: subject_.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocumentSection(self.classCode) # validate type ActClassDocumentSection value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'text': obj_ = StrucDoc_Text.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'subject': obj_ = PORP_MT050032UV_Subject1.factory() obj_.build(child_) self.subject.append(obj_) obj_.original_tagname_ = 'subject'
# end class PORP_MT050032UV_Highlight
[docs]class PORP_MT050032UV_LegalAuthenticator(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='LA', realmCode=None, typeId=None, templateId=None, noteText=None, time=None, signatureCode=None, signatureText=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.noteText = noteText self.time = time self.signatureCode = signatureCode self.signatureText = signatureText self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_LegalAuthenticator) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_LegalAuthenticator.subclass: return PORP_MT050032UV_LegalAuthenticator.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_LegalAuthenticator(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_noteText(self): return self.noteText
[docs] def set_noteText(self, noteText): self.noteText = noteText
[docs] def get_time(self): return self.time
[docs] def set_time(self, time): self.time = time
[docs] def get_signatureCode(self): return self.signatureCode
[docs] def set_signatureCode(self, signatureCode): self.signatureCode = signatureCode
[docs] def get_signatureText(self): return self.signatureText
[docs] def set_signatureText(self, signatureText): self.signatureText = signatureText
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationLegalAuthenticator(self, value): # Validate type ParticipationLegalAuthenticator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['LA'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationLegalAuthenticator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationLegalAuthenticator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationLegalAuthenticator_patterns_, ))
validate_ParticipationLegalAuthenticator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.noteText is not None or self.time is not None or self.signatureCode is not None or self.signatureText is not None or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.LegalAuthenticator', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.LegalAuthenticator') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.LegalAuthenticator', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.LegalAuthenticator'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "LA" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.LegalAuthenticator', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.noteText is not None: self.noteText.export(outfile, level, namespace_, name_='noteText', pretty_print=pretty_print) if self.time is not None: self.time.export(outfile, level, namespace_, name_='time', pretty_print=pretty_print) if self.signatureCode is not None: self.signatureCode.export(outfile, level, namespace_, name_='signatureCode', pretty_print=pretty_print) if self.signatureText is not None: self.signatureText.export(outfile, level, namespace_, name_='signatureText', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationLegalAuthenticator(self.typeCode) # validate type ParticipationLegalAuthenticator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'noteText': obj_ = ED.factory() obj_.build(child_) self.noteText = obj_ obj_.original_tagname_ = 'noteText' elif nodeName_ == 'time': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.time = obj_ obj_.original_tagname_ = 'time' elif nodeName_ == 'signatureCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.signatureCode = obj_ obj_.original_tagname_ = 'signatureCode' elif nodeName_ == 'signatureText': obj_ = ED.factory() obj_.build(child_) self.signatureText = obj_ obj_.original_tagname_ = 'signatureText' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class PORP_MT050032UV_LegalAuthenticator
[docs]class PORP_MT050032UV_NonXMLBody(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOCBODY', moodCode='EVN', realmCode=None, typeId=None, templateId=None, text=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.text = text
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_NonXMLBody) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_NonXMLBody.subclass: return PORP_MT050032UV_NonXMLBody.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_NonXMLBody(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocumentBody(self, value): # Validate type ActClassDocumentBody, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOCBODY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocumentBody' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocumentBody_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocumentBody_patterns_, ))
validate_ActClassDocumentBody_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.text is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.NonXMLBody', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.NonXMLBody') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.NonXMLBody', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.NonXMLBody'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOCBODY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.NonXMLBody', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocumentBody(self.classCode) # validate type ActClassDocumentBody value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text'
# end class PORP_MT050032UV_NonXMLBody
[docs]class PORP_MT050032UV_ObservationMedia(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN', ID=None, realmCode=None, typeId=None, templateId=None, id=None, text=None, value=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.ID = _cast(None, ID) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.text = text self.value = value
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_ObservationMedia) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_ObservationMedia.subclass: return PORP_MT050032UV_ObservationMedia.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_ObservationMedia(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.text is not None or self.value is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.ObservationMedia', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.ObservationMedia') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.ObservationMedia', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.ObservationMedia'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.ObservationMedia', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'value': obj_ = ED.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value'
# end class PORP_MT050032UV_ObservationMedia
[docs]class PORP_MT050032UV_RelatedDocument(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, contextConductionInd='false', realmCode=None, typeId=None, templateId=None, relatedDocument=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.relatedDocument = relatedDocument
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_RelatedDocument) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_RelatedDocument.subclass: return PORP_MT050032UV_RelatedDocument.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_RelatedDocument(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_relatedDocument(self): return self.relatedDocument
[docs] def set_relatedDocument(self, relatedDocument): self.relatedDocument = relatedDocument
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_x_ActRelationshipDocumentSPL(self, value): # Validate type x_ActRelationshipDocumentSPL, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['APND', 'DRIV', 'RPLC', 'XCRPT', 'XFRM', 'SUBJ'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on x_ActRelationshipDocumentSPL' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_x_ActRelationshipDocumentSPL_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_x_ActRelationshipDocumentSPL_patterns_, ))
validate_x_ActRelationshipDocumentSPL_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.relatedDocument is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.RelatedDocument', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.RelatedDocument') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.RelatedDocument', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.RelatedDocument'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.RelatedDocument', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.relatedDocument is not None: self.relatedDocument.export(outfile, level, namespace_, name_='relatedDocument', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_x_ActRelationshipDocumentSPL(self.typeCode) # validate type x_ActRelationshipDocumentSPL value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'relatedDocument': obj_ = PORP_MT050032UV_RelatedDocument1.factory() obj_.build(child_) self.relatedDocument = obj_ obj_.original_tagname_ = 'relatedDocument'
# end class PORP_MT050032UV_RelatedDocument
[docs]class PORP_MT050032UV_RelatedDocument1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, effectiveTime=None, setId=None, versionNumber=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.effectiveTime = effectiveTime self.setId = setId self.versionNumber = versionNumber
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_RelatedDocument1) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_RelatedDocument1.subclass: return PORP_MT050032UV_RelatedDocument1.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_RelatedDocument1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_setId(self): return self.setId
[docs] def set_setId(self, setId): self.setId = setId
[docs] def get_versionNumber(self): return self.versionNumber
[docs] def set_versionNumber(self, versionNumber): self.versionNumber = versionNumber
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocument(self, value): # Validate type ActClassDocument, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOC', 'DOCCLIN', 'CDALVLONE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocument' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocument_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocument_patterns_, ))
validate_ActClassDocument_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.effectiveTime is not None or self.setId is not None or self.versionNumber is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.RelatedDocument1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.RelatedDocument1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.RelatedDocument1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.RelatedDocument1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.RelatedDocument1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.setId is not None: self.setId.export(outfile, level, namespace_, name_='setId', pretty_print=pretty_print) if self.versionNumber is not None: self.versionNumber.export(outfile, level, namespace_, name_='versionNumber', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocument(self.classCode) # validate type ActClassDocument value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'setId': obj_ = II.factory() obj_.build(child_) self.setId = obj_ obj_.original_tagname_ = 'setId' elif nodeName_ == 'versionNumber': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.versionNumber = obj_ obj_.original_tagname_ = 'versionNumber'
# end class PORP_MT050032UV_RelatedDocument1
[docs]class PORP_MT050032UV_ReplacementOf(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='RPLC', contextConductionInd='false', realmCode=None, typeId=None, templateId=None, sectionReplaced=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sectionReplaced = sectionReplaced
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_ReplacementOf) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_ReplacementOf.subclass: return PORP_MT050032UV_ReplacementOf.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_ReplacementOf(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sectionReplaced(self): return self.sectionReplaced
[docs] def set_sectionReplaced(self, sectionReplaced): self.sectionReplaced = sectionReplaced
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipReplaces(self, value): # Validate type ActRelationshipReplaces, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['RPLC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipReplaces' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipReplaces_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipReplaces_patterns_, ))
validate_ActRelationshipReplaces_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sectionReplaced is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.ReplacementOf', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.ReplacementOf') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.ReplacementOf', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.ReplacementOf'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "RPLC" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.ReplacementOf', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sectionReplaced is not None: self.sectionReplaced.export(outfile, level, namespace_, name_='sectionReplaced', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipReplaces(self.typeCode) # validate type ActRelationshipReplaces value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sectionReplaced': obj_ = PORP_MT050032UV_SectionReplaced.factory() obj_.build(child_) self.sectionReplaced = obj_ obj_.original_tagname_ = 'sectionReplaced'
# end class PORP_MT050032UV_ReplacementOf
[docs]class PORP_MT050032UV_Section(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOCSECT', moodCode='EVN', ID=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, title=None, text=None, effectiveTime=None, confidentialityCode=None, languageCode=None, author=None, replacementOf=None, subjectOf=None, subject=None, subject2=None, excerpt=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.ID = _cast(None, ID) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.title = title self.text = text self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.languageCode = languageCode if author is None: self.author = [] else: self.author = author if replacementOf is None: self.replacementOf = [] else: self.replacementOf = replacementOf if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if subject is None: self.subject = [] else: self.subject = subject if subject2 is None: self.subject2 = [] else: self.subject2 = subject2 self.excerpt = excerpt if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Section) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Section.subclass: return PORP_MT050032UV_Section.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Section(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_languageCode(self): return self.languageCode
[docs] def set_languageCode(self, languageCode): self.languageCode = languageCode
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_replacementOf(self): return self.replacementOf
[docs] def set_replacementOf(self, replacementOf): self.replacementOf = replacementOf
[docs] def add_replacementOf(self, value): self.replacementOf.append(value)
[docs] def insert_replacementOf_at(self, index, value): self.replacementOf.insert(index, value)
[docs] def replace_replacementOf_at(self, index, value): self.replacementOf[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def add_subject(self, value): self.subject.append(value)
[docs] def insert_subject_at(self, index, value): self.subject.insert(index, value)
[docs] def replace_subject_at(self, index, value): self.subject[index] = value
[docs] def get_subject2(self): return self.subject2
[docs] def set_subject2(self, subject2): self.subject2 = subject2
[docs] def add_subject2(self, value): self.subject2.append(value)
[docs] def insert_subject2_at(self, index, value): self.subject2.insert(index, value)
[docs] def replace_subject2_at(self, index, value): self.subject2[index] = value
[docs] def get_excerpt(self): return self.excerpt
[docs] def set_excerpt(self, excerpt): self.excerpt = excerpt
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocumentSection(self, value): # Validate type ActClassDocumentSection, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOCSECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocumentSection' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocumentSection_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocumentSection_patterns_, ))
validate_ActClassDocumentSection_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.title is not None or self.text is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.languageCode is not None or self.author or self.replacementOf or self.subjectOf or self.subject or self.subject2 or self.excerpt is not None or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Section', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Section') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Section', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Section'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOCSECT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Section', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.languageCode is not None: self.languageCode.export(outfile, level, namespace_, name_='languageCode', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for replacementOf_ in self.replacementOf: replacementOf_.export(outfile, level, namespace_, name_='replacementOf', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for subject_ in self.subject: subject_.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) for subject2_ in self.subject2: subject2_.export(outfile, level, namespace_, name_='subject2', pretty_print=pretty_print) if self.excerpt is not None: self.excerpt.export(outfile, level, namespace_, name_='excerpt', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocumentSection(self.classCode) # validate type ActClassDocumentSection value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': obj_ = StrucDoc_Title.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'text': obj_ = StrucDoc_Text.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'languageCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.languageCode = obj_ obj_.original_tagname_ = 'languageCode' elif nodeName_ == 'author': obj_ = PORP_MT050032UV_Author.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'replacementOf': obj_ = PORP_MT050032UV_ReplacementOf.factory() obj_.build(child_) self.replacementOf.append(obj_) obj_.original_tagname_ = 'replacementOf' elif nodeName_ == 'subjectOf': obj_ = PORP_MT050032UV_Subject4.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'subject': obj_ = PORP_MT050032UV_Subject.factory() obj_.build(child_) self.subject.append(obj_) obj_.original_tagname_ = 'subject' elif nodeName_ == 'subject2': obj_ = PORP_MT050032UV_Subject3.factory() obj_.build(child_) self.subject2.append(obj_) obj_.original_tagname_ = 'subject2' elif nodeName_ == 'excerpt': obj_ = PORP_MT050032UV_ExcerptFrom.factory() obj_.build(child_) self.excerpt = obj_ obj_.original_tagname_ = 'excerpt' elif nodeName_ == 'component': obj_ = PORP_MT050032UV_Component1.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class PORP_MT050032UV_Section
[docs]class PORP_MT050032UV_SectionReplaced(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOCSECT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_SectionReplaced) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_SectionReplaced.subclass: return PORP_MT050032UV_SectionReplaced.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_SectionReplaced(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocumentSection(self, value): # Validate type ActClassDocumentSection, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOCSECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocumentSection' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocumentSection_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocumentSection_patterns_, ))
validate_ActClassDocumentSection_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.SectionReplaced', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.SectionReplaced') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.SectionReplaced', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.SectionReplaced'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOCSECT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.SectionReplaced', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocumentSection(self.classCode) # validate type ActClassDocumentSection value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id'
# end class PORP_MT050032UV_SectionReplaced
[docs]class PORP_MT050032UV_SequelTo(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SEQL', realmCode=None, typeId=None, templateId=None, comment=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.comment = comment
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_SequelTo) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_SequelTo.subclass: return PORP_MT050032UV_SequelTo.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_SequelTo(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_comment(self): return self.comment
[docs] def set_comment(self, comment): self.comment = comment
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipSequel(self, value): # Validate type ActRelationshipSequel, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SEQL', 'APND', 'BSLN', 'COMPLY', 'DOC', 'FLFS', 'OCCR', 'OREF', 'SCH', 'GEN', 'GEVL', 'INST', 'MOD', 'MTCH', 'OPTN', 'RCHAL', 'REV', 'RPLC', 'SUCC', 'UPDT', 'XCRPT', 'VRXCRPT', 'XFRM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipSequel' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipSequel_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipSequel_patterns_, ))
validate_ActRelationshipSequel_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.comment is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.SequelTo', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.SequelTo') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.SequelTo', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.SequelTo'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SEQL" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.SequelTo', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.comment is not None: self.comment.export(outfile, level, namespace_, name_='comment', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipSequel(self.typeCode) # validate type ActRelationshipSequel
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'comment': obj_ = PORP_MT050032UV_Comment.factory() obj_.build(child_) self.comment = obj_ obj_.original_tagname_ = 'comment'
# end class PORP_MT050032UV_SequelTo
[docs]class PORP_MT050032UV_StructuredBody(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOCBODY', moodCode='EVN', realmCode=None, typeId=None, templateId=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_StructuredBody) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_StructuredBody.subclass: return PORP_MT050032UV_StructuredBody.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_StructuredBody(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocumentBody(self, value): # Validate type ActClassDocumentBody, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOCBODY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocumentBody' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocumentBody_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocumentBody_patterns_, ))
validate_ActClassDocumentBody_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.StructuredBody', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.StructuredBody') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.StructuredBody', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.StructuredBody'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOCBODY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.StructuredBody', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocumentBody(self.classCode) # validate type ActClassDocumentBody value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'component': obj_ = PORP_MT050032UV_Component2.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class PORP_MT050032UV_StructuredBody
[docs]class PORP_MT050032UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, manufacturedProduct=None, identifiedSubstance=None, ingredient=None, moiety=None, instanceOfKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct = manufacturedProduct self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety self.instanceOfKind = instanceOfKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Subject.subclass: return PORP_MT050032UV_Subject.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_instanceOfKind(self): return self.instanceOfKind
[docs] def set_instanceOfKind(self, instanceOfKind): self.instanceOfKind = instanceOfKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct is not None or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None or self.instanceOfKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print) if self.instanceOfKind is not None: self.instanceOfKind.export(outfile, level, namespace_, name_='instanceOfKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010100UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety' elif nodeName_ == 'instanceOfKind': obj_ = POCP_MT020200UV_InstanceOfKind.factory() obj_.build(child_) self.instanceOfKind = obj_ obj_.original_tagname_ = 'instanceOfKind'
# end class PORP_MT050032UV_Subject
[docs]class PORP_MT050032UV_Subject1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, substanceAdministration=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.substanceAdministration = substanceAdministration
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Subject1) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Subject1.subclass: return PORP_MT050032UV_Subject1.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Subject1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.substanceAdministration is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Subject1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Subject1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Subject1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT060100UV_SubstanceAdministration1.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration'
# end class PORP_MT050032UV_Subject1
[docs]class PORP_MT050032UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, textFragmentReference=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.textFragmentReference = textFragmentReference
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Subject2.subclass: return PORP_MT050032UV_Subject2.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_textFragmentReference(self): return self.textFragmentReference
[docs] def set_textFragmentReference(self, textFragmentReference): self.textFragmentReference = textFragmentReference
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.textFragmentReference is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.textFragmentReference is not None: self.textFragmentReference.export(outfile, level, namespace_, name_='textFragmentReference', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'textFragmentReference': obj_ = PORP_MT050032UV_TextFragmentReference.factory() obj_.build(child_) self.textFragmentReference = obj_ obj_.original_tagname_ = 'textFragmentReference'
# end class PORP_MT050032UV_Subject2
[docs]class PORP_MT050032UV_Subject3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, substanceAdministration=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.substanceAdministration = substanceAdministration self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Subject3) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Subject3.subclass: return PORP_MT050032UV_Subject3.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Subject3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.substanceAdministration is not None or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Subject3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Subject3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Subject3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT060100UV_SubstanceAdministration1.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class PORP_MT050032UV_Subject3
[docs]class PORP_MT050032UV_Subject4(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, comment=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.comment = comment
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Subject4) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Subject4.subclass: return PORP_MT050032UV_Subject4.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Subject4(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_comment(self): return self.comment
[docs] def set_comment(self, comment): self.comment = comment
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.comment is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject4', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Subject4') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Subject4', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Subject4'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Subject4', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.comment is not None: self.comment.export(outfile, level, namespace_, name_='comment', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'comment': obj_ = PORP_MT050032UV_Comment.factory() obj_.build(child_) self.comment = obj_ obj_.original_tagname_ = 'comment'
# end class PORP_MT050032UV_Subject4
[docs]class PORP_MT050032UV_TextFragmentReference(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, text=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.text = text
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_TextFragmentReference) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_TextFragmentReference.subclass: return PORP_MT050032UV_TextFragmentReference.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_TextFragmentReference(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.text is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.TextFragmentReference', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.TextFragmentReference') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.TextFragmentReference', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.TextFragmentReference'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.TextFragmentReference', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text'
# end class PORP_MT050032UV_TextFragmentReference
[docs]class PORP_MT050032UV_Verifier(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='VRF', realmCode=None, typeId=None, templateId=None, noteText=None, time=None, signatureCode=None, signatureText=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.noteText = noteText self.time = time self.signatureCode = signatureCode self.signatureText = signatureText self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PORP_MT050032UV_Verifier) if subclass is not None: return subclass(*args_, **kwargs_) if PORP_MT050032UV_Verifier.subclass: return PORP_MT050032UV_Verifier.subclass(*args_, **kwargs_) else: return PORP_MT050032UV_Verifier(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_noteText(self): return self.noteText
[docs] def set_noteText(self, noteText): self.noteText = noteText
[docs] def get_time(self): return self.time
[docs] def set_time(self, time): self.time = time
[docs] def get_signatureCode(self): return self.signatureCode
[docs] def set_signatureCode(self, signatureCode): self.signatureCode = signatureCode
[docs] def get_signatureText(self): return self.signatureText
[docs] def set_signatureText(self, signatureText): self.signatureText = signatureText
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationVerifier(self, value): # Validate type ParticipationVerifier, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['VRF', 'AUTHEN', 'LA'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationVerifier' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationVerifier_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationVerifier_patterns_, ))
validate_ParticipationVerifier_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.noteText is not None or self.time is not None or self.signatureCode is not None or self.signatureText is not None or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Verifier', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PORP_MT050032UV.Verifier') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PORP_MT050032UV.Verifier', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PORP_MT050032UV.Verifier'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "VRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PORP_MT050032UV.Verifier', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.noteText is not None: self.noteText.export(outfile, level, namespace_, name_='noteText', pretty_print=pretty_print) if self.time is not None: self.time.export(outfile, level, namespace_, name_='time', pretty_print=pretty_print) if self.signatureCode is not None: self.signatureCode.export(outfile, level, namespace_, name_='signatureCode', pretty_print=pretty_print) if self.signatureText is not None: self.signatureText.export(outfile, level, namespace_, name_='signatureText', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationVerifier(self.typeCode) # validate type ParticipationVerifier
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'noteText': obj_ = ED.factory() obj_.build(child_) self.noteText = obj_ obj_.original_tagname_ = 'noteText' elif nodeName_ == 'time': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.time = obj_ obj_.original_tagname_ = 'time' elif nodeName_ == 'signatureCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.signatureCode = obj_ obj_.original_tagname_ = 'signatureCode' elif nodeName_ == 'signatureText': obj_ = ED.factory() obj_.build(child_) self.signatureText = obj_ obj_.original_tagname_ = 'signatureText' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class PORP_MT050032UV_Verifier
[docs]class StrucDoc_Text(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, mediaType=None, content=None, linkHtml=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, renderMultiMedia=None, paragraph=None, list=None, table=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.mediaType = _cast(None, mediaType) if content is None: self.content = [] else: self.content = content if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef if renderMultiMedia is None: self.renderMultiMedia = [] else: self.renderMultiMedia = renderMultiMedia if paragraph is None: self.paragraph = [] else: self.paragraph = paragraph if list is None: self.list = [] else: self.list = list if table is None: self.table = [] else: self.table = table self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Text) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Text.subclass: return StrucDoc_Text.subclass(*args_, **kwargs_) else: return StrucDoc_Text(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_renderMultiMedia(self): return self.renderMultiMedia
[docs] def set_renderMultiMedia(self, renderMultiMedia): self.renderMultiMedia = renderMultiMedia
[docs] def add_renderMultiMedia(self, value): self.renderMultiMedia.append(value)
[docs] def insert_renderMultiMedia_at(self, index, value): self.renderMultiMedia.insert(index, value)
[docs] def replace_renderMultiMedia_at(self, index, value): self.renderMultiMedia[index] = value
[docs] def get_paragraph(self): return self.paragraph
[docs] def set_paragraph(self, paragraph): self.paragraph = paragraph
[docs] def add_paragraph(self, value): self.paragraph.append(value)
[docs] def insert_paragraph_at(self, index, value): self.paragraph.insert(index, value)
[docs] def replace_paragraph_at(self, index, value): self.paragraph[index] = value
[docs] def get_list(self): return self.list
[docs] def set_list(self, list): self.list = list
[docs] def add_list(self, value): self.list.append(value)
[docs] def insert_list_at(self, index, value): self.list.insert(index, value)
[docs] def replace_list_at(self, index, value): self.list[index] = value
[docs] def get_table(self): return self.table
[docs] def set_table(self, table): self.table = table
[docs] def add_table(self, value): self.table.append(value)
[docs] def insert_table_at(self, index, value): self.table.insert(index, value)
[docs] def replace_table_at(self, index, value): self.table[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_mediaType(self): return self.mediaType
[docs] def set_mediaType(self, mediaType): self.mediaType = mediaType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.linkHtml or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or self.renderMultiMedia or self.paragraph or self.list or self.table or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Text', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Text') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Text', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Text'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.mediaType is not None and 'mediaType' not in already_processed: already_processed.add('mediaType') outfile.write(' mediaType=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mediaType), input_name='mediaType')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Text', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('mediaType', node) if value is not None and 'mediaType' not in already_processed: already_processed.add('mediaType') self.mediaType = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_Content.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) elif nodeName_ == 'renderMultiMedia': obj_ = StrucDoc_RenderMultiMedia.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'renderMultiMedia', obj_) self.content_.append(obj_) if hasattr(self, 'add_renderMultiMedia'): self.add_renderMultiMedia(obj_.value) elif hasattr(self, 'set_renderMultiMedia'): self.set_renderMultiMedia(obj_.value) elif nodeName_ == 'paragraph': obj_ = StrucDoc_Paragraph.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'paragraph', obj_) self.content_.append(obj_) if hasattr(self, 'add_paragraph'): self.add_paragraph(obj_.value) elif hasattr(self, 'set_paragraph'): self.set_paragraph(obj_.value) elif nodeName_ == 'list': obj_ = StrucDoc_List.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'list', obj_) self.content_.append(obj_) if hasattr(self, 'add_list'): self.add_list(obj_.value) elif hasattr(self, 'set_list'): self.set_list(obj_.value) elif nodeName_ == 'table': obj_ = StrucDoc_Table.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'table', obj_) self.content_.append(obj_) if hasattr(self, 'add_table'): self.add_table(obj_.value) elif hasattr(self, 'set_table'): self.set_table(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Text
[docs]class StrucDoc_Title(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, mediaType=None, content=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.mediaType = _cast(None, mediaType) if content is None: self.content = [] else: self.content = content if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Title) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Title.subclass: return StrucDoc_Title.subclass(*args_, **kwargs_) else: return StrucDoc_Title(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_mediaType(self): return self.mediaType
[docs] def set_mediaType(self, mediaType): self.mediaType = mediaType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Title', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Title') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Title', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Title'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.mediaType is not None and 'mediaType' not in already_processed: already_processed.add('mediaType') outfile.write(' mediaType=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mediaType), input_name='mediaType')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Title', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('mediaType', node) if value is not None and 'mediaType' not in already_processed: already_processed.add('mediaType') self.mediaType = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_TitleContent.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_TitleFootnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Title
[docs]class StrucDoc_Caption(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, linkHtml=None, sub=None, sup=None, footnote=None, footnoteRef=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Caption) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Caption.subclass: return StrucDoc_Caption.subclass(*args_, **kwargs_) else: return StrucDoc_Caption(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( self.linkHtml or self.sub or self.sup or self.footnote or self.footnoteRef or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Caption', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Caption') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Caption', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Caption'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Caption', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Caption
[docs]class StrucDoc_Col(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, span='1', width=None, align=None, char=None, charoff=None, valign=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.span = _cast(None, span) self.width = _cast(None, width) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Col) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Col.subclass: return StrucDoc_Col.subclass(*args_, **kwargs_) else: return StrucDoc_Col(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_span(self): return self.span
[docs] def set_span(self, span): self.span = span
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def hasContent_(self): if ( ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Col', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Col') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Col', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Col'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.span != "1" and 'span' not in already_processed: already_processed.add('span') outfile.write(' span=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.span), input_name='span')), )) if self.width is not None and 'width' not in already_processed: already_processed.add('width') outfile.write(' width=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.width), input_name='width')), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Col', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('span', node) if value is not None and 'span' not in already_processed: already_processed.add('span') self.span = value value = find_attr_value_('width', node) if value is not None and 'width' not in already_processed: already_processed.add('width') self.width = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass
# end class StrucDoc_Col
[docs]class StrucDoc_Colgroup(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, span='1', width=None, align=None, char=None, charoff=None, valign=None, col=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.span = _cast(None, span) self.width = _cast(None, width) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign) if col is None: self.col = [] else: self.col = col
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Colgroup) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Colgroup.subclass: return StrucDoc_Colgroup.subclass(*args_, **kwargs_) else: return StrucDoc_Colgroup(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_col(self): return self.col
[docs] def set_col(self, col): self.col = col
[docs] def add_col(self, value): self.col.append(value)
[docs] def insert_col_at(self, index, value): self.col.insert(index, value)
[docs] def replace_col_at(self, index, value): self.col[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_span(self): return self.span
[docs] def set_span(self, span): self.span = span
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def hasContent_(self): if ( self.col ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Colgroup', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Colgroup') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Colgroup', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Colgroup'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.span != "1" and 'span' not in already_processed: already_processed.add('span') outfile.write(' span=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.span), input_name='span')), )) if self.width is not None and 'width' not in already_processed: already_processed.add('width') outfile.write(' width=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.width), input_name='width')), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Colgroup', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for col_ in self.col: col_.export(outfile, level, namespace_, name_='col', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('span', node) if value is not None and 'span' not in already_processed: already_processed.add('span') self.span = value value = find_attr_value_('width', node) if value is not None and 'width' not in already_processed: already_processed.add('width') self.width = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'col': obj_ = StrucDoc_Col.factory() obj_.build(child_) self.col.append(obj_) obj_.original_tagname_ = 'col'
# end class StrucDoc_Colgroup
[docs]class StrucDoc_Content(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, revised=None, content=None, linkHtml=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, renderMultiMedia=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.revised = _cast(None, revised) if content is None: self.content = [] else: self.content = content if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef if renderMultiMedia is None: self.renderMultiMedia = [] else: self.renderMultiMedia = renderMultiMedia self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Content) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Content.subclass: return StrucDoc_Content.subclass(*args_, **kwargs_) else: return StrucDoc_Content(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_renderMultiMedia(self): return self.renderMultiMedia
[docs] def set_renderMultiMedia(self, renderMultiMedia): self.renderMultiMedia = renderMultiMedia
[docs] def add_renderMultiMedia(self, value): self.renderMultiMedia.append(value)
[docs] def insert_renderMultiMedia_at(self, index, value): self.renderMultiMedia.insert(index, value)
[docs] def replace_renderMultiMedia_at(self, index, value): self.renderMultiMedia[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_revised(self): return self.revised
[docs] def set_revised(self, revised): self.revised = revised
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.linkHtml or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or self.renderMultiMedia or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Content', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Content') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Content', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Content'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.revised is not None and 'revised' not in already_processed: already_processed.add('revised') outfile.write(' revised=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.revised), input_name='revised')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Content', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('revised', node) if value is not None and 'revised' not in already_processed: already_processed.add('revised') self.revised = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_Content.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) elif nodeName_ == 'renderMultiMedia': obj_ = StrucDoc_RenderMultiMedia.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'renderMultiMedia', obj_) self.content_.append(obj_) if hasattr(self, 'add_renderMultiMedia'): self.add_renderMultiMedia(obj_.value) elif hasattr(self, 'set_renderMultiMedia'): self.set_renderMultiMedia(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Content
[docs]class StrucDoc_TitleContent(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, content=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) if content is None: self.content = [] else: self.content = content if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_TitleContent) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_TitleContent.subclass: return StrucDoc_TitleContent.subclass(*args_, **kwargs_) else: return StrucDoc_TitleContent(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.TitleContent', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.TitleContent') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.TitleContent', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.TitleContent'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.TitleContent', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_TitleContent.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_TitleFootnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_TitleContent
[docs]class StrucDoc_Footnote(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, content=None, linkHtml=None, sub=None, sup=None, br=None, renderMultiMedia=None, paragraph=None, list=None, table=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) if content is None: self.content = [] else: self.content = content if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if renderMultiMedia is None: self.renderMultiMedia = [] else: self.renderMultiMedia = renderMultiMedia if paragraph is None: self.paragraph = [] else: self.paragraph = paragraph if list is None: self.list = [] else: self.list = list if table is None: self.table = [] else: self.table = table self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Footnote) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Footnote.subclass: return StrucDoc_Footnote.subclass(*args_, **kwargs_) else: return StrucDoc_Footnote(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_renderMultiMedia(self): return self.renderMultiMedia
[docs] def set_renderMultiMedia(self, renderMultiMedia): self.renderMultiMedia = renderMultiMedia
[docs] def add_renderMultiMedia(self, value): self.renderMultiMedia.append(value)
[docs] def insert_renderMultiMedia_at(self, index, value): self.renderMultiMedia.insert(index, value)
[docs] def replace_renderMultiMedia_at(self, index, value): self.renderMultiMedia[index] = value
[docs] def get_paragraph(self): return self.paragraph
[docs] def set_paragraph(self, paragraph): self.paragraph = paragraph
[docs] def add_paragraph(self, value): self.paragraph.append(value)
[docs] def insert_paragraph_at(self, index, value): self.paragraph.insert(index, value)
[docs] def replace_paragraph_at(self, index, value): self.paragraph[index] = value
[docs] def get_list(self): return self.list
[docs] def set_list(self, list): self.list = list
[docs] def add_list(self, value): self.list.append(value)
[docs] def insert_list_at(self, index, value): self.list.insert(index, value)
[docs] def replace_list_at(self, index, value): self.list[index] = value
[docs] def get_table(self): return self.table
[docs] def set_table(self, table): self.table = table
[docs] def add_table(self, value): self.table.append(value)
[docs] def insert_table_at(self, index, value): self.table.insert(index, value)
[docs] def replace_table_at(self, index, value): self.table[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.linkHtml or self.sub or self.sup or self.br or self.renderMultiMedia or self.paragraph or self.list or self.table or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Footnote', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Footnote') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Footnote', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Footnote'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Footnote', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_Content.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'renderMultiMedia': obj_ = StrucDoc_RenderMultiMedia.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'renderMultiMedia', obj_) self.content_.append(obj_) if hasattr(self, 'add_renderMultiMedia'): self.add_renderMultiMedia(obj_.value) elif hasattr(self, 'set_renderMultiMedia'): self.set_renderMultiMedia(obj_.value) elif nodeName_ == 'paragraph': obj_ = StrucDoc_Paragraph.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'paragraph', obj_) self.content_.append(obj_) if hasattr(self, 'add_paragraph'): self.add_paragraph(obj_.value) elif hasattr(self, 'set_paragraph'): self.set_paragraph(obj_.value) elif nodeName_ == 'list': obj_ = StrucDoc_List.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'list', obj_) self.content_.append(obj_) if hasattr(self, 'add_list'): self.add_list(obj_.value) elif hasattr(self, 'set_list'): self.set_list(obj_.value) elif nodeName_ == 'table': obj_ = StrucDoc_Table.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'table', obj_) self.content_.append(obj_) if hasattr(self, 'add_table'): self.add_table(obj_.value) elif hasattr(self, 'set_table'): self.set_table(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Footnote
[docs]class StrucDoc_TitleFootnote(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, content=None, sub=None, sup=None, br=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) if content is None: self.content = [] else: self.content = content if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_TitleFootnote) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_TitleFootnote.subclass: return StrucDoc_TitleFootnote.subclass(*args_, **kwargs_) else: return StrucDoc_TitleFootnote(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.sub or self.sup or self.br or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.TitleFootnote', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.TitleFootnote') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.TitleFootnote', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.TitleFootnote'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.TitleFootnote', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_TitleContent.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_TitleFootnote
[docs]class StrucDoc_FootnoteRef(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, IDREF=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.IDREF = _cast(None, IDREF)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_FootnoteRef) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_FootnoteRef.subclass: return StrucDoc_FootnoteRef.subclass(*args_, **kwargs_) else: return StrucDoc_FootnoteRef(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_IDREF(self): return self.IDREF
[docs] def set_IDREF(self, IDREF): self.IDREF = IDREF
[docs] def hasContent_(self): if ( ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.FootnoteRef', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.FootnoteRef') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.FootnoteRef', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.FootnoteRef'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.IDREF is not None and 'IDREF' not in already_processed: already_processed.add('IDREF') outfile.write(' IDREF=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.IDREF), input_name='IDREF')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.FootnoteRef', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('IDREF', node) if value is not None and 'IDREF' not in already_processed: already_processed.add('IDREF') self.IDREF = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass
# end class StrucDoc_FootnoteRef
[docs]class StrucDoc_Item(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, caption=None, content=None, linkHtml=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, renderMultiMedia=None, paragraph=None, list=None, table=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.caption = caption if content is None: self.content = [] else: self.content = content if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef if renderMultiMedia is None: self.renderMultiMedia = [] else: self.renderMultiMedia = renderMultiMedia if paragraph is None: self.paragraph = [] else: self.paragraph = paragraph if list is None: self.list = [] else: self.list = list if table is None: self.table = [] else: self.table = table self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Item) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Item.subclass: return StrucDoc_Item.subclass(*args_, **kwargs_) else: return StrucDoc_Item(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_caption(self): return self.caption
[docs] def set_caption(self, caption): self.caption = caption
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_renderMultiMedia(self): return self.renderMultiMedia
[docs] def set_renderMultiMedia(self, renderMultiMedia): self.renderMultiMedia = renderMultiMedia
[docs] def add_renderMultiMedia(self, value): self.renderMultiMedia.append(value)
[docs] def insert_renderMultiMedia_at(self, index, value): self.renderMultiMedia.insert(index, value)
[docs] def replace_renderMultiMedia_at(self, index, value): self.renderMultiMedia[index] = value
[docs] def get_paragraph(self): return self.paragraph
[docs] def set_paragraph(self, paragraph): self.paragraph = paragraph
[docs] def add_paragraph(self, value): self.paragraph.append(value)
[docs] def insert_paragraph_at(self, index, value): self.paragraph.insert(index, value)
[docs] def replace_paragraph_at(self, index, value): self.paragraph[index] = value
[docs] def get_list(self): return self.list
[docs] def set_list(self, list): self.list = list
[docs] def add_list(self, value): self.list.append(value)
[docs] def insert_list_at(self, index, value): self.list.insert(index, value)
[docs] def replace_list_at(self, index, value): self.list[index] = value
[docs] def get_table(self): return self.table
[docs] def set_table(self, table): self.table = table
[docs] def add_table(self, value): self.table.append(value)
[docs] def insert_table_at(self, index, value): self.table.insert(index, value)
[docs] def replace_table_at(self, index, value): self.table[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.caption is not None or self.content or self.linkHtml or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or self.renderMultiMedia or self.paragraph or self.list or self.table or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Item', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Item') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Item', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Item'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Item', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'caption': obj_ = StrucDoc_Caption.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'caption', obj_) self.content_.append(obj_) if hasattr(self, 'add_caption'): self.add_caption(obj_.value) elif hasattr(self, 'set_caption'): self.set_caption(obj_.value) elif nodeName_ == 'content': obj_ = StrucDoc_Content.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) elif nodeName_ == 'renderMultiMedia': obj_ = StrucDoc_RenderMultiMedia.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'renderMultiMedia', obj_) self.content_.append(obj_) if hasattr(self, 'add_renderMultiMedia'): self.add_renderMultiMedia(obj_.value) elif hasattr(self, 'set_renderMultiMedia'): self.set_renderMultiMedia(obj_.value) elif nodeName_ == 'paragraph': obj_ = StrucDoc_Paragraph.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'paragraph', obj_) self.content_.append(obj_) if hasattr(self, 'add_paragraph'): self.add_paragraph(obj_.value) elif hasattr(self, 'set_paragraph'): self.set_paragraph(obj_.value) elif nodeName_ == 'list': obj_ = StrucDoc_List.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'list', obj_) self.content_.append(obj_) if hasattr(self, 'add_list'): self.add_list(obj_.value) elif hasattr(self, 'set_list'): self.set_list(obj_.value) elif nodeName_ == 'table': obj_ = StrucDoc_Table.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'table', obj_) self.content_.append(obj_) if hasattr(self, 'add_table'): self.add_table(obj_.value) elif hasattr(self, 'set_table'): self.set_table(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Item
[docs]class StrucDoc_LinkHtml(GeneratedsSuper): subclass = None superclass = None def __init__(self, name=None, href=None, rel=None, rev=None, title=None, ID=None, language=None, styleCode=None, footnote=None, footnoteRef=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.name = _cast(None, name) self.href = _cast(None, href) self.rel = _cast(None, rel) self.rev = _cast(None, rev) self.title = _cast(None, title) self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_LinkHtml) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_LinkHtml.subclass: return StrucDoc_LinkHtml.subclass(*args_, **kwargs_) else: return StrucDoc_LinkHtml(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_href(self): return self.href
[docs] def set_href(self, href): self.href = href
[docs] def get_rel(self): return self.rel
[docs] def set_rel(self, rel): self.rel = rel
[docs] def get_rev(self): return self.rev
[docs] def set_rev(self, rev): self.rev = rev
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( self.footnote or self.footnoteRef or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.LinkHtml', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.LinkHtml') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.LinkHtml', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.LinkHtml'): if self.name is not None and 'name' not in already_processed: already_processed.add('name') outfile.write(' name=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.name), input_name='name')), )) if self.href is not None and 'href' not in already_processed: already_processed.add('href') outfile.write(' href=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.href), input_name='href')), )) if self.rel is not None and 'rel' not in already_processed: already_processed.add('rel') outfile.write(' rel=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.rel), input_name='rel')), )) if self.rev is not None and 'rev' not in already_processed: already_processed.add('rev') outfile.write(' rev=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.rev), input_name='rev')), )) if self.title is not None and 'title' not in already_processed: already_processed.add('title') outfile.write(' title=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.title), input_name='title')), )) if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.LinkHtml', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('name', node) if value is not None and 'name' not in already_processed: already_processed.add('name') self.name = value value = find_attr_value_('href', node) if value is not None and 'href' not in already_processed: already_processed.add('href') self.href = value value = find_attr_value_('rel', node) if value is not None and 'rel' not in already_processed: already_processed.add('rel') self.rel = value value = find_attr_value_('rev', node) if value is not None and 'rev' not in already_processed: already_processed.add('rev') self.rev = value value = find_attr_value_('title', node) if value is not None and 'title' not in already_processed: already_processed.add('title') self.title = value value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_LinkHtml
[docs]class StrucDoc_List(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, listType='unordered', caption=None, item=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.listType = _cast(None, listType) self.caption = caption if item is None: self.item = [] else: self.item = item
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_List) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_List.subclass: return StrucDoc_List.subclass(*args_, **kwargs_) else: return StrucDoc_List(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_caption(self): return self.caption
[docs] def set_caption(self, caption): self.caption = caption
[docs] def get_item(self): return self.item
[docs] def set_item(self, item): self.item = item
[docs] def add_item(self, value): self.item.append(value)
[docs] def insert_item_at(self, index, value): self.item.insert(index, value)
[docs] def replace_item_at(self, index, value): self.item[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_listType(self): return self.listType
[docs] def set_listType(self, listType): self.listType = listType
[docs] def hasContent_(self): if ( self.caption is not None or self.item ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.List', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.List') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.List', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.List'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.listType != "unordered" and 'listType' not in already_processed: already_processed.add('listType') outfile.write(' listType=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.listType), input_name='listType')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.List', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.caption is not None: self.caption.export(outfile, level, namespace_, name_='caption', pretty_print=pretty_print) for item_ in self.item: item_.export(outfile, level, namespace_, name_='item', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('listType', node) if value is not None and 'listType' not in already_processed: already_processed.add('listType') self.listType = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'caption': obj_ = StrucDoc_Caption.factory() obj_.build(child_) self.caption = obj_ obj_.original_tagname_ = 'caption' elif nodeName_ == 'item': obj_ = StrucDoc_Item.factory() obj_.build(child_) self.item.append(obj_) obj_.original_tagname_ = 'item'
# end class StrucDoc_List
[docs]class StrucDoc_Paragraph(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, caption=None, content=None, linkHtml=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, renderMultiMedia=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.caption = caption if content is None: self.content = [] else: self.content = content if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef if renderMultiMedia is None: self.renderMultiMedia = [] else: self.renderMultiMedia = renderMultiMedia self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Paragraph) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Paragraph.subclass: return StrucDoc_Paragraph.subclass(*args_, **kwargs_) else: return StrucDoc_Paragraph(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_caption(self): return self.caption
[docs] def set_caption(self, caption): self.caption = caption
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_renderMultiMedia(self): return self.renderMultiMedia
[docs] def set_renderMultiMedia(self, renderMultiMedia): self.renderMultiMedia = renderMultiMedia
[docs] def add_renderMultiMedia(self, value): self.renderMultiMedia.append(value)
[docs] def insert_renderMultiMedia_at(self, index, value): self.renderMultiMedia.insert(index, value)
[docs] def replace_renderMultiMedia_at(self, index, value): self.renderMultiMedia[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.caption is not None or self.content or self.linkHtml or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or self.renderMultiMedia or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Paragraph', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Paragraph') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Paragraph', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Paragraph'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Paragraph', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'caption': obj_ = StrucDoc_Caption.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'caption', obj_) self.content_.append(obj_) if hasattr(self, 'add_caption'): self.add_caption(obj_.value) elif hasattr(self, 'set_caption'): self.set_caption(obj_.value) elif nodeName_ == 'content': obj_ = StrucDoc_Content.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) elif nodeName_ == 'renderMultiMedia': obj_ = StrucDoc_RenderMultiMedia.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'renderMultiMedia', obj_) self.content_.append(obj_) if hasattr(self, 'add_renderMultiMedia'): self.add_renderMultiMedia(obj_.value) elif hasattr(self, 'set_renderMultiMedia'): self.set_renderMultiMedia(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Paragraph
[docs]class StrucDoc_RenderMultiMedia(GeneratedsSuper): subclass = None superclass = None def __init__(self, referencedObject=None, ID=None, language=None, styleCode=None, caption=None): self.original_tagname_ = None self.referencedObject = _cast(None, referencedObject) self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.caption = caption
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_RenderMultiMedia) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_RenderMultiMedia.subclass: return StrucDoc_RenderMultiMedia.subclass(*args_, **kwargs_) else: return StrucDoc_RenderMultiMedia(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_caption(self): return self.caption
[docs] def set_caption(self, caption): self.caption = caption
[docs] def get_referencedObject(self): return self.referencedObject
[docs] def set_referencedObject(self, referencedObject): self.referencedObject = referencedObject
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def hasContent_(self): if ( self.caption is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.RenderMultiMedia', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.RenderMultiMedia') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.RenderMultiMedia', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.RenderMultiMedia'): if self.referencedObject is not None and 'referencedObject' not in already_processed: already_processed.add('referencedObject') outfile.write(' referencedObject=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.referencedObject), input_name='referencedObject')), )) if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.RenderMultiMedia', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.caption is not None: self.caption.export(outfile, level, namespace_, name_='caption', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('referencedObject', node) if value is not None and 'referencedObject' not in already_processed: already_processed.add('referencedObject') self.referencedObject = value value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'caption': obj_ = StrucDoc_Caption.factory() obj_.build(child_) self.caption = obj_ obj_.original_tagname_ = 'caption'
# end class StrucDoc_RenderMultiMedia
[docs]class StrucDoc_Sub(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Sub) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Sub.subclass: return StrucDoc_Sub.subclass(*args_, **kwargs_) else: return StrucDoc_Sub(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Sub', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Sub') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Sub'): pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Sub', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class StrucDoc_Sub
[docs]class StrucDoc_Sup(GeneratedsSuper): subclass = None superclass = None def __init__(self, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Sup) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Sup.subclass: return StrucDoc_Sup.subclass(*args_, **kwargs_) else: return StrucDoc_Sup(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Sup', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Sup') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Sup'): pass
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Sup', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): pass
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class StrucDoc_Sup
[docs]class StrucDoc_Table(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, summary=None, width=None, border=None, frame=None, rules=None, cellspacing=None, cellpadding=None, caption=None, col=None, colgroup=None, thead=None, tfoot=None, tbody=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.summary = _cast(None, summary) self.width = _cast(None, width) self.border = _cast(None, border) self.frame = _cast(None, frame) self.rules = _cast(None, rules) self.cellspacing = _cast(None, cellspacing) self.cellpadding = _cast(None, cellpadding) self.caption = caption if col is None: self.col = [] else: self.col = col if colgroup is None: self.colgroup = [] else: self.colgroup = colgroup self.thead = thead self.tfoot = tfoot if tbody is None: self.tbody = [] else: self.tbody = tbody
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Table) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Table.subclass: return StrucDoc_Table.subclass(*args_, **kwargs_) else: return StrucDoc_Table(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_caption(self): return self.caption
[docs] def set_caption(self, caption): self.caption = caption
[docs] def get_col(self): return self.col
[docs] def set_col(self, col): self.col = col
[docs] def add_col(self, value): self.col.append(value)
[docs] def insert_col_at(self, index, value): self.col.insert(index, value)
[docs] def replace_col_at(self, index, value): self.col[index] = value
[docs] def get_colgroup(self): return self.colgroup
[docs] def set_colgroup(self, colgroup): self.colgroup = colgroup
[docs] def add_colgroup(self, value): self.colgroup.append(value)
[docs] def insert_colgroup_at(self, index, value): self.colgroup.insert(index, value)
[docs] def replace_colgroup_at(self, index, value): self.colgroup[index] = value
[docs] def get_thead(self): return self.thead
[docs] def set_thead(self, thead): self.thead = thead
[docs] def get_tfoot(self): return self.tfoot
[docs] def set_tfoot(self, tfoot): self.tfoot = tfoot
[docs] def get_tbody(self): return self.tbody
[docs] def set_tbody(self, tbody): self.tbody = tbody
[docs] def add_tbody(self, value): self.tbody.append(value)
[docs] def insert_tbody_at(self, index, value): self.tbody.insert(index, value)
[docs] def replace_tbody_at(self, index, value): self.tbody[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_summary(self): return self.summary
[docs] def set_summary(self, summary): self.summary = summary
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def get_border(self): return self.border
[docs] def set_border(self, border): self.border = border
[docs] def get_frame(self): return self.frame
[docs] def set_frame(self, frame): self.frame = frame
[docs] def get_rules(self): return self.rules
[docs] def set_rules(self, rules): self.rules = rules
[docs] def get_cellspacing(self): return self.cellspacing
[docs] def set_cellspacing(self, cellspacing): self.cellspacing = cellspacing
[docs] def get_cellpadding(self): return self.cellpadding
[docs] def set_cellpadding(self, cellpadding): self.cellpadding = cellpadding
[docs] def hasContent_(self): if ( self.caption is not None or self.col or self.colgroup or self.thead is not None or self.tfoot is not None or self.tbody ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Table', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Table') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Table', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Table'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.summary is not None and 'summary' not in already_processed: already_processed.add('summary') outfile.write(' summary=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.summary), input_name='summary')), )) if self.width is not None and 'width' not in already_processed: already_processed.add('width') outfile.write(' width=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.width), input_name='width')), )) if self.border is not None and 'border' not in already_processed: already_processed.add('border') outfile.write(' border=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.border), input_name='border')), )) if self.frame is not None and 'frame' not in already_processed: already_processed.add('frame') outfile.write(' frame=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.frame), input_name='frame')), )) if self.rules is not None and 'rules' not in already_processed: already_processed.add('rules') outfile.write(' rules=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.rules), input_name='rules')), )) if self.cellspacing is not None and 'cellspacing' not in already_processed: already_processed.add('cellspacing') outfile.write(' cellspacing=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.cellspacing), input_name='cellspacing')), )) if self.cellpadding is not None and 'cellpadding' not in already_processed: already_processed.add('cellpadding') outfile.write(' cellpadding=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.cellpadding), input_name='cellpadding')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Table', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.caption is not None: self.caption.export(outfile, level, namespace_, name_='caption', pretty_print=pretty_print) for col_ in self.col: col_.export(outfile, level, namespace_, name_='col', pretty_print=pretty_print) for colgroup_ in self.colgroup: colgroup_.export(outfile, level, namespace_, name_='colgroup', pretty_print=pretty_print) if self.thead is not None: self.thead.export(outfile, level, namespace_, name_='thead', pretty_print=pretty_print) if self.tfoot is not None: self.tfoot.export(outfile, level, namespace_, name_='tfoot', pretty_print=pretty_print) for tbody_ in self.tbody: tbody_.export(outfile, level, namespace_, name_='tbody', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('summary', node) if value is not None and 'summary' not in already_processed: already_processed.add('summary') self.summary = value value = find_attr_value_('width', node) if value is not None and 'width' not in already_processed: already_processed.add('width') self.width = value value = find_attr_value_('border', node) if value is not None and 'border' not in already_processed: already_processed.add('border') self.border = value value = find_attr_value_('frame', node) if value is not None and 'frame' not in already_processed: already_processed.add('frame') self.frame = value value = find_attr_value_('rules', node) if value is not None and 'rules' not in already_processed: already_processed.add('rules') self.rules = value value = find_attr_value_('cellspacing', node) if value is not None and 'cellspacing' not in already_processed: already_processed.add('cellspacing') self.cellspacing = value value = find_attr_value_('cellpadding', node) if value is not None and 'cellpadding' not in already_processed: already_processed.add('cellpadding') self.cellpadding = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'caption': obj_ = StrucDoc_Caption.factory() obj_.build(child_) self.caption = obj_ obj_.original_tagname_ = 'caption' elif nodeName_ == 'col': obj_ = StrucDoc_Col.factory() obj_.build(child_) self.col.append(obj_) obj_.original_tagname_ = 'col' elif nodeName_ == 'colgroup': obj_ = StrucDoc_Colgroup.factory() obj_.build(child_) self.colgroup.append(obj_) obj_.original_tagname_ = 'colgroup' elif nodeName_ == 'thead': obj_ = StrucDoc_Thead.factory() obj_.build(child_) self.thead = obj_ obj_.original_tagname_ = 'thead' elif nodeName_ == 'tfoot': obj_ = StrucDoc_Tfoot.factory() obj_.build(child_) self.tfoot = obj_ obj_.original_tagname_ = 'tfoot' elif nodeName_ == 'tbody': obj_ = StrucDoc_Tbody.factory() obj_.build(child_) self.tbody.append(obj_) obj_.original_tagname_ = 'tbody'
# end class StrucDoc_Table
[docs]class StrucDoc_Tbody(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, align=None, char=None, charoff=None, valign=None, tr=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign) if tr is None: self.tr = [] else: self.tr = tr
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Tbody) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Tbody.subclass: return StrucDoc_Tbody.subclass(*args_, **kwargs_) else: return StrucDoc_Tbody(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_tr(self): return self.tr
[docs] def set_tr(self, tr): self.tr = tr
[docs] def add_tr(self, value): self.tr.append(value)
[docs] def insert_tr_at(self, index, value): self.tr.insert(index, value)
[docs] def replace_tr_at(self, index, value): self.tr[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def hasContent_(self): if ( self.tr ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Tbody', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Tbody') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Tbody', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Tbody'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Tbody', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for tr_ in self.tr: tr_.export(outfile, level, namespace_, name_='tr', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'tr': obj_ = StrucDoc_Tr.factory() obj_.build(child_) self.tr.append(obj_) obj_.original_tagname_ = 'tr'
# end class StrucDoc_Tbody
[docs]class StrucDoc_Td(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, abbr=None, axis=None, headers=None, scope=None, rowspan='1', colspan='1', align=None, char=None, charoff=None, valign=None, content=None, linkHtml=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, renderMultiMedia=None, paragraph=None, list=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.abbr = _cast(None, abbr) self.axis = _cast(None, axis) self.headers = _cast(None, headers) self.scope = _cast(None, scope) self.rowspan = _cast(None, rowspan) self.colspan = _cast(None, colspan) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign) if content is None: self.content = [] else: self.content = content if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef if renderMultiMedia is None: self.renderMultiMedia = [] else: self.renderMultiMedia = renderMultiMedia if paragraph is None: self.paragraph = [] else: self.paragraph = paragraph if list is None: self.list = [] else: self.list = list self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Td) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Td.subclass: return StrucDoc_Td.subclass(*args_, **kwargs_) else: return StrucDoc_Td(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_renderMultiMedia(self): return self.renderMultiMedia
[docs] def set_renderMultiMedia(self, renderMultiMedia): self.renderMultiMedia = renderMultiMedia
[docs] def add_renderMultiMedia(self, value): self.renderMultiMedia.append(value)
[docs] def insert_renderMultiMedia_at(self, index, value): self.renderMultiMedia.insert(index, value)
[docs] def replace_renderMultiMedia_at(self, index, value): self.renderMultiMedia[index] = value
[docs] def get_paragraph(self): return self.paragraph
[docs] def set_paragraph(self, paragraph): self.paragraph = paragraph
[docs] def add_paragraph(self, value): self.paragraph.append(value)
[docs] def insert_paragraph_at(self, index, value): self.paragraph.insert(index, value)
[docs] def replace_paragraph_at(self, index, value): self.paragraph[index] = value
[docs] def get_list(self): return self.list
[docs] def set_list(self, list): self.list = list
[docs] def add_list(self, value): self.list.append(value)
[docs] def insert_list_at(self, index, value): self.list.insert(index, value)
[docs] def replace_list_at(self, index, value): self.list[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_abbr(self): return self.abbr
[docs] def set_abbr(self, abbr): self.abbr = abbr
[docs] def get_axis(self): return self.axis
[docs] def set_axis(self, axis): self.axis = axis
[docs] def get_headers(self): return self.headers
[docs] def set_headers(self, headers): self.headers = headers
[docs] def get_scope(self): return self.scope
[docs] def set_scope(self, scope): self.scope = scope
[docs] def get_rowspan(self): return self.rowspan
[docs] def set_rowspan(self, rowspan): self.rowspan = rowspan
[docs] def get_colspan(self): return self.colspan
[docs] def set_colspan(self, colspan): self.colspan = colspan
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.linkHtml or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or self.renderMultiMedia or self.paragraph or self.list or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Td', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Td') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Td', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Td'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.abbr is not None and 'abbr' not in already_processed: already_processed.add('abbr') outfile.write(' abbr=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.abbr), input_name='abbr')), )) if self.axis is not None and 'axis' not in already_processed: already_processed.add('axis') outfile.write(' axis=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.axis), input_name='axis')), )) if self.headers is not None and 'headers' not in already_processed: already_processed.add('headers') outfile.write(' headers=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.headers), input_name='headers')), )) if self.scope is not None and 'scope' not in already_processed: already_processed.add('scope') outfile.write(' scope=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.scope), input_name='scope')), )) if self.rowspan != "1" and 'rowspan' not in already_processed: already_processed.add('rowspan') outfile.write(' rowspan=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.rowspan), input_name='rowspan')), )) if self.colspan != "1" and 'colspan' not in already_processed: already_processed.add('colspan') outfile.write(' colspan=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.colspan), input_name='colspan')), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Td', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('abbr', node) if value is not None and 'abbr' not in already_processed: already_processed.add('abbr') self.abbr = value value = find_attr_value_('axis', node) if value is not None and 'axis' not in already_processed: already_processed.add('axis') self.axis = value value = find_attr_value_('headers', node) if value is not None and 'headers' not in already_processed: already_processed.add('headers') self.headers = value value = find_attr_value_('scope', node) if value is not None and 'scope' not in already_processed: already_processed.add('scope') self.scope = value value = find_attr_value_('rowspan', node) if value is not None and 'rowspan' not in already_processed: already_processed.add('rowspan') self.rowspan = value value = find_attr_value_('colspan', node) if value is not None and 'colspan' not in already_processed: already_processed.add('colspan') self.colspan = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_Content.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) elif nodeName_ == 'renderMultiMedia': obj_ = StrucDoc_RenderMultiMedia.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'renderMultiMedia', obj_) self.content_.append(obj_) if hasattr(self, 'add_renderMultiMedia'): self.add_renderMultiMedia(obj_.value) elif hasattr(self, 'set_renderMultiMedia'): self.set_renderMultiMedia(obj_.value) elif nodeName_ == 'paragraph': obj_ = StrucDoc_Paragraph.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'paragraph', obj_) self.content_.append(obj_) if hasattr(self, 'add_paragraph'): self.add_paragraph(obj_.value) elif hasattr(self, 'set_paragraph'): self.set_paragraph(obj_.value) elif nodeName_ == 'list': obj_ = StrucDoc_List.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'list', obj_) self.content_.append(obj_) if hasattr(self, 'add_list'): self.add_list(obj_.value) elif hasattr(self, 'set_list'): self.set_list(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Td
[docs]class StrucDoc_Tfoot(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, align=None, char=None, charoff=None, valign=None, tr=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign) if tr is None: self.tr = [] else: self.tr = tr
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Tfoot) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Tfoot.subclass: return StrucDoc_Tfoot.subclass(*args_, **kwargs_) else: return StrucDoc_Tfoot(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_tr(self): return self.tr
[docs] def set_tr(self, tr): self.tr = tr
[docs] def add_tr(self, value): self.tr.append(value)
[docs] def insert_tr_at(self, index, value): self.tr.insert(index, value)
[docs] def replace_tr_at(self, index, value): self.tr[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def hasContent_(self): if ( self.tr ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Tfoot', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Tfoot') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Tfoot', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Tfoot'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Tfoot', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for tr_ in self.tr: tr_.export(outfile, level, namespace_, name_='tr', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'tr': obj_ = StrucDoc_Tr.factory() obj_.build(child_) self.tr.append(obj_) obj_.original_tagname_ = 'tr'
# end class StrucDoc_Tfoot
[docs]class StrucDoc_Th(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, abbr=None, axis=None, headers=None, scope=None, rowspan='1', colspan='1', align=None, char=None, charoff=None, valign=None, content=None, linkHtml=None, sub=None, sup=None, br=None, footnote=None, footnoteRef=None, renderMultiMedia=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.abbr = _cast(None, abbr) self.axis = _cast(None, axis) self.headers = _cast(None, headers) self.scope = _cast(None, scope) self.rowspan = _cast(None, rowspan) self.colspan = _cast(None, colspan) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign) if content is None: self.content = [] else: self.content = content if linkHtml is None: self.linkHtml = [] else: self.linkHtml = linkHtml if sub is None: self.sub = [] else: self.sub = sub if sup is None: self.sup = [] else: self.sup = sup if br is None: self.br = [] else: self.br = br if footnote is None: self.footnote = [] else: self.footnote = footnote if footnoteRef is None: self.footnoteRef = [] else: self.footnoteRef = footnoteRef if renderMultiMedia is None: self.renderMultiMedia = [] else: self.renderMultiMedia = renderMultiMedia self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Th) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Th.subclass: return StrucDoc_Th.subclass(*args_, **kwargs_) else: return StrucDoc_Th(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_content(self): return self.content
[docs] def set_content(self, content): self.content = content
[docs] def add_content(self, value): self.content.append(value)
[docs] def insert_content_at(self, index, value): self.content.insert(index, value)
[docs] def replace_content_at(self, index, value): self.content[index] = value
[docs] def get_linkHtml(self): return self.linkHtml
[docs] def set_linkHtml(self, linkHtml): self.linkHtml = linkHtml
[docs] def add_linkHtml(self, value): self.linkHtml.append(value)
[docs] def insert_linkHtml_at(self, index, value): self.linkHtml.insert(index, value)
[docs] def replace_linkHtml_at(self, index, value): self.linkHtml[index] = value
[docs] def get_sub(self): return self.sub
[docs] def set_sub(self, sub): self.sub = sub
[docs] def add_sub(self, value): self.sub.append(value)
[docs] def insert_sub_at(self, index, value): self.sub.insert(index, value)
[docs] def replace_sub_at(self, index, value): self.sub[index] = value
[docs] def get_sup(self): return self.sup
[docs] def set_sup(self, sup): self.sup = sup
[docs] def add_sup(self, value): self.sup.append(value)
[docs] def insert_sup_at(self, index, value): self.sup.insert(index, value)
[docs] def replace_sup_at(self, index, value): self.sup[index] = value
[docs] def get_br(self): return self.br
[docs] def set_br(self, br): self.br = br
[docs] def add_br(self, value): self.br.append(value)
[docs] def insert_br_at(self, index, value): self.br.insert(index, value)
[docs] def replace_br_at(self, index, value): self.br[index] = value
[docs] def get_footnote(self): return self.footnote
[docs] def set_footnote(self, footnote): self.footnote = footnote
[docs] def add_footnote(self, value): self.footnote.append(value)
[docs] def insert_footnote_at(self, index, value): self.footnote.insert(index, value)
[docs] def replace_footnote_at(self, index, value): self.footnote[index] = value
[docs] def get_footnoteRef(self): return self.footnoteRef
[docs] def set_footnoteRef(self, footnoteRef): self.footnoteRef = footnoteRef
[docs] def add_footnoteRef(self, value): self.footnoteRef.append(value)
[docs] def insert_footnoteRef_at(self, index, value): self.footnoteRef.insert(index, value)
[docs] def replace_footnoteRef_at(self, index, value): self.footnoteRef[index] = value
[docs] def get_renderMultiMedia(self): return self.renderMultiMedia
[docs] def set_renderMultiMedia(self, renderMultiMedia): self.renderMultiMedia = renderMultiMedia
[docs] def add_renderMultiMedia(self, value): self.renderMultiMedia.append(value)
[docs] def insert_renderMultiMedia_at(self, index, value): self.renderMultiMedia.insert(index, value)
[docs] def replace_renderMultiMedia_at(self, index, value): self.renderMultiMedia[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_abbr(self): return self.abbr
[docs] def set_abbr(self, abbr): self.abbr = abbr
[docs] def get_axis(self): return self.axis
[docs] def set_axis(self, axis): self.axis = axis
[docs] def get_headers(self): return self.headers
[docs] def set_headers(self, headers): self.headers = headers
[docs] def get_scope(self): return self.scope
[docs] def set_scope(self, scope): self.scope = scope
[docs] def get_rowspan(self): return self.rowspan
[docs] def set_rowspan(self, rowspan): self.rowspan = rowspan
[docs] def get_colspan(self): return self.colspan
[docs] def set_colspan(self, colspan): self.colspan = colspan
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_StrucDoc_Br(self, value): # Validate type StrucDoc.Br, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) > 0: warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on StrucDoc.Br' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.content or self.linkHtml or self.sub or self.sup or self.br or self.footnote or self.footnoteRef or self.renderMultiMedia or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Th', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Th') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Th', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Th'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.abbr is not None and 'abbr' not in already_processed: already_processed.add('abbr') outfile.write(' abbr=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.abbr), input_name='abbr')), )) if self.axis is not None and 'axis' not in already_processed: already_processed.add('axis') outfile.write(' axis=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.axis), input_name='axis')), )) if self.headers is not None and 'headers' not in already_processed: already_processed.add('headers') outfile.write(' headers=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.headers), input_name='headers')), )) if self.scope is not None and 'scope' not in already_processed: already_processed.add('scope') outfile.write(' scope=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.scope), input_name='scope')), )) if self.rowspan != "1" and 'rowspan' not in already_processed: already_processed.add('rowspan') outfile.write(' rowspan=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.rowspan), input_name='rowspan')), )) if self.colspan != "1" and 'colspan' not in already_processed: already_processed.add('colspan') outfile.write(' colspan=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.colspan), input_name='colspan')), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Th', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('abbr', node) if value is not None and 'abbr' not in already_processed: already_processed.add('abbr') self.abbr = value value = find_attr_value_('axis', node) if value is not None and 'axis' not in already_processed: already_processed.add('axis') self.axis = value value = find_attr_value_('headers', node) if value is not None and 'headers' not in already_processed: already_processed.add('headers') self.headers = value value = find_attr_value_('scope', node) if value is not None and 'scope' not in already_processed: already_processed.add('scope') self.scope = value value = find_attr_value_('rowspan', node) if value is not None and 'rowspan' not in already_processed: already_processed.add('rowspan') self.rowspan = value value = find_attr_value_('colspan', node) if value is not None and 'colspan' not in already_processed: already_processed.add('colspan') self.colspan = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'content': obj_ = StrucDoc_Content.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'content', obj_) self.content_.append(obj_) if hasattr(self, 'add_content'): self.add_content(obj_.value) elif hasattr(self, 'set_content'): self.set_content(obj_.value) elif nodeName_ == 'linkHtml': obj_ = StrucDoc_LinkHtml.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'linkHtml', obj_) self.content_.append(obj_) if hasattr(self, 'add_linkHtml'): self.add_linkHtml(obj_.value) elif hasattr(self, 'set_linkHtml'): self.set_linkHtml(obj_.value) elif nodeName_ == 'sub': obj_ = StrucDoc_Sub.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sub', obj_) self.content_.append(obj_) if hasattr(self, 'add_sub'): self.add_sub(obj_.value) elif hasattr(self, 'set_sub'): self.set_sub(obj_.value) elif nodeName_ == 'sup': obj_ = StrucDoc_Sup.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'sup', obj_) self.content_.append(obj_) if hasattr(self, 'add_sup'): self.add_sup(obj_.value) elif hasattr(self, 'set_sup'): self.set_sup(obj_.value) elif nodeName_ == 'br' and child_.text is not None: valuestr_ = child_.text obj_ = self.mixedclass_(MixedContainer.CategorySimple, MixedContainer.TypeString, 'br', valuestr_) self.content_.append(obj_) elif nodeName_ == 'footnote': obj_ = StrucDoc_Footnote.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnote', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnote'): self.add_footnote(obj_.value) elif hasattr(self, 'set_footnote'): self.set_footnote(obj_.value) elif nodeName_ == 'footnoteRef': obj_ = StrucDoc_FootnoteRef.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'footnoteRef', obj_) self.content_.append(obj_) if hasattr(self, 'add_footnoteRef'): self.add_footnoteRef(obj_.value) elif hasattr(self, 'set_footnoteRef'): self.set_footnoteRef(obj_.value) elif nodeName_ == 'renderMultiMedia': obj_ = StrucDoc_RenderMultiMedia.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'renderMultiMedia', obj_) self.content_.append(obj_) if hasattr(self, 'add_renderMultiMedia'): self.add_renderMultiMedia(obj_.value) elif hasattr(self, 'set_renderMultiMedia'): self.set_renderMultiMedia(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class StrucDoc_Th
[docs]class StrucDoc_Thead(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, align=None, char=None, charoff=None, valign=None, tr=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign) if tr is None: self.tr = [] else: self.tr = tr
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Thead) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Thead.subclass: return StrucDoc_Thead.subclass(*args_, **kwargs_) else: return StrucDoc_Thead(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_tr(self): return self.tr
[docs] def set_tr(self, tr): self.tr = tr
[docs] def add_tr(self, value): self.tr.append(value)
[docs] def insert_tr_at(self, index, value): self.tr.insert(index, value)
[docs] def replace_tr_at(self, index, value): self.tr[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def hasContent_(self): if ( self.tr ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Thead', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Thead') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Thead', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Thead'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Thead', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for tr_ in self.tr: tr_.export(outfile, level, namespace_, name_='tr', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'tr': obj_ = StrucDoc_Tr.factory() obj_.build(child_) self.tr.append(obj_) obj_.original_tagname_ = 'tr'
# end class StrucDoc_Thead
[docs]class StrucDoc_Tr(GeneratedsSuper): subclass = None superclass = None def __init__(self, ID=None, language=None, styleCode=None, align=None, char=None, charoff=None, valign=None, th=None, td=None): self.original_tagname_ = None self.ID = _cast(None, ID) self.language = _cast(None, language) self.styleCode = _cast(None, styleCode) self.align = _cast(None, align) self.char = _cast(None, char) self.charoff = _cast(None, charoff) self.valign = _cast(None, valign) if th is None: self.th = [] else: self.th = th if td is None: self.td = [] else: self.td = td
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, StrucDoc_Tr) if subclass is not None: return subclass(*args_, **kwargs_) if StrucDoc_Tr.subclass: return StrucDoc_Tr.subclass(*args_, **kwargs_) else: return StrucDoc_Tr(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_th(self): return self.th
[docs] def set_th(self, th): self.th = th
[docs] def add_th(self, value): self.th.append(value)
[docs] def insert_th_at(self, index, value): self.th.insert(index, value)
[docs] def replace_th_at(self, index, value): self.th[index] = value
[docs] def get_td(self): return self.td
[docs] def set_td(self, td): self.td = td
[docs] def add_td(self, value): self.td.append(value)
[docs] def insert_td_at(self, index, value): self.td.insert(index, value)
[docs] def replace_td_at(self, index, value): self.td[index] = value
[docs] def get_ID(self): return self.ID
[docs] def set_ID(self, ID): self.ID = ID
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_styleCode(self): return self.styleCode
[docs] def set_styleCode(self, styleCode): self.styleCode = styleCode
[docs] def get_align(self): return self.align
[docs] def set_align(self, align): self.align = align
[docs] def get_char(self): return self.char
[docs] def set_char(self, char): self.char = char
[docs] def get_charoff(self): return self.charoff
[docs] def set_charoff(self, charoff): self.charoff = charoff
[docs] def get_valign(self): return self.valign
[docs] def set_valign(self, valign): self.valign = valign
[docs] def hasContent_(self): if ( self.th or self.td ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='StrucDoc.Tr', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='StrucDoc.Tr') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='StrucDoc.Tr', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='StrucDoc.Tr'): if self.ID is not None and 'ID' not in already_processed: already_processed.add('ID') outfile.write(' ID=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ID), input_name='ID')), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), )) if self.styleCode is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') outfile.write(' styleCode=%s' % (quote_attrib(self.styleCode), )) if self.align is not None and 'align' not in already_processed: already_processed.add('align') outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), )) if self.char is not None and 'char' not in already_processed: already_processed.add('char') outfile.write(' char=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.char), input_name='char')), )) if self.charoff is not None and 'charoff' not in already_processed: already_processed.add('charoff') outfile.write(' charoff=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.charoff), input_name='charoff')), )) if self.valign is not None and 'valign' not in already_processed: already_processed.add('valign') outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='StrucDoc.Tr', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for th_ in self.th: th_.export(outfile, level, namespace_, name_='th', pretty_print=pretty_print) for td_ in self.td: td_.export(outfile, level, namespace_, name_='td', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('ID', node) if value is not None and 'ID' not in already_processed: already_processed.add('ID') self.ID = value value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value value = find_attr_value_('styleCode', node) if value is not None and 'styleCode' not in already_processed: already_processed.add('styleCode') self.styleCode = value value = find_attr_value_('align', node) if value is not None and 'align' not in already_processed: already_processed.add('align') self.align = value value = find_attr_value_('char', node) if value is not None and 'char' not in already_processed: already_processed.add('char') self.char = value value = find_attr_value_('charoff', node) if value is not None and 'charoff' not in already_processed: already_processed.add('charoff') self.charoff = value value = find_attr_value_('valign', node) if value is not None and 'valign' not in already_processed: already_processed.add('valign') self.valign = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'th': obj_ = StrucDoc_Th.factory() obj_.build(child_) self.th.append(obj_) obj_.original_tagname_ = 'th' elif nodeName_ == 'td': obj_ = StrucDoc_Td.factory() obj_.build(child_) self.td.append(obj_) obj_.original_tagname_ = 'td'
# end class StrucDoc_Tr
[docs]class ANY(GeneratedsSuper): """Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type. An exceptional value expressing missing information and possibly the reason why the information is missing. An exceptional value that applies to the set, bag or list expressing missing information and possibly the reason why the information is missing. This attribute can only be used when the element is part of a collection. This attribute specifies the data type flavor that applies to this value. Allows a sending system to identify to a receiving system the changes that have occurred in an object controlled by the sending system, or the changes that the sender desires to be made in an object controlled by the receiving system.""" subclass = None superclass = None def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.collectionNullFlavor = _cast(None, collectionNullFlavor) self.flavorId = _cast(None, flavorId) self.updateMode = _cast(None, updateMode) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ANY) if subclass is not None: return subclass(*args_, **kwargs_) if ANY.subclass: return ANY.subclass(*args_, **kwargs_) else: return ANY(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_collectionNullFlavor(self): return self.collectionNullFlavor
[docs] def set_collectionNullFlavor(self, collectionNullFlavor): self.collectionNullFlavor = collectionNullFlavor
[docs] def get_flavorId(self): return self.flavorId
[docs] def set_flavorId(self, flavorId): self.flavorId = flavorId
[docs] def get_updateMode(self): return self.updateMode
[docs] def set_updateMode(self, updateMode): self.updateMode = updateMode
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_UpdateMode(self, value): # Validate type UpdateMode, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'AR', 'D', 'K', 'N', 'R', 'REF', 'U'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on UpdateMode' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_UpdateMode_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_UpdateMode_patterns_, ))
validate_UpdateMode_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='ANY', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='ANY') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ANY'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.collectionNullFlavor is not None and 'collectionNullFlavor' not in already_processed: already_processed.add('collectionNullFlavor') outfile.write(' collectionNullFlavor=%s' % (quote_attrib(self.collectionNullFlavor), )) if self.flavorId is not None and 'flavorId' not in already_processed: already_processed.add('flavorId') outfile.write(' flavorId=%s' % (quote_attrib(self.flavorId), )) if self.updateMode is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') outfile.write(' updateMode=%s' % (quote_attrib(self.updateMode), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ANY', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('collectionNullFlavor', node) if value is not None and 'collectionNullFlavor' not in already_processed: already_processed.add('collectionNullFlavor') self.collectionNullFlavor = value self.validate_NullFlavor(self.collectionNullFlavor) # validate type NullFlavor value = find_attr_value_('flavorId', node) if value is not None and 'flavorId' not in already_processed: already_processed.add('flavorId') self.flavorId = value self.validate_st(self.flavorId) # validate type st value = find_attr_value_('updateMode', node) if value is not None and 'updateMode' not in already_processed: already_processed.add('updateMode') self.updateMode = value self.validate_UpdateMode(self.updateMode) # validate type UpdateMode value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class ANY
[docs]class BL(ANY): """The Boolean type stands for the values of two-valued logic. A Boolean value can be either true or false, or, as any other value may be NULL.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, value=None): self.original_tagname_ = None super(BL, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, ) self.value = _cast(None, value)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, BL) if subclass is not None: return subclass(*args_, **kwargs_) if BL.subclass: return BL.subclass(*args_, **kwargs_) else: return BL(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(BL, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='BL', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='BL') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='BL', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='BL'): super(BL, self).exportAttributes(outfile, level, already_processed, namespace_, name_='BL') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='BL', fromsubclass_=False, pretty_print=True): super(BL, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') if value in ('true', '1'): self.value = True elif value in ('false', '0'): self.value = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.value) # validate type bl super(BL, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(BL, self).buildChildren(child_, node, nodeName_, True) pass
# end class BL
[docs]class ANYNonNull(ANY): """The BooleanNonNull type is used where a Boolean cannot have a null value. A Boolean value can be either true or false.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, extensiontype_=None): self.original_tagname_ = None super(ANYNonNull, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, extensiontype_, ) self.nullFlavor = _cast(None, nullFlavor) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ANYNonNull) if subclass is not None: return subclass(*args_, **kwargs_) if ANYNonNull.subclass: return ANYNonNull.subclass(*args_, **kwargs_) else: return ANYNonNull(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(ANYNonNull, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='ANYNonNull', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='ANYNonNull') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='ANYNonNull', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ANYNonNull'): super(ANYNonNull, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ANYNonNull') if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ANYNonNull', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(ANYNonNull, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass
# end class ANYNonNull
[docs]class BN(ANYNonNull): """The BooleanNonNull type is used where a Boolean cannot have a null value. A Boolean value can be either true or false.""" subclass = None superclass = ANYNonNull def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, value=None): self.original_tagname_ = None super(BN, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, ) self.value = _cast(None, value)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, BN) if subclass is not None: return subclass(*args_, **kwargs_) if BN.subclass: return BN.subclass(*args_, **kwargs_) else: return BN(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def validate_bn(self, value): # Validate type bn, a restriction on bl. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bn_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bn_patterns_, ))
validate_bn_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(BN, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='BN', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='BN') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='BN', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='BN'): super(BN, self).exportAttributes(outfile, level, already_processed, namespace_, name_='BN') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='BN', fromsubclass_=False, pretty_print=True): super(BN, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_bn(self.value) # validate type bn super(BN, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(BN, self).buildChildren(child_, node, nodeName_, True) pass
# end class BN
[docs]class BIN(ANY): """Binary data is a raw block of bits. Binary data is a protected type that MUST not be used outside the data type specification. Specifies the representation of the binary data that is the content of the binary data value.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(BIN, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, valueOf_, mixedclass_, content_, extensiontype_, ) self.representation = _cast(None, representation) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, BIN) if subclass is not None: return subclass(*args_, **kwargs_) if BIN.subclass: return BIN.subclass(*args_, **kwargs_) else: return BIN(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_representation(self): return self.representation
[docs] def set_representation(self, representation): self.representation = representation
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_BinaryDataEncoding(self, value): # Validate type BinaryDataEncoding, a restriction on xs:NMTOKEN. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['B64', 'TXT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on BinaryDataEncoding' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(BIN, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='BIN', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='BIN') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='BIN'): super(BIN, self).exportAttributes(outfile, level, already_processed, namespace_, name_='BIN') if self.representation != "TXT" and 'representation' not in already_processed: already_processed.add('representation') outfile.write(' representation=%s' % (quote_attrib(self.representation), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='BIN', fromsubclass_=False, pretty_print=True): super(BIN, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('representation', node) if value is not None and 'representation' not in already_processed: already_processed.add('representation') self.representation = value self.validate_BinaryDataEncoding(self.representation) # validate type BinaryDataEncoding value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(BIN, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(BIN, self).buildChildren(child_, node, nodeName_, True) pass
# end class BIN
[docs]class ED(BIN): """Data that is primarily intended for human interpretation or for further machine processing is outside the scope of HL7. This includes unformatted or formatted written language, multimedia data, or structured information as defined by a different standard (e.g., XML-signatures.) Instead of the data itself, an ED may contain only a reference (see TEL.) Note that the ST data type is a specialization of ED when the is text/plain. When the content is text/plain, the content may appear either as the text content of the element, or in the value attribute, but not both. The plain text content of the ED. Note that plain text content may appear in either the value attribute or the text content of the element, but not both. Identifies the type of the encapsulated data and identifies a method to interpret or render the data. For character based information the language property specifies the human language of the text. Indicates whether the raw byte data is compressed, and what compression algorithm was used. The integrity check is a short binary value representing a cryptographically strong checksum that is calculated over the binary data. The purpose of this property, when communicated with a reference is for anyone to validate later whether the reference still resolved to the same data that the reference resolved to when the encapsulated data value with reference was created. Specifies the algorithm used to compute the integrityCheck value. A stand-in for the full media for use as an alternative description of the media where the media is not accessible for display.""" subclass = None superclass = BIN def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, valueOf_=None, mixedclass_=None, content_=None, *args): self.original_tagname_ = None super(ED, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, valueOf_, mixedclass_, content_, ) self.value = _cast(None, value) self.mediaType = _cast(None, mediaType) self.language = _cast(None, language) self.compression = _cast(None, compression) self.integrityCheck = _cast(None, integrityCheck) self.integrityCheckAlgorithm = _cast(None, integrityCheckAlgorithm) self.description = _cast(None, description) self.reference = reference self.thumbnail = thumbnail if translation is None: self.translation = [] else: self.translation = translation self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ED) if subclass is not None: return subclass(*args_, **kwargs_) if ED.subclass: return ED.subclass(*args_, **kwargs_) else: return ED(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_reference(self): return self.reference
[docs] def set_reference(self, reference): self.reference = reference
[docs] def get_thumbnail(self): return self.thumbnail
[docs] def set_thumbnail(self, thumbnail): self.thumbnail = thumbnail
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def add_translation(self, value): self.translation.append(value)
[docs] def insert_translation_at(self, index, value): self.translation.insert(index, value)
[docs] def replace_translation_at(self, index, value): self.translation[index] = value
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_mediaType(self): return self.mediaType
[docs] def set_mediaType(self, mediaType): self.mediaType = mediaType
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_compression(self): return self.compression
[docs] def set_compression(self, compression): self.compression = compression
[docs] def get_integrityCheck(self): return self.integrityCheck
[docs] def set_integrityCheck(self, integrityCheck): self.integrityCheck = integrityCheck
[docs] def get_integrityCheckAlgorithm(self): return self.integrityCheckAlgorithm
[docs] def set_integrityCheckAlgorithm(self, integrityCheckAlgorithm): self.integrityCheckAlgorithm = integrityCheckAlgorithm
[docs] def get_description(self): return self.description
[docs] def set_description(self, description): self.description = description
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_CompressionAlgorithm(self, value): # Validate type CompressionAlgorithm, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['BZ', 'DF', 'GZ', 'Z', 'Z7', 'ZL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on CompressionAlgorithm' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_CompressionAlgorithm_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_CompressionAlgorithm_patterns_, ))
validate_CompressionAlgorithm_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bin(self, value): # Validate type bin, a restriction on xs:base64Binary. if value is not None and Validate_simpletypes_: pass
[docs] def validate_IntegrityCheckAlgorithm(self, value): # Validate type IntegrityCheckAlgorithm, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SHA-1', 'SHA-256'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on IntegrityCheckAlgorithm' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_IntegrityCheckAlgorithm_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_IntegrityCheckAlgorithm_patterns_, ))
validate_IntegrityCheckAlgorithm_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.reference is not None or self.thumbnail is not None or self.translation or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(ED, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='ED', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='ED') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='ED', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ED'): super(ED, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ED') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.mediaType != "text/plain" and 'mediaType' not in already_processed: already_processed.add('mediaType') outfile.write(' mediaType=%s' % (quote_attrib(self.mediaType), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (quote_attrib(self.language), )) if self.compression is not None and 'compression' not in already_processed: already_processed.add('compression') outfile.write(' compression=%s' % (quote_attrib(self.compression), )) if self.integrityCheck is not None and 'integrityCheck' not in already_processed: already_processed.add('integrityCheck') outfile.write(' integrityCheck=%s' % (quote_attrib(self.integrityCheck), )) if self.integrityCheckAlgorithm != "SHA-1" and 'integrityCheckAlgorithm' not in already_processed: already_processed.add('integrityCheckAlgorithm') outfile.write(' integrityCheckAlgorithm=%s' % (quote_attrib(self.integrityCheckAlgorithm), )) if self.description is not None and 'description' not in already_processed: already_processed.add('description') outfile.write(' description=%s' % (quote_attrib(self.description), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ED', fromsubclass_=False, pretty_print=True): super(ED, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_st(self.value) # validate type st value = find_attr_value_('mediaType', node) if value is not None and 'mediaType' not in already_processed: already_processed.add('mediaType') self.mediaType = value self.mediaType = ' '.join(self.mediaType.split()) self.validate_cs(self.mediaType) # validate type cs value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value self.language = ' '.join(self.language.split()) self.validate_cs(self.language) # validate type cs value = find_attr_value_('compression', node) if value is not None and 'compression' not in already_processed: already_processed.add('compression') self.compression = value self.validate_CompressionAlgorithm(self.compression) # validate type CompressionAlgorithm value = find_attr_value_('integrityCheck', node) if value is not None and 'integrityCheck' not in already_processed: already_processed.add('integrityCheck') self.integrityCheck = value self.validate_bin(self.integrityCheck) # validate type bin value = find_attr_value_('integrityCheckAlgorithm', node) if value is not None and 'integrityCheckAlgorithm' not in already_processed: already_processed.add('integrityCheckAlgorithm') self.integrityCheckAlgorithm = value self.validate_IntegrityCheckAlgorithm(self.integrityCheckAlgorithm) # validate type IntegrityCheckAlgorithm value = find_attr_value_('description', node) if value is not None and 'description' not in already_processed: already_processed.add('description') self.description = value self.validate_st(self.description) # validate type st super(ED, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'reference': obj_ = TEL.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'reference', obj_) self.content_.append(obj_) if hasattr(self, 'add_reference'): self.add_reference(obj_.value) elif hasattr(self, 'set_reference'): self.set_reference(obj_.value) elif nodeName_ == 'thumbnail': obj_ = thumbnail.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'thumbnail', obj_) self.content_.append(obj_) if hasattr(self, 'add_thumbnail'): self.add_thumbnail(obj_.value) elif hasattr(self, 'set_thumbnail'): self.set_thumbnail(obj_.value) elif nodeName_ == 'translation': obj_ = EDTranslation.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'translation', obj_) self.content_.append(obj_) if hasattr(self, 'add_translation'): self.add_translation(obj_.value) elif hasattr(self, 'set_translation'): self.set_translation(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(ED, self).buildChildren(child_, node, nodeName_, True)
# end class ED
[docs]class thumbnail(ED): """A thumbnail is an abbreviated rendition of the full data. A thumbnail requires significantly fewer resources than the full data, while still maintaining some distinctive similarity with the full data. A thumbnail is typically used with by-reference encapsulated data. It allows a user to select data more efficiently before actually downloading through the reference.""" subclass = None superclass = ED def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, thumbnail_member=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(thumbnail, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, valueOf_, mixedclass_, content_, ) self.reference = reference self.thumbnail = thumbnail_member self.translation = translation self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, thumbnail) if subclass is not None: return subclass(*args_, **kwargs_) if thumbnail.subclass: return thumbnail.subclass(*args_, **kwargs_) else: return thumbnail(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_reference(self): return self.reference
[docs] def set_reference(self, reference): self.reference = reference
[docs] def get_thumbnail(self): return self.thumbnail
[docs] def set_thumbnail(self, thumbnail): self.thumbnail = thumbnail
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( self.reference is not None or self.thumbnail is not None or self.translation is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(thumbnail, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='thumbnail', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='thumbnail') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='thumbnail', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='thumbnail'): super(thumbnail, self).exportAttributes(outfile, level, already_processed, namespace_, name_='thumbnail')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='thumbnail', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(thumbnail, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'reference': obj_ = TEL.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'reference', obj_) self.content_.append(obj_) if hasattr(self, 'add_reference'): self.add_reference(obj_.value) elif hasattr(self, 'set_reference'): self.set_reference(obj_.value) elif nodeName_ == 'thumbnail': obj_ = thumbnail.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'thumbnail', obj_) self.content_.append(obj_) if hasattr(self, 'add_thumbnail'): self.add_thumbnail(obj_.value) elif hasattr(self, 'set_thumbnail'): self.set_thumbnail(obj_.value) elif nodeName_ == 'translation': obj_ = EDTranslation.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'translation', obj_) self.content_.append(obj_) if hasattr(self, 'add_translation'): self.add_translation(obj_.value) elif hasattr(self, 'set_translation'): self.set_translation(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class thumbnail
[docs]class EDTranslation(ED): """Alternate renditions of the same content translated into a different language or a different mediaType. The translation property is a set of that each translate the first rendition into different a language or use a different mediaType. Each element of the translation set must be a translation of the value. Translations may not contain translations. .""" subclass = None superclass = ED def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(EDTranslation, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, valueOf_, mixedclass_, content_, ) self.reference = reference self.thumbnail = thumbnail self.translation = translation self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, EDTranslation) if subclass is not None: return subclass(*args_, **kwargs_) if EDTranslation.subclass: return EDTranslation.subclass(*args_, **kwargs_) else: return EDTranslation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_reference(self): return self.reference
[docs] def set_reference(self, reference): self.reference = reference
[docs] def get_thumbnail(self): return self.thumbnail
[docs] def set_thumbnail(self, thumbnail): self.thumbnail = thumbnail
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( self.reference is not None or self.thumbnail is not None or self.translation is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(EDTranslation, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='EDTranslation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='EDTranslation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='EDTranslation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EDTranslation'): super(EDTranslation, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EDTranslation')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='EDTranslation', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(EDTranslation, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'reference': obj_ = TEL.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'reference', obj_) self.content_.append(obj_) if hasattr(self, 'add_reference'): self.add_reference(obj_.value) elif hasattr(self, 'set_reference'): self.set_reference(obj_.value) elif nodeName_ == 'thumbnail': obj_ = thumbnail.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'thumbnail', obj_) self.content_.append(obj_) if hasattr(self, 'add_thumbnail'): self.add_thumbnail(obj_.value) elif hasattr(self, 'set_thumbnail'): self.set_thumbnail(obj_.value) elif nodeName_ == 'translation': obj_ = EDTranslation.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'translation', obj_) self.content_.append(obj_) if hasattr(self, 'add_translation'): self.add_translation(obj_.value) elif hasattr(self, 'set_translation'): self.set_translation(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class EDTranslation
[docs]class ST(ED): """The character string data type stands for text data, primarily intended for machine processing (e.g., sorting, querying, indexing, etc.) Used for names, symbols, and formal expressions. The ST data type may have it's data as either the text content of the element, or in a value attribute, but not both.""" subclass = None superclass = ED def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(ST, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, valueOf_, mixedclass_, content_, extensiontype_, ) self.value = _cast(None, value) self.representation = _cast(None, representation) self.mediaType = _cast(None, mediaType) self.language = _cast(None, language) self.compression = _cast(None, compression) self.integrityCheck = _cast(None, integrityCheck) self.integrityCheckAlgorithm = _cast(None, integrityCheckAlgorithm) self.reference = reference self.thumbnail = thumbnail if translation is None: self.translation = [] else: self.translation = translation self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ST) if subclass is not None: return subclass(*args_, **kwargs_) if ST.subclass: return ST.subclass(*args_, **kwargs_) else: return ST(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_reference(self): return self.reference
[docs] def set_reference(self, reference): self.reference = reference
[docs] def get_thumbnail(self): return self.thumbnail
[docs] def set_thumbnail(self, thumbnail): self.thumbnail = thumbnail
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def add_translation(self, value): self.translation.append(value)
[docs] def insert_translation_at(self, index, value): self.translation.insert(index, value)
[docs] def replace_translation_at(self, index, value): self.translation[index] = value
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_representation(self): return self.representation
[docs] def set_representation(self, representation): self.representation = representation
[docs] def get_mediaType(self): return self.mediaType
[docs] def set_mediaType(self, mediaType): self.mediaType = mediaType
[docs] def get_language(self): return self.language
[docs] def set_language(self, language): self.language = language
[docs] def get_compression(self): return self.compression
[docs] def set_compression(self, compression): self.compression = compression
[docs] def get_integrityCheck(self): return self.integrityCheck
[docs] def set_integrityCheck(self, integrityCheck): self.integrityCheck = integrityCheck
[docs] def get_integrityCheckAlgorithm(self): return self.integrityCheckAlgorithm
[docs] def set_integrityCheckAlgorithm(self, integrityCheckAlgorithm): self.integrityCheckAlgorithm = integrityCheckAlgorithm
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_BinaryDataEncoding(self, value): # Validate type BinaryDataEncoding, a restriction on xs:NMTOKEN. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['B64', 'TXT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on BinaryDataEncoding' % {"value" : value.encode("utf-8")} )
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_CompressionAlgorithm(self, value): # Validate type CompressionAlgorithm, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['BZ', 'DF', 'GZ', 'Z', 'Z7', 'ZL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on CompressionAlgorithm' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_CompressionAlgorithm_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_CompressionAlgorithm_patterns_, ))
validate_CompressionAlgorithm_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bin(self, value): # Validate type bin, a restriction on xs:base64Binary. if value is not None and Validate_simpletypes_: pass
[docs] def validate_IntegrityCheckAlgorithm(self, value): # Validate type IntegrityCheckAlgorithm, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SHA-1', 'SHA-256'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on IntegrityCheckAlgorithm' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_IntegrityCheckAlgorithm_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_IntegrityCheckAlgorithm_patterns_, ))
validate_IntegrityCheckAlgorithm_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.reference is not None or self.thumbnail is not None or self.translation or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(ST, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='ST', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='ST') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='ST', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ST'): super(ST, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ST') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.representation is not None and 'representation' not in already_processed: already_processed.add('representation') outfile.write(' representation=%s' % (quote_attrib(self.representation), )) if self.mediaType is not None and 'mediaType' not in already_processed: already_processed.add('mediaType') outfile.write(' mediaType=%s' % (quote_attrib(self.mediaType), )) if self.language is not None and 'language' not in already_processed: already_processed.add('language') outfile.write(' language=%s' % (quote_attrib(self.language), )) if self.compression is not None and 'compression' not in already_processed: already_processed.add('compression') outfile.write(' compression=%s' % (quote_attrib(self.compression), )) if self.integrityCheck is not None and 'integrityCheck' not in already_processed: already_processed.add('integrityCheck') outfile.write(' integrityCheck=%s' % (quote_attrib(self.integrityCheck), )) if self.integrityCheckAlgorithm is not None and 'integrityCheckAlgorithm' not in already_processed: already_processed.add('integrityCheckAlgorithm') outfile.write(' integrityCheckAlgorithm=%s' % (quote_attrib(self.integrityCheckAlgorithm), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ST', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_st(self.value) # validate type st value = find_attr_value_('representation', node) if value is not None and 'representation' not in already_processed: already_processed.add('representation') self.representation = value self.validate_BinaryDataEncoding(self.representation) # validate type BinaryDataEncoding value = find_attr_value_('mediaType', node) if value is not None and 'mediaType' not in already_processed: already_processed.add('mediaType') self.mediaType = value self.mediaType = ' '.join(self.mediaType.split()) self.validate_cs(self.mediaType) # validate type cs value = find_attr_value_('language', node) if value is not None and 'language' not in already_processed: already_processed.add('language') self.language = value self.language = ' '.join(self.language.split()) self.validate_cs(self.language) # validate type cs value = find_attr_value_('compression', node) if value is not None and 'compression' not in already_processed: already_processed.add('compression') self.compression = value self.validate_CompressionAlgorithm(self.compression) # validate type CompressionAlgorithm value = find_attr_value_('integrityCheck', node) if value is not None and 'integrityCheck' not in already_processed: already_processed.add('integrityCheck') self.integrityCheck = value self.validate_bin(self.integrityCheck) # validate type bin value = find_attr_value_('integrityCheckAlgorithm', node) if value is not None and 'integrityCheckAlgorithm' not in already_processed: already_processed.add('integrityCheckAlgorithm') self.integrityCheckAlgorithm = value self.validate_IntegrityCheckAlgorithm(self.integrityCheckAlgorithm) # validate type IntegrityCheckAlgorithm value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(ST, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'reference': obj_ = TEL.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'reference', obj_) self.content_.append(obj_) if hasattr(self, 'add_reference'): self.add_reference(obj_.value) elif hasattr(self, 'set_reference'): self.set_reference(obj_.value) elif nodeName_ == 'thumbnail': obj_ = ED.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'thumbnail', obj_) self.content_.append(obj_) if hasattr(self, 'add_thumbnail'): self.add_thumbnail(obj_.value) elif hasattr(self, 'set_thumbnail'): self.set_thumbnail(obj_.value) elif nodeName_ == 'translation': obj_ = STTranslation.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'translation', obj_) self.content_.append(obj_) if hasattr(self, 'add_translation'): self.add_translation(obj_.value) elif hasattr(self, 'set_translation'): self.set_translation(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class ST
[docs]class STTranslation(EDTranslation): subclass = None superclass = EDTranslation def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(STTranslation, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, valueOf_, mixedclass_, content_, ) self.translation = translation self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, STTranslation) if subclass is not None: return subclass(*args_, **kwargs_) if STTranslation.subclass: return STTranslation.subclass(*args_, **kwargs_) else: return STTranslation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( self.translation is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(STTranslation, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='STTranslation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='STTranslation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='STTranslation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='STTranslation'): super(STTranslation, self).exportAttributes(outfile, level, already_processed, namespace_, name_='STTranslation')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='STTranslation', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(STTranslation, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'translation': obj_ = STTranslation.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'translation', obj_) self.content_.append(obj_) if hasattr(self, 'add_translation'): self.add_translation(obj_.value) elif hasattr(self, 'set_translation'): self.set_translation(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class STTranslation
[docs]class CD(ANY): """A concept descriptor represents any kind of concept usually by giving a code defined in a code system. A concept descriptor can contain the original text or phrase that served as the basis of the coding and one or more translations into different coding systems. A concept descriptor can also contain qualifiers to describe, e.g., the concept of a "left foot" as a postcoordinated term built from the primary code "FOOT" and the qualifier "LEFT". In exceptional cases, the concept descriptor need not contain a code but only the original text describing that concept. The plain code symbol or expression defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache. Specifies the code system that defines the code. A common name of the coding system. If applicable, a version descriptor defined specifically for the given code system. A name or title for the code, under which the sending system shows the code value to its users. The value set that applied when this CD was coded. The version of the valueSet that applied when this CD was coded. CodingRationale provides a reason why a particular has been provided, either as the root concept or as one of the translations.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(CD, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, valueOf_, mixedclass_, content_, extensiontype_, ) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueSet = _cast(None, valueSet) self.valueSetVersion = _cast(None, valueSetVersion) self.codingRationale = _cast(None, codingRationale) self.originalText = originalText if qualifier is None: self.qualifier = [] else: self.qualifier = qualifier if translation is None: self.translation = [] else: self.translation = translation self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CD) if subclass is not None: return subclass(*args_, **kwargs_) if CD.subclass: return CD.subclass(*args_, **kwargs_) else: return CD(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_originalText(self): return self.originalText
[docs] def set_originalText(self, originalText): self.originalText = originalText
[docs] def get_qualifier(self): return self.qualifier
[docs] def set_qualifier(self, qualifier): self.qualifier = qualifier
[docs] def add_qualifier(self, value): self.qualifier.append(value)
[docs] def insert_qualifier_at(self, index, value): self.qualifier.insert(index, value)
[docs] def replace_qualifier_at(self, index, value): self.qualifier[index] = value
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def add_translation(self, value): self.translation.append(value)
[docs] def insert_translation_at(self, index, value): self.translation.insert(index, value)
[docs] def replace_translation_at(self, index, value): self.translation[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueSet(self): return self.valueSet
[docs] def set_valueSet(self, valueSet): self.valueSet = valueSet
[docs] def get_valueSetVersion(self): return self.valueSetVersion
[docs] def set_valueSetVersion(self, valueSetVersion): self.valueSetVersion = valueSetVersion
[docs] def get_codingRationale(self): return self.codingRationale
[docs] def set_codingRationale(self, codingRationale): self.codingRationale = codingRationale
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_oid(self, value): # Validate type oid, a restriction on xs:string. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_oid_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_oid_patterns_, ))
validate_oid_patterns_ = [['^[0-2](\\.(0$|^[1-9][0-9]*))*$']]
[docs] def validate_set_CodingRationale(self, value): # Validate type set_CodingRationale, a restriction on CodingRationale. pass
[docs] def hasContent_(self): if ( self.originalText is not None or self.qualifier or self.translation or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(CD, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='CD', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='CD') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='CD', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CD'): super(CD, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CD') if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), )) if self.valueSet is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') outfile.write(' valueSet=%s' % (quote_attrib(self.valueSet), )) if self.valueSetVersion is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') outfile.write(' valueSetVersion=%s' % (quote_attrib(self.valueSetVersion), )) if self.codingRationale is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') outfile.write(' codingRationale=%s' % (quote_attrib(self.codingRationale), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='CD', fromsubclass_=False, pretty_print=True): super(CD, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st value = find_attr_value_('valueSet', node) if value is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') self.valueSet = value self.validate_oid(self.valueSet) # validate type oid value = find_attr_value_('valueSetVersion', node) if value is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') self.valueSetVersion = value self.validate_st(self.valueSetVersion) # validate type st value = find_attr_value_('codingRationale', node) if value is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') self.codingRationale = value self.validate_set_CodingRationale(self.codingRationale) # validate type set_CodingRationale value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(CD, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'originalText': obj_ = ED.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'originalText', obj_) self.content_.append(obj_) if hasattr(self, 'add_originalText'): self.add_originalText(obj_.value) elif hasattr(self, 'set_originalText'): self.set_originalText(obj_.value) elif nodeName_ == 'qualifier': obj_ = CR.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'qualifier', obj_) self.content_.append(obj_) if hasattr(self, 'add_qualifier'): self.add_qualifier(obj_.value) elif hasattr(self, 'set_qualifier'): self.set_qualifier(obj_.value) elif nodeName_ == 'translation': class_obj_ = self.get_class_obj_(child_, CD) class_obj_ = CD.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'translation', obj_) self.content_.append(obj_) if hasattr(self, 'add_translation'): self.add_translation(obj_.value) elif hasattr(self, 'set_translation'): self.set_translation(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(CD, self).buildChildren(child_, node, nodeName_, True)
# end class CD
[docs]class CE(CD): """Coded data, consists of a coded value (CV) and, optionally, coded value(s) from other coding systems that identify the same concept. Used when alternative codes may exist. The plain code symbol or expression defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache. Specifies the code system that defines the code. A common name of the coding system. If applicable, a version descriptor defined specifically for the given code system. A name or title for the code, under which the sending system shows the code value to its users. The value set that applied when this CD was coded. The version of the valueSet that applied when this CD was coded. CodingRationale provides a reason why a particular has been provided, either as the root concept or as one of the translations.""" subclass = None superclass = CD def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None, extensiontype_=None): self.original_tagname_ = None super(CE, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, extensiontype_, ) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueSet = _cast(None, valueSet) self.valueSetVersion = _cast(None, valueSetVersion) self.codingRationale = _cast(None, codingRationale) self.originalText = originalText self.qualifier = qualifier if translation is None: self.translation = [] else: self.translation = translation self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CE) if subclass is not None: return subclass(*args_, **kwargs_) if CE.subclass: return CE.subclass(*args_, **kwargs_) else: return CE(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_originalText(self): return self.originalText
[docs] def set_originalText(self, originalText): self.originalText = originalText
[docs] def get_qualifier(self): return self.qualifier
[docs] def set_qualifier(self, qualifier): self.qualifier = qualifier
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def add_translation(self, value): self.translation.append(value)
[docs] def insert_translation_at(self, index, value): self.translation.insert(index, value)
[docs] def replace_translation_at(self, index, value): self.translation[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueSet(self): return self.valueSet
[docs] def set_valueSet(self, valueSet): self.valueSet = valueSet
[docs] def get_valueSetVersion(self): return self.valueSetVersion
[docs] def set_valueSetVersion(self, valueSetVersion): self.valueSetVersion = valueSetVersion
[docs] def get_codingRationale(self): return self.codingRationale
[docs] def set_codingRationale(self, codingRationale): self.codingRationale = codingRationale
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_oid(self, value): # Validate type oid, a restriction on xs:string. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_oid_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_oid_patterns_, ))
validate_oid_patterns_ = [['^[0-2](\\.(0$|^[1-9][0-9]*))*$']]
[docs] def validate_set_CodingRationale(self, value): # Validate type set_CodingRationale, a restriction on CodingRationale. pass
[docs] def hasContent_(self): if ( self.originalText is not None or self.qualifier is not None or self.translation or super(CE, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='CE', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='CE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='CE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CE'): super(CE, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CE') if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), )) if self.valueSet is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') outfile.write(' valueSet=%s' % (quote_attrib(self.valueSet), )) if self.valueSetVersion is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') outfile.write(' valueSetVersion=%s' % (quote_attrib(self.valueSetVersion), )) if self.codingRationale is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') outfile.write(' codingRationale=%s' % (quote_attrib(self.codingRationale), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='CE', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.originalText is not None: self.originalText.export(outfile, level, namespace_, name_='originalText', pretty_print=pretty_print) if self.qualifier is not None: self.qualifier.export(outfile, level, namespace_, name_='qualifier', pretty_print=pretty_print) for translation_ in self.translation: translation_.export(outfile, level, namespace_, name_='translation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st value = find_attr_value_('valueSet', node) if value is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') self.valueSet = value self.validate_oid(self.valueSet) # validate type oid value = find_attr_value_('valueSetVersion', node) if value is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') self.valueSetVersion = value self.validate_st(self.valueSetVersion) # validate type st value = find_attr_value_('codingRationale', node) if value is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') self.codingRationale = value self.validate_set_CodingRationale(self.codingRationale) # validate type set_CodingRationale value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(CE, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'originalText': obj_ = ED.factory() obj_.build(child_) self.originalText = obj_ obj_.original_tagname_ = 'originalText' elif nodeName_ == 'qualifier': obj_ = CR.factory() obj_.build(child_) self.qualifier = obj_ obj_.original_tagname_ = 'qualifier' elif nodeName_ == 'translation': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.translation.append(obj_) obj_.original_tagname_ = 'translation'
# end class CE
[docs]class CV(CE): """Coded data, consists of a code, display name, code system, and original text. Used when a single code value must be sent. The plain code symbol or expression defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache. Specifies the code system that defines the code. A common name of the coding system. If applicable, a version descriptor defined specifically for the given code system. A name or title for the code, under which the sending system shows the code value to its users. The value set that applied when this CD was coded. The version of the valueSet that applied when this CD was coded.""" subclass = None superclass = CE def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None, extensiontype_=None): self.original_tagname_ = None super(CV, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, extensiontype_, ) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueSet = _cast(None, valueSet) self.valueSetVersion = _cast(None, valueSetVersion) self.codingRationale = _cast(None, codingRationale) self.originalText = originalText self.translation = translation self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CV) if subclass is not None: return subclass(*args_, **kwargs_) if CV.subclass: return CV.subclass(*args_, **kwargs_) else: return CV(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_originalText(self): return self.originalText
[docs] def set_originalText(self, originalText): self.originalText = originalText
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueSet(self): return self.valueSet
[docs] def set_valueSet(self, valueSet): self.valueSet = valueSet
[docs] def get_valueSetVersion(self): return self.valueSetVersion
[docs] def set_valueSetVersion(self, valueSetVersion): self.valueSetVersion = valueSetVersion
[docs] def get_codingRationale(self): return self.codingRationale
[docs] def set_codingRationale(self, codingRationale): self.codingRationale = codingRationale
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_oid(self, value): # Validate type oid, a restriction on xs:string. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_oid_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_oid_patterns_, ))
validate_oid_patterns_ = [['^[0-2](\\.(0$|^[1-9][0-9]*))*$']]
[docs] def validate_set_CodingRationale(self, value): # Validate type set_CodingRationale, a restriction on CodingRationale. pass
[docs] def hasContent_(self): if ( self.originalText is not None or self.translation is not None or super(CV, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='CV', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='CV') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='CV', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CV'): super(CV, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CV') if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), )) if self.valueSet is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') outfile.write(' valueSet=%s' % (quote_attrib(self.valueSet), )) if self.valueSetVersion is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') outfile.write(' valueSetVersion=%s' % (quote_attrib(self.valueSetVersion), )) if self.codingRationale is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') outfile.write(' codingRationale=%s' % (quote_attrib(self.codingRationale), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='CV', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.originalText is not None: self.originalText.export(outfile, level, namespace_, name_='originalText', pretty_print=pretty_print) if self.translation is not None: self.translation.export(outfile, level, namespace_, name_='translation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st value = find_attr_value_('valueSet', node) if value is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') self.valueSet = value self.validate_oid(self.valueSet) # validate type oid value = find_attr_value_('valueSetVersion', node) if value is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') self.valueSetVersion = value self.validate_st(self.valueSetVersion) # validate type st value = find_attr_value_('codingRationale', node) if value is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') self.codingRationale = value self.validate_set_CodingRationale(self.codingRationale) # validate type set_CodingRationale value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(CV, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'originalText': obj_ = ED.factory() obj_.build(child_) self.originalText = obj_ obj_.original_tagname_ = 'originalText' elif nodeName_ == 'translation': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.translation = obj_ obj_.original_tagname_ = 'translation'
# end class CV
[docs]class CS(CV): """Coded data, consists of a code, display name, code system, and original text. Used when a single code value must be sent. The plain code symbol or expression defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.""" subclass = None superclass = CV def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None): self.original_tagname_ = None super(CS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, ) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueSet = _cast(None, valueSet) self.valueSetVersion = _cast(None, valueSetVersion)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CS) if subclass is not None: return subclass(*args_, **kwargs_) if CS.subclass: return CS.subclass(*args_, **kwargs_) else: return CS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueSet(self): return self.valueSet
[docs] def set_valueSet(self, valueSet): self.valueSet = valueSet
[docs] def get_valueSetVersion(self): return self.valueSetVersion
[docs] def set_valueSetVersion(self, valueSetVersion): self.valueSetVersion = valueSetVersion
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_oid(self, value): # Validate type oid, a restriction on xs:string. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_oid_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_oid_patterns_, ))
validate_oid_patterns_ = [['^[0-2](\\.(0$|^[1-9][0-9]*))*$']]
[docs] def hasContent_(self): if ( super(CS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='CS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='CS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='CS', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CS'): super(CS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CS') if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), )) if self.valueSet is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') outfile.write(' valueSet=%s' % (quote_attrib(self.valueSet), )) if self.valueSetVersion is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') outfile.write(' valueSetVersion=%s' % (quote_attrib(self.valueSetVersion), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='CS', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st value = find_attr_value_('valueSet', node) if value is not None and 'valueSet' not in already_processed: already_processed.add('valueSet') self.valueSet = value self.validate_oid(self.valueSet) # validate type oid value = find_attr_value_('valueSetVersion', node) if value is not None and 'valueSetVersion' not in already_processed: already_processed.add('valueSetVersion') self.valueSetVersion = value self.validate_st(self.valueSetVersion) # validate type st super(CS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass
# end class CS
[docs]class CO(CV): """Coded data, where the domain from which the codeset comes is ordered. The Coded Ordinal data type adds semantics related to ordering so that models that make use of such domains may introduce model elements that involve statements about the order of the terms in a domain.""" subclass = None superclass = CV def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None): self.original_tagname_ = None super(CO, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, )
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CO) if subclass is not None: return subclass(*args_, **kwargs_) if CO.subclass: return CO.subclass(*args_, **kwargs_) else: return CO(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def hasContent_(self): if ( super(CO, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='CO', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='CO') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='CO', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CO'): super(CO, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CO')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='CO', fromsubclass_=False, pretty_print=True): super(CO, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(CO, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(CO, self).buildChildren(child_, node, nodeName_, True) pass
# end class CO
[docs]class CR(ANY): """A concept qualifier code with optionally named role. Both qualifier role and value codes must be defined by the coding system. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows to add the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg". Indicates if the sense of the role name is inverted. This can be used in cases where the underlying code system defines inversion but does not provide reciprocal pairs of role names. By default, inverted is false.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, inverted='false', name=None, value=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(CR, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, valueOf_, mixedclass_, content_, ) self.inverted = _cast(None, inverted) self.name = name self.value = value self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, CR) if subclass is not None: return subclass(*args_, **kwargs_) if CR.subclass: return CR.subclass(*args_, **kwargs_) else: return CR(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_inverted(self): return self.inverted
[docs] def set_inverted(self, inverted): self.inverted = inverted
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_bn(self, value): # Validate type bn, a restriction on bl. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bn_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bn_patterns_, ))
validate_bn_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.name is not None or self.value is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(CR, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='CR', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='CR') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='CR', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CR'): super(CR, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CR') if self.inverted != "false" and 'inverted' not in already_processed: already_processed.add('inverted') outfile.write(' inverted=%s' % (quote_attrib(self.inverted), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='CR', fromsubclass_=False, pretty_print=True): super(CR, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inverted', node) if value is not None and 'inverted' not in already_processed: already_processed.add('inverted') self.inverted = value self.validate_bn(self.inverted) # validate type bn super(CR, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, CV) class_obj_ = CV.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'name', obj_) self.content_.append(obj_) if hasattr(self, 'add_name'): self.add_name(obj_.value) elif hasattr(self, 'set_name'): self.set_name(obj_.value) elif nodeName_ == 'value': class_obj_ = self.get_class_obj_(child_, CD) class_obj_ = CD.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'value', obj_) self.content_.append(obj_) if hasattr(self, 'add_value'): self.add_value(obj_.value) elif hasattr(self, 'set_value'): self.set_value(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(CR, self).buildChildren(child_, node, nodeName_, True)
# end class CR
[docs]class SC(ST): """An ST that optionally may have a code attached. The text must always be present if a code is present. The code is often a local code. The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache. Specifies the code system that defines the code. A common name of the coding system. If applicable, a version descriptor defined specifically for the given code system. A name or title for the code, under which the sending system shows the code value to its users.""" subclass = None superclass = ST def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(SC, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, valueOf_, mixedclass_, content_, extensiontype_, ) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SC) if subclass is not None: return subclass(*args_, **kwargs_) if SC.subclass: return SC.subclass(*args_, **kwargs_) else: return SC(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(SC, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SC', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SC') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SC', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SC'): super(SC, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SC') if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SC', fromsubclass_=False, pretty_print=True): super(SC, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SC, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(SC, self).buildChildren(child_, node, nodeName_, True) pass
# end class SC
[docs]class II(ANY): """An identifier that uniquely identifies a thing or object. Examples are object identifier for HL7 RIM objects, medical record number, order id, service catalog item id, Vehicle Identification Number (VIN), etc. Instance identifiers are defined based on ISO object identifiers. A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier. A character string as a unique identifier within the scope of the identifier root. A human readable name or mnemonic for the assigning authority. This name may be provided solely for the convenience of unaided humans interpreting an value and can have no computational meaning. Note: no automated processing must depend on the assigning authority name to be present in any form. Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false). Specifies the scope in which the identifier applies to the object with which it is associated. Specifies the reliability with which the identifier is known. This attribute may be used to assist with identifier matching algorithms..""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, root=None, extension=None, assigningAuthorityName=None, displayable=None, scope=None, reliability=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(II, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, valueOf_, mixedclass_, content_, ) self.root = _cast(None, root) self.extension = _cast(None, extension) self.assigningAuthorityName = _cast(None, assigningAuthorityName) self.displayable = _cast(None, displayable) self.scope = _cast(None, scope) self.reliability = _cast(None, reliability) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, II) if subclass is not None: return subclass(*args_, **kwargs_) if II.subclass: return II.subclass(*args_, **kwargs_) else: return II(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_root(self): return self.root
[docs] def set_root(self, root): self.root = root
[docs] def get_extension(self): return self.extension
[docs] def set_extension(self, extension): self.extension = extension
[docs] def get_assigningAuthorityName(self): return self.assigningAuthorityName
[docs] def set_assigningAuthorityName(self, assigningAuthorityName): self.assigningAuthorityName = assigningAuthorityName
[docs] def get_displayable(self): return self.displayable
[docs] def set_displayable(self, displayable): self.displayable = displayable
[docs] def get_scope(self): return self.scope
[docs] def set_scope(self, scope): self.scope = scope
[docs] def get_reliability(self): return self.reliability
[docs] def set_reliability(self, reliability): self.reliability = reliability
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def validate_IdentifierScope(self, value): # Validate type IdentifierScope, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['BUSN', 'OBJ', 'VER', 'VW'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on IdentifierScope' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_IdentifierScope_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_IdentifierScope_patterns_, ))
validate_IdentifierScope_patterns_ = [['^[^\\s]+$']]
[docs] def validate_IdentifierReliability(self, value): # Validate type IdentifierReliability, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ISS', 'UNV', 'VRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on IdentifierReliability' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_IdentifierReliability_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_IdentifierReliability_patterns_, ))
validate_IdentifierReliability_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(II, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='II', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='II') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='II'): super(II, self).exportAttributes(outfile, level, already_processed, namespace_, name_='II') if self.root is not None and 'root' not in already_processed: already_processed.add('root') outfile.write(' root=%s' % (quote_attrib(self.root), )) if self.extension is not None and 'extension' not in already_processed: already_processed.add('extension') outfile.write(' extension=%s' % (quote_attrib(self.extension), )) if self.assigningAuthorityName is not None and 'assigningAuthorityName' not in already_processed: already_processed.add('assigningAuthorityName') outfile.write(' assigningAuthorityName=%s' % (quote_attrib(self.assigningAuthorityName), )) if self.displayable is not None and 'displayable' not in already_processed: already_processed.add('displayable') outfile.write(' displayable=%s' % (quote_attrib(self.displayable), )) if self.scope is not None and 'scope' not in already_processed: already_processed.add('scope') outfile.write(' scope=%s' % (quote_attrib(self.scope), )) if self.reliability is not None and 'reliability' not in already_processed: already_processed.add('reliability') outfile.write(' reliability=%s' % (quote_attrib(self.reliability), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='II', fromsubclass_=False, pretty_print=True): super(II, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('root', node) if value is not None and 'root' not in already_processed: already_processed.add('root') self.root = value self.validate_uid(self.root) # validate type uid value = find_attr_value_('extension', node) if value is not None and 'extension' not in already_processed: already_processed.add('extension') self.extension = value self.validate_st(self.extension) # validate type st value = find_attr_value_('assigningAuthorityName', node) if value is not None and 'assigningAuthorityName' not in already_processed: already_processed.add('assigningAuthorityName') self.assigningAuthorityName = value self.validate_st(self.assigningAuthorityName) # validate type st value = find_attr_value_('displayable', node) if value is not None and 'displayable' not in already_processed: already_processed.add('displayable') if value in ('true', '1'): self.displayable = True elif value in ('false', '0'): self.displayable = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.displayable) # validate type bl value = find_attr_value_('scope', node) if value is not None and 'scope' not in already_processed: already_processed.add('scope') self.scope = value self.validate_IdentifierScope(self.scope) # validate type IdentifierScope value = find_attr_value_('reliability', node) if value is not None and 'reliability' not in already_processed: already_processed.add('reliability') self.reliability = value self.validate_IdentifierReliability(self.reliability) # validate type IdentifierReliability super(II, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(II, self).buildChildren(child_, node, nodeName_, True) pass
# end class II
[docs]class URL(ANY): """A telecommunications address specified according to Internet standard RFC 1738 [http://www.ietf.org/rfc/rfc1738.txt]. The URL specifies the protocol and the contact point defined by that protocol for the resource. Notable uses of the telecommunication address data type are for telephone and telefax numbers, e-mail addresses, Hypertext references, FTP references, etc.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, value=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(URL, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, valueOf_, mixedclass_, content_, extensiontype_, ) self.value = _cast(None, value) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, URL) if subclass is not None: return subclass(*args_, **kwargs_) if URL.subclass: return URL.subclass(*args_, **kwargs_) else: return URL(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_url(self, value): # Validate type url, a restriction on xs:anyURI. if value is not None and Validate_simpletypes_: pass
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(URL, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='URL', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='URL') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='URL'): super(URL, self).exportAttributes(outfile, level, already_processed, namespace_, name_='URL') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='URL', fromsubclass_=False, pretty_print=True): super(URL, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_url(self.value) # validate type url value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(URL, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(URL, self).buildChildren(child_, node, nodeName_, True) pass
# end class URL
[docs]class TEL(URL): """A telephone number (voice or fax), e-mail address, or other locator for a resource (information or service) mediated by telecommunication equipment. The address is specified as a URL qualified by time specification and use codes that help in deciding which address to use for a given time and purpose. One or more codes advising a system or user which telecommunication address in a set of like addresses to select for a given telecommunication need. One or more codes advising a system or user what telecommunication capabilities are known to be associated with the telecommunication address.""" subclass = None superclass = URL def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, value=None, use=None, capabilities=None, useablePeriod=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(TEL, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, value, valueOf_, mixedclass_, content_, ) self.use = _cast(None, use) self.capabilities = _cast(None, capabilities) if useablePeriod is None: self.useablePeriod = [] else: self.useablePeriod = useablePeriod self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, TEL) if subclass is not None: return subclass(*args_, **kwargs_) if TEL.subclass: return TEL.subclass(*args_, **kwargs_) else: return TEL(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_useablePeriod(self): return self.useablePeriod
[docs] def set_useablePeriod(self, useablePeriod): self.useablePeriod = useablePeriod
[docs] def add_useablePeriod(self, value): self.useablePeriod.append(value)
[docs] def insert_useablePeriod_at(self, index, value): self.useablePeriod.insert(index, value)
[docs] def replace_useablePeriod_at(self, index, value): self.useablePeriod[index] = value
[docs] def get_use(self): return self.use
[docs] def set_use(self, use): self.use = use
[docs] def get_capabilities(self): return self.capabilities
[docs] def set_capabilities(self, capabilities): self.capabilities = capabilities
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_set_TelecommunicationAddressUse(self, value): # Validate type set_TelecommunicationAddressUse, a restriction on TelecommunicationAddressUse. pass
[docs] def validate_set_TelecommunicationCapabilities(self, value): # Validate type set_TelecommunicationCapabilities, a restriction on TelecommunicationCapabilities. pass
[docs] def hasContent_(self): if ( self.useablePeriod or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(TEL, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='TEL', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='TEL') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='TEL', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TEL'): super(TEL, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TEL') if self.use is not None and 'use' not in already_processed: already_processed.add('use') outfile.write(' use=%s' % (quote_attrib(self.use), )) if self.capabilities is not None and 'capabilities' not in already_processed: already_processed.add('capabilities') outfile.write(' capabilities=%s' % (quote_attrib(self.capabilities), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='TEL', fromsubclass_=False, pretty_print=True): super(TEL, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('use', node) if value is not None and 'use' not in already_processed: already_processed.add('use') self.use = value self.validate_set_TelecommunicationAddressUse(self.use) # validate type set_TelecommunicationAddressUse value = find_attr_value_('capabilities', node) if value is not None and 'capabilities' not in already_processed: already_processed.add('capabilities') self.capabilities = value self.validate_set_TelecommunicationCapabilities(self.capabilities) # validate type set_TelecommunicationCapabilities super(TEL, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'useablePeriod': class_obj_ = self.get_class_obj_(child_, SXCM_TS) class_obj_ = SXCM_TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'useablePeriod', obj_) self.content_.append(obj_) if hasattr(self, 'add_useablePeriod'): self.add_useablePeriod(obj_.value) elif hasattr(self, 'set_useablePeriod'): self.set_useablePeriod(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(TEL, self).buildChildren(child_, node, nodeName_, True)
# end class TEL
[docs]class ADXP(SC): """A character string that may have a type-tag signifying its role in the address. Typical parts that exist in about every address are street, house number, or post box, postal code, city, country but other roles may be defined regionally, nationally, or on an enterprise level (e.g. in military addresses). Addresses are usually broken up into lines, which are indicated by special line-breaking delimiter elements (e.g., DEL). Specifies whether an address part names the street, city, country, postal code, post box, etc. If the type is NULL the address part is unclassified and would simply appear on an address label as is.""" subclass = None superclass = SC def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(ADXP, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ADXP) if subclass is not None: return subclass(*args_, **kwargs_) if ADXP.subclass: return ADXP.subclass(*args_, **kwargs_) else: return ADXP(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(ADXP, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='ADXP', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='ADXP') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='ADXP', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ADXP'): super(ADXP, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ADXP') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ADXP', fromsubclass_=False, pretty_print=True): super(ADXP, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(ADXP, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(ADXP, self).buildChildren(child_, node, nodeName_, True) pass
# end class ADXP
[docs]class adxp_delimiter(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_delimiter, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_delimiter) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_delimiter.subclass: return adxp_delimiter.subclass(*args_, **kwargs_) else: return adxp_delimiter(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_delimiter, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.delimiter', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.delimiter') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.delimiter'): super(adxp_delimiter, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.delimiter') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.delimiter', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_delimiter, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_delimiter
[docs]class adxp_country(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_country, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_country) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_country.subclass: return adxp_country.subclass(*args_, **kwargs_) else: return adxp_country(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_country, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.country', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.country') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.country'): super(adxp_country, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.country') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.country', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_country, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_country
[docs]class adxp_state(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_state, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_state) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_state.subclass: return adxp_state.subclass(*args_, **kwargs_) else: return adxp_state(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_state, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.state', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.state') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.state'): super(adxp_state, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.state') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.state', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_state, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_state
[docs]class adxp_county(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_county, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_county) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_county.subclass: return adxp_county.subclass(*args_, **kwargs_) else: return adxp_county(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_county, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.county', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.county') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.county'): super(adxp_county, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.county') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.county', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_county, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_county
[docs]class adxp_city(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_city, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_city) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_city.subclass: return adxp_city.subclass(*args_, **kwargs_) else: return adxp_city(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_city, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.city', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.city') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.city'): super(adxp_city, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.city') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.city', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_city, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_city
[docs]class adxp_postalCode(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_postalCode, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_postalCode) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_postalCode.subclass: return adxp_postalCode.subclass(*args_, **kwargs_) else: return adxp_postalCode(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_postalCode, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.postalCode', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.postalCode') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.postalCode'): super(adxp_postalCode, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.postalCode') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.postalCode', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_postalCode, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_postalCode
[docs]class adxp_addressLine(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_addressLine, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_addressLine) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_addressLine.subclass: return adxp_addressLine.subclass(*args_, **kwargs_) else: return adxp_addressLine(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_addressLine, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.addressLine', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.addressLine') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.addressLine'): super(adxp_addressLine, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.addressLine') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.addressLine', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_addressLine, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_addressLine
[docs]class adxp_streetAddressLine(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_streetAddressLine, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_streetAddressLine) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_streetAddressLine.subclass: return adxp_streetAddressLine.subclass(*args_, **kwargs_) else: return adxp_streetAddressLine(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_streetAddressLine, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.streetAddressLine', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetAddressLine') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.streetAddressLine'): super(adxp_streetAddressLine, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetAddressLine') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.streetAddressLine', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_streetAddressLine, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_streetAddressLine
[docs]class adxp_houseNumber(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_houseNumber, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_houseNumber) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_houseNumber.subclass: return adxp_houseNumber.subclass(*args_, **kwargs_) else: return adxp_houseNumber(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_houseNumber, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.houseNumber', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.houseNumber') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.houseNumber'): super(adxp_houseNumber, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.houseNumber') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.houseNumber', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_houseNumber, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_houseNumber
[docs]class adxp_houseNumberNumeric(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_houseNumberNumeric, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_houseNumberNumeric) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_houseNumberNumeric.subclass: return adxp_houseNumberNumeric.subclass(*args_, **kwargs_) else: return adxp_houseNumberNumeric(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_houseNumberNumeric, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.houseNumberNumeric', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.houseNumberNumeric') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.houseNumberNumeric'): super(adxp_houseNumberNumeric, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.houseNumberNumeric') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.houseNumberNumeric', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_houseNumberNumeric, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_houseNumberNumeric
[docs]class adxp_direction(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_direction, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_direction) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_direction.subclass: return adxp_direction.subclass(*args_, **kwargs_) else: return adxp_direction(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_direction, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.direction', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.direction') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.direction'): super(adxp_direction, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.direction') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.direction', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_direction, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_direction
[docs]class adxp_streetName(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_streetName, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_streetName) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_streetName.subclass: return adxp_streetName.subclass(*args_, **kwargs_) else: return adxp_streetName(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_streetName, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.streetName', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetName') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.streetName'): super(adxp_streetName, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetName') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.streetName', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_streetName, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_streetName
[docs]class adxp_streetNameBase(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_streetNameBase, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_streetNameBase) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_streetNameBase.subclass: return adxp_streetNameBase.subclass(*args_, **kwargs_) else: return adxp_streetNameBase(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_streetNameBase, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.streetNameBase', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetNameBase') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.streetNameBase'): super(adxp_streetNameBase, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetNameBase') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.streetNameBase', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_streetNameBase, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_streetNameBase
[docs]class adxp_streetNameType(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_streetNameType, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_streetNameType) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_streetNameType.subclass: return adxp_streetNameType.subclass(*args_, **kwargs_) else: return adxp_streetNameType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_streetNameType, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.streetNameType', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetNameType') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.streetNameType'): super(adxp_streetNameType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.streetNameType') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.streetNameType', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_streetNameType, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_streetNameType
[docs]class adxp_additionalLocator(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_additionalLocator, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_additionalLocator) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_additionalLocator.subclass: return adxp_additionalLocator.subclass(*args_, **kwargs_) else: return adxp_additionalLocator(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_additionalLocator, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.additionalLocator', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.additionalLocator') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.additionalLocator'): super(adxp_additionalLocator, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.additionalLocator') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.additionalLocator', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_additionalLocator, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_additionalLocator
[docs]class adxp_unitID(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_unitID, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_unitID) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_unitID.subclass: return adxp_unitID.subclass(*args_, **kwargs_) else: return adxp_unitID(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_unitID, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.unitID', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.unitID') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.unitID'): super(adxp_unitID, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.unitID') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.unitID', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_unitID, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_unitID
[docs]class adxp_unitType(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_unitType, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_unitType) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_unitType.subclass: return adxp_unitType.subclass(*args_, **kwargs_) else: return adxp_unitType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_unitType, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.unitType', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.unitType') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.unitType'): super(adxp_unitType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.unitType') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.unitType', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_unitType, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_unitType
[docs]class adxp_intersection(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_intersection, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_intersection) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_intersection.subclass: return adxp_intersection.subclass(*args_, **kwargs_) else: return adxp_intersection(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_intersection, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.intersection', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.intersection') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.intersection'): super(adxp_intersection, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.intersection') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.intersection', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_intersection, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_intersection
[docs]class adxp_careOf(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_careOf, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_careOf) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_careOf.subclass: return adxp_careOf.subclass(*args_, **kwargs_) else: return adxp_careOf(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_careOf, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.careOf', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.careOf') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.careOf'): super(adxp_careOf, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.careOf') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.careOf', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_careOf, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_careOf
[docs]class adxp_censusTract(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_censusTract, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_censusTract) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_censusTract.subclass: return adxp_censusTract.subclass(*args_, **kwargs_) else: return adxp_censusTract(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_censusTract, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.censusTract', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.censusTract') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.censusTract'): super(adxp_censusTract, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.censusTract') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.censusTract', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_censusTract, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_censusTract
[docs]class adxp_deliveryAddressLine(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_deliveryAddressLine, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_deliveryAddressLine) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_deliveryAddressLine.subclass: return adxp_deliveryAddressLine.subclass(*args_, **kwargs_) else: return adxp_deliveryAddressLine(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_deliveryAddressLine, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.deliveryAddressLine', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryAddressLine') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.deliveryAddressLine'): super(adxp_deliveryAddressLine, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryAddressLine') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.deliveryAddressLine', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_deliveryAddressLine, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_deliveryAddressLine
[docs]class adxp_deliveryInstallationType(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_deliveryInstallationType, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_deliveryInstallationType) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_deliveryInstallationType.subclass: return adxp_deliveryInstallationType.subclass(*args_, **kwargs_) else: return adxp_deliveryInstallationType(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_deliveryInstallationType, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.deliveryInstallationType', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryInstallationType') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.deliveryInstallationType'): super(adxp_deliveryInstallationType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryInstallationType') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.deliveryInstallationType', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_deliveryInstallationType, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_deliveryInstallationType
[docs]class adxp_deliveryInstallationArea(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_deliveryInstallationArea, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_deliveryInstallationArea) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_deliveryInstallationArea.subclass: return adxp_deliveryInstallationArea.subclass(*args_, **kwargs_) else: return adxp_deliveryInstallationArea(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_deliveryInstallationArea, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.deliveryInstallationArea', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryInstallationArea') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.deliveryInstallationArea'): super(adxp_deliveryInstallationArea, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryInstallationArea') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.deliveryInstallationArea', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_deliveryInstallationArea, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_deliveryInstallationArea
[docs]class adxp_deliveryInstallationQualifier(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_deliveryInstallationQualifier, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_deliveryInstallationQualifier) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_deliveryInstallationQualifier.subclass: return adxp_deliveryInstallationQualifier.subclass(*args_, **kwargs_) else: return adxp_deliveryInstallationQualifier(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_deliveryInstallationQualifier, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.deliveryInstallationQualifier', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryInstallationQualifier') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.deliveryInstallationQualifier'): super(adxp_deliveryInstallationQualifier, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryInstallationQualifier') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.deliveryInstallationQualifier', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_deliveryInstallationQualifier, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_deliveryInstallationQualifier
[docs]class adxp_deliveryMode(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_deliveryMode, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_deliveryMode) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_deliveryMode.subclass: return adxp_deliveryMode.subclass(*args_, **kwargs_) else: return adxp_deliveryMode(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_deliveryMode, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.deliveryMode', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryMode') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.deliveryMode'): super(adxp_deliveryMode, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryMode') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.deliveryMode', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType super(adxp_deliveryMode, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_deliveryMode
[docs]class adxp_deliveryModeIdentifier(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_deliveryModeIdentifier, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_deliveryModeIdentifier) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_deliveryModeIdentifier.subclass: return adxp_deliveryModeIdentifier.subclass(*args_, **kwargs_) else: return adxp_deliveryModeIdentifier(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_deliveryModeIdentifier, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.deliveryModeIdentifier', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryModeIdentifier') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.deliveryModeIdentifier'): super(adxp_deliveryModeIdentifier, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.deliveryModeIdentifier') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.deliveryModeIdentifier', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_deliveryModeIdentifier, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_deliveryModeIdentifier
[docs]class adxp_buildingNumberSuffix(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_buildingNumberSuffix, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_buildingNumberSuffix) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_buildingNumberSuffix.subclass: return adxp_buildingNumberSuffix.subclass(*args_, **kwargs_) else: return adxp_buildingNumberSuffix(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_buildingNumberSuffix, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.buildingNumberSuffix', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.buildingNumberSuffix') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.buildingNumberSuffix'): super(adxp_buildingNumberSuffix, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.buildingNumberSuffix') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.buildingNumberSuffix', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_buildingNumberSuffix, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_buildingNumberSuffix
[docs]class adxp_postBox(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_postBox, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_postBox) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_postBox.subclass: return adxp_postBox.subclass(*args_, **kwargs_) else: return adxp_postBox(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_postBox, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.postBox', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.postBox') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.postBox'): super(adxp_postBox, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.postBox') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.postBox', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_postBox, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_postBox
[docs]class adxp_precinct(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_precinct, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_precinct) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_precinct.subclass: return adxp_precinct.subclass(*args_, **kwargs_) else: return adxp_precinct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_AddressPartType(self, value): # Validate type AddressPartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADL', 'AL', 'BNN', 'BNR', 'BNS', 'CAR', 'CEN', 'CNT', 'CPA', 'CTY', 'DAL', 'DEL', 'DINST', 'DINSTA', 'DINSTQ', 'DIR', 'DMOD', 'DMODID', 'DPID', 'INT', 'POB', 'PRE', 'SAL', 'STA', 'STB', 'STR', 'STTYP', 'UNID', 'UNIT', 'ZIP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on AddressPartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_AddressPartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_AddressPartType_patterns_, ))
validate_AddressPartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_precinct, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.precinct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.precinct') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.precinct'): super(adxp_precinct, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.precinct') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.precinct', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_AddressPartType(self.partType) # validate type AddressPartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_precinct, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_precinct
[docs]class adxp_part(ADXP): subclass = None superclass = ADXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(adxp_part, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, adxp_part) if subclass is not None: return subclass(*args_, **kwargs_) if adxp_part.subclass: return adxp_part.subclass(*args_, **kwargs_) else: return adxp_part(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(adxp_part, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='adxp.part', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.part') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='adxp.part'): super(adxp_part, self).exportAttributes(outfile, level, already_processed, namespace_, name_='adxp.part') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='adxp.part', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(adxp_part, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class adxp_part # end class AD
[docs]class ENXP(SC): """A character string token representing a part of a name. May have a type code signifying the role of the part in the whole entity name, and a qualifier code for more detail about the name part type. Typical name parts for person names are given names, and family names, titles, etc. Indicates whether the name part is a given name, family name, prefix, suffix, etc. Usually the part type is not represented explicitly, but is fixed by the element used to represent the part. is a set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type. For example, a given name may be flagged as a nickname, a family name may be a pseudonym or a name of public records.""" subclass = None superclass = SC def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(ENXP, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.qualifier = _cast(None, qualifier) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ENXP) if subclass is not None: return subclass(*args_, **kwargs_) if ENXP.subclass: return ENXP.subclass(*args_, **kwargs_) else: return ENXP(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_qualifier(self): return self.qualifier
[docs] def set_qualifier(self, qualifier): self.qualifier = qualifier
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_set_EntityNamePartQualifier(self, value): # Validate type set_EntityNamePartQualifier, a restriction on EntityNamePartQualifier. pass
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(ENXP, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='ENXP', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='ENXP') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='ENXP', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ENXP'): super(ENXP, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ENXP') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.qualifier is not None and 'qualifier' not in already_processed: already_processed.add('qualifier') outfile.write(' qualifier=%s' % (quote_attrib(self.qualifier), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ENXP', fromsubclass_=False, pretty_print=True): super(ENXP, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType value = find_attr_value_('qualifier', node) if value is not None and 'qualifier' not in already_processed: already_processed.add('qualifier') self.qualifier = value self.validate_set_EntityNamePartQualifier(self.qualifier) # validate type set_EntityNamePartQualifier super(ENXP, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(ENXP, self).buildChildren(child_, node, nodeName_, True) pass
# end class ENXP
[docs]class enxp_delimiter(ENXP): subclass = None superclass = ENXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(enxp_delimiter, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, qualifier, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, enxp_delimiter) if subclass is not None: return subclass(*args_, **kwargs_) if enxp_delimiter.subclass: return enxp_delimiter.subclass(*args_, **kwargs_) else: return enxp_delimiter(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(enxp_delimiter, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='enxp.delimiter', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.delimiter') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='enxp.delimiter'): super(enxp_delimiter, self).exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.delimiter') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='enxp.delimiter', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(enxp_delimiter, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class enxp_delimiter
[docs]class enxp_family(ENXP): subclass = None superclass = ENXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(enxp_family, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, qualifier, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, enxp_family) if subclass is not None: return subclass(*args_, **kwargs_) if enxp_family.subclass: return enxp_family.subclass(*args_, **kwargs_) else: return enxp_family(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(enxp_family, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='enxp.family', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.family') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='enxp.family'): super(enxp_family, self).exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.family') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='enxp.family', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(enxp_family, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class enxp_family
[docs]class enxp_given(ENXP): subclass = None superclass = ENXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(enxp_given, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, qualifier, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, enxp_given) if subclass is not None: return subclass(*args_, **kwargs_) if enxp_given.subclass: return enxp_given.subclass(*args_, **kwargs_) else: return enxp_given(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(enxp_given, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='enxp.given', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.given') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='enxp.given'): super(enxp_given, self).exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.given') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='enxp.given', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(enxp_given, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class enxp_given
[docs]class enxp_prefix(ENXP): subclass = None superclass = ENXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(enxp_prefix, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, qualifier, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, enxp_prefix) if subclass is not None: return subclass(*args_, **kwargs_) if enxp_prefix.subclass: return enxp_prefix.subclass(*args_, **kwargs_) else: return enxp_prefix(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(enxp_prefix, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='enxp.prefix', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.prefix') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='enxp.prefix'): super(enxp_prefix, self).exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.prefix') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='enxp.prefix', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType super(enxp_prefix, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class enxp_prefix
[docs]class enxp_suffix(ENXP): subclass = None superclass = ENXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(enxp_suffix, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, qualifier, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, enxp_suffix) if subclass is not None: return subclass(*args_, **kwargs_) if enxp_suffix.subclass: return enxp_suffix.subclass(*args_, **kwargs_) else: return enxp_suffix(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(enxp_suffix, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='enxp.suffix', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.suffix') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='enxp.suffix'): super(enxp_suffix, self).exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.suffix') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='enxp.suffix', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType super(enxp_suffix, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class enxp_suffix
[docs]class enxp_title(ENXP): subclass = None superclass = ENXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(enxp_title, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, qualifier, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, enxp_title) if subclass is not None: return subclass(*args_, **kwargs_) if enxp_title.subclass: return enxp_title.subclass(*args_, **kwargs_) else: return enxp_title(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(enxp_title, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='enxp.title', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.title') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='enxp.title'): super(enxp_title, self).exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.title') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='enxp.title', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType super(enxp_title, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class enxp_title
[docs]class enxp_part(ENXP): subclass = None superclass = ENXP def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, representation='TXT', value=None, mediaType='text/plain', language=None, compression=None, integrityCheck=None, integrityCheckAlgorithm='SHA-1', description=None, reference=None, thumbnail=None, translation=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, partType=None, qualifier=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(enxp_part, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, representation, value, mediaType, language, compression, integrityCheck, integrityCheckAlgorithm, description, reference, thumbnail, translation, code, codeSystem, codeSystemName, codeSystemVersion, displayName, partType, qualifier, valueOf_, mixedclass_, content_, ) self.partType = _cast(None, partType) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName) self.codeSystemVersion = _cast(None, codeSystemVersion) self.displayName = _cast(None, displayName) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, enxp_part) if subclass is not None: return subclass(*args_, **kwargs_) if enxp_part.subclass: return enxp_part.subclass(*args_, **kwargs_) else: return enxp_part(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_partType(self): return self.partType
[docs] def set_partType(self, partType): self.partType = partType
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def get_codeSystemVersion(self): return self.codeSystemVersion
[docs] def set_codeSystemVersion(self, codeSystemVersion): self.codeSystemVersion = codeSystemVersion
[docs] def get_displayName(self): return self.displayName
[docs] def set_displayName(self, displayName): self.displayName = displayName
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_EntityNamePartType(self, value): # Validate type EntityNamePartType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEL', 'FAM', 'GIV', 'PFX', 'SFX', 'TITLE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityNamePartType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityNamePartType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityNamePartType_patterns_, ))
validate_EntityNamePartType_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(enxp_part, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='enxp.part', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.part') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='enxp.part'): super(enxp_part, self).exportAttributes(outfile, level, already_processed, namespace_, name_='enxp.part') if self.partType is not None and 'partType' not in already_processed: already_processed.add('partType') outfile.write(' partType=%s' % (quote_attrib(self.partType), )) if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), )) if self.codeSystemVersion is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') outfile.write(' codeSystemVersion=%s' % (quote_attrib(self.codeSystemVersion), )) if self.displayName is not None and 'displayName' not in already_processed: already_processed.add('displayName') outfile.write(' displayName=%s' % (quote_attrib(self.displayName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='enxp.part', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('partType', node) if value is not None and 'partType' not in already_processed: already_processed.add('partType') self.partType = value self.validate_EntityNamePartType(self.partType) # validate type EntityNamePartType value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.code = ' '.join(self.code.split()) self.validate_cs(self.code) # validate type cs value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st value = find_attr_value_('codeSystemVersion', node) if value is not None and 'codeSystemVersion' not in already_processed: already_processed.add('codeSystemVersion') self.codeSystemVersion = value self.validate_st(self.codeSystemVersion) # validate type st value = find_attr_value_('displayName', node) if value is not None and 'displayName' not in already_processed: already_processed.add('displayName') self.displayName = value self.validate_st(self.displayName) # validate type st super(enxp_part, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass
# end class enxp_part
[docs]class EN(ANY): """A name for a person, organization, place or thing. A sequence of name parts, such as given name or family name, prefix, suffix, etc. Examples for entity name values are "Jim Bob Walton, Jr.", "Health Level Seven, Inc.", "Lake Tahoe", etc. An entity name may be as simple as a character string or may consist of several entity name parts, such as, "Jim", "Bob", "Walton", and "Jr.", "Health Level Seven" and "Inc.", "Lake" and "Tahoe". A set of codes advising a system or user which name in a set of like names to select for a given purpose. A name without specific use code might be a default name useful for any purpose, but a name with a specific use code would be preferred for that respective purpose.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, use=None, delimiter=None, family=None, given=None, prefix=None, suffix=None, title=None, part=None, validTime=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(EN, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, valueOf_, mixedclass_, content_, extensiontype_, ) self.use = _cast(None, use) if delimiter is None: self.delimiter = [] else: self.delimiter = delimiter if family is None: self.family = [] else: self.family = family if given is None: self.given = [] else: self.given = given if prefix is None: self.prefix = [] else: self.prefix = prefix if suffix is None: self.suffix = [] else: self.suffix = suffix if title is None: self.title = [] else: self.title = title if part is None: self.part = [] else: self.part = part self.validTime = validTime self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, EN) if subclass is not None: return subclass(*args_, **kwargs_) if EN.subclass: return EN.subclass(*args_, **kwargs_) else: return EN(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_delimiter(self): return self.delimiter
[docs] def set_delimiter(self, delimiter): self.delimiter = delimiter
[docs] def add_delimiter(self, value): self.delimiter.append(value)
[docs] def insert_delimiter_at(self, index, value): self.delimiter.insert(index, value)
[docs] def replace_delimiter_at(self, index, value): self.delimiter[index] = value
[docs] def get_family(self): return self.family
[docs] def set_family(self, family): self.family = family
[docs] def add_family(self, value): self.family.append(value)
[docs] def insert_family_at(self, index, value): self.family.insert(index, value)
[docs] def replace_family_at(self, index, value): self.family[index] = value
[docs] def get_given(self): return self.given
[docs] def set_given(self, given): self.given = given
[docs] def add_given(self, value): self.given.append(value)
[docs] def insert_given_at(self, index, value): self.given.insert(index, value)
[docs] def replace_given_at(self, index, value): self.given[index] = value
[docs] def get_prefix(self): return self.prefix
[docs] def set_prefix(self, prefix): self.prefix = prefix
[docs] def add_prefix(self, value): self.prefix.append(value)
[docs] def insert_prefix_at(self, index, value): self.prefix.insert(index, value)
[docs] def replace_prefix_at(self, index, value): self.prefix[index] = value
[docs] def get_suffix(self): return self.suffix
[docs] def set_suffix(self, suffix): self.suffix = suffix
[docs] def add_suffix(self, value): self.suffix.append(value)
[docs] def insert_suffix_at(self, index, value): self.suffix.insert(index, value)
[docs] def replace_suffix_at(self, index, value): self.suffix[index] = value
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def add_title(self, value): self.title.append(value)
[docs] def insert_title_at(self, index, value): self.title.insert(index, value)
[docs] def replace_title_at(self, index, value): self.title[index] = value
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_validTime(self): return self.validTime
[docs] def set_validTime(self, validTime): self.validTime = validTime
[docs] def get_use(self): return self.use
[docs] def set_use(self, use): self.use = use
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_set_EntityNameUse(self, value): # Validate type set_EntityNameUse, a restriction on EntityNameUse. pass
[docs] def hasContent_(self): if ( self.delimiter or self.family or self.given or self.prefix or self.suffix or self.title or self.part or self.validTime is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(EN, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='EN', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='EN') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='EN', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EN'): super(EN, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EN') if self.use is not None and 'use' not in already_processed: already_processed.add('use') outfile.write(' use=%s' % (quote_attrib(self.use), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='EN', fromsubclass_=False, pretty_print=True): super(EN, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('use', node) if value is not None and 'use' not in already_processed: already_processed.add('use') self.use = value self.validate_set_EntityNameUse(self.use) # validate type set_EntityNameUse value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(EN, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'delimiter': obj_ = enxp_delimiter.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'delimiter', obj_) self.content_.append(obj_) if hasattr(self, 'add_delimiter'): self.add_delimiter(obj_.value) elif hasattr(self, 'set_delimiter'): self.set_delimiter(obj_.value) elif nodeName_ == 'family': obj_ = enxp_family.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'family', obj_) self.content_.append(obj_) if hasattr(self, 'add_family'): self.add_family(obj_.value) elif hasattr(self, 'set_family'): self.set_family(obj_.value) elif nodeName_ == 'given': obj_ = enxp_given.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'given', obj_) self.content_.append(obj_) if hasattr(self, 'add_given'): self.add_given(obj_.value) elif hasattr(self, 'set_given'): self.set_given(obj_.value) elif nodeName_ == 'prefix': obj_ = enxp_prefix.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'prefix', obj_) self.content_.append(obj_) if hasattr(self, 'add_prefix'): self.add_prefix(obj_.value) elif hasattr(self, 'set_prefix'): self.set_prefix(obj_.value) elif nodeName_ == 'suffix': obj_ = enxp_suffix.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'suffix', obj_) self.content_.append(obj_) if hasattr(self, 'add_suffix'): self.add_suffix(obj_.value) elif hasattr(self, 'set_suffix'): self.set_suffix(obj_.value) elif nodeName_ == 'title': obj_ = enxp_title.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'title', obj_) self.content_.append(obj_) if hasattr(self, 'add_title'): self.add_title(obj_.value) elif hasattr(self, 'set_title'): self.set_title(obj_.value) elif nodeName_ == 'part': obj_ = enxp_part.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'part', obj_) self.content_.append(obj_) if hasattr(self, 'add_part'): self.add_part(obj_.value) elif hasattr(self, 'set_part'): self.set_part(obj_.value) elif nodeName_ == 'validTime': obj_ = IVL_TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'validTime', obj_) self.content_.append(obj_) if hasattr(self, 'add_validTime'): self.add_validTime(obj_.value) elif hasattr(self, 'set_validTime'): self.set_validTime(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(EN, self).buildChildren(child_, node, nodeName_, True)
# end class EN
[docs]class PN(EN): """A name for a person. A sequence of name parts, such as given name or family name, prefix, suffix, etc. PN differs from EN because the qualifier type cannot include LS (Legal Status).""" subclass = None superclass = EN def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, use=None, delimiter=None, family=None, given=None, prefix=None, suffix=None, title=None, part=None, validTime=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(PN, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, use, delimiter, family, given, prefix, suffix, title, part, validTime, valueOf_, mixedclass_, content_, ) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PN) if subclass is not None: return subclass(*args_, **kwargs_) if PN.subclass: return PN.subclass(*args_, **kwargs_) else: return PN(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(PN, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PN', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PN') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PN', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PN'): super(PN, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PN')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PN', fromsubclass_=False, pretty_print=True): super(PN, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(PN, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(PN, self).buildChildren(child_, node, nodeName_, True) pass
# end class PN
[docs]class ON(EN): """A name for an organization. A sequence of name parts. A set of codes advising a system or user which name in a set of like names to select for a given purpose. A name without specific use code might be a default name useful for any purpose, but a name with a specific use code would be preferred for that respective purpose.""" subclass = None superclass = EN def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, use=None, delimiter=None, family=None, given=None, prefix=None, suffix=None, title=None, part=None, validTime=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(ON, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, use, delimiter, family, given, prefix, suffix, title, part, validTime, valueOf_, mixedclass_, content_, ) self.use = _cast(None, use) if delimiter is None: self.delimiter = [] else: self.delimiter = delimiter if prefix is None: self.prefix = [] else: self.prefix = prefix if suffix is None: self.suffix = [] else: self.suffix = suffix self.validTime = validTime self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, ON) if subclass is not None: return subclass(*args_, **kwargs_) if ON.subclass: return ON.subclass(*args_, **kwargs_) else: return ON(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_delimiter(self): return self.delimiter
[docs] def set_delimiter(self, delimiter): self.delimiter = delimiter
[docs] def add_delimiter(self, value): self.delimiter.append(value)
[docs] def insert_delimiter_at(self, index, value): self.delimiter.insert(index, value)
[docs] def replace_delimiter_at(self, index, value): self.delimiter[index] = value
[docs] def get_prefix(self): return self.prefix
[docs] def set_prefix(self, prefix): self.prefix = prefix
[docs] def add_prefix(self, value): self.prefix.append(value)
[docs] def insert_prefix_at(self, index, value): self.prefix.insert(index, value)
[docs] def replace_prefix_at(self, index, value): self.prefix[index] = value
[docs] def get_suffix(self): return self.suffix
[docs] def set_suffix(self, suffix): self.suffix = suffix
[docs] def add_suffix(self, value): self.suffix.append(value)
[docs] def insert_suffix_at(self, index, value): self.suffix.insert(index, value)
[docs] def replace_suffix_at(self, index, value): self.suffix[index] = value
[docs] def get_validTime(self): return self.validTime
[docs] def set_validTime(self, validTime): self.validTime = validTime
[docs] def get_use(self): return self.use
[docs] def set_use(self, use): self.use = use
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_set_EntityNameUse(self, value): # Validate type set_EntityNameUse, a restriction on EntityNameUse. pass
[docs] def hasContent_(self): if ( self.delimiter or self.prefix or self.suffix or self.validTime is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(ON, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='ON', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='ON') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='ON', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ON'): super(ON, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ON') if self.use is not None and 'use' not in already_processed: already_processed.add('use') outfile.write(' use=%s' % (quote_attrib(self.use), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='ON', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('use', node) if value is not None and 'use' not in already_processed: already_processed.add('use') self.use = value self.validate_set_EntityNameUse(self.use) # validate type set_EntityNameUse super(ON, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'delimiter': obj_ = enxp_delimiter.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'delimiter', obj_) self.content_.append(obj_) if hasattr(self, 'add_delimiter'): self.add_delimiter(obj_.value) elif hasattr(self, 'set_delimiter'): self.set_delimiter(obj_.value) elif nodeName_ == 'prefix': obj_ = enxp_prefix.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'prefix', obj_) self.content_.append(obj_) if hasattr(self, 'add_prefix'): self.add_prefix(obj_.value) elif hasattr(self, 'set_prefix'): self.set_prefix(obj_.value) elif nodeName_ == 'suffix': obj_ = enxp_suffix.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'suffix', obj_) self.content_.append(obj_) if hasattr(self, 'add_suffix'): self.add_suffix(obj_.value) elif hasattr(self, 'set_suffix'): self.set_suffix(obj_.value) elif nodeName_ == 'validTime': obj_ = IVL_TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'validTime', obj_) self.content_.append(obj_) if hasattr(self, 'add_validTime'): self.add_validTime(obj_.value) elif hasattr(self, 'set_validTime'): self.set_validTime(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class ON
[docs]class TN(EN): """A restriction of entity name that is effectively a simple string used for a simple name for things and places.""" subclass = None superclass = EN def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, use=None, delimiter=None, family=None, given=None, prefix=None, suffix=None, title=None, part=None, validTime=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(TN, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, use, delimiter, family, given, prefix, suffix, title, part, validTime, valueOf_, mixedclass_, content_, ) self.validTime = validTime self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, TN) if subclass is not None: return subclass(*args_, **kwargs_) if TN.subclass: return TN.subclass(*args_, **kwargs_) else: return TN(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_validTime(self): return self.validTime
[docs] def set_validTime(self, validTime): self.validTime = validTime
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( self.validTime is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(TN, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='TN', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='TN') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='TN', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TN'): super(TN, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TN')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='TN', fromsubclass_=False, pretty_print=True): if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(TN, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'validTime': obj_ = IVL_TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'validTime', obj_) self.content_.append(obj_) if hasattr(self, 'add_validTime'): self.add_validTime(obj_.value) elif hasattr(self, 'set_validTime'): self.set_validTime(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_)
# end class TN
[docs]class QTY(ANY): """is an abstract generalization for all data types (1) whose value set has an order relation (less-or-equal) and (2) where difference is defined in all of the data type's totally ordered value subsets. The quantity type abstraction is needed in defining certain other types, such as the interval and the probability distribution.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(QTY, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, valueOf_, mixedclass_, content_, extensiontype_, ) self.originalText = originalText self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, QTY) if subclass is not None: return subclass(*args_, **kwargs_) if QTY.subclass: return QTY.subclass(*args_, **kwargs_) else: return QTY(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_originalText(self): return self.originalText
[docs] def set_originalText(self, originalText): self.originalText = originalText
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self): if ( self.originalText is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(QTY, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='QTY', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='QTY') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='QTY', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='QTY'): super(QTY, self).exportAttributes(outfile, level, already_processed, namespace_, name_='QTY') if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='QTY', fromsubclass_=False, pretty_print=True): super(QTY, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(QTY, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'originalText': obj_ = ED.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'originalText', obj_) self.content_.append(obj_) if hasattr(self, 'add_originalText'): self.add_originalText(obj_.value) elif hasattr(self, 'set_originalText'): self.set_originalText(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(QTY, self).buildChildren(child_, node, nodeName_, True)
# end class QTY
[docs]class INT(QTY): """Integer numbers (-1,0,1,2, 100, 3398129, etc.) are precise numbers that are results of counting and enumerating. Integer numbers are discrete, the set of integers is infinite but countable. No arbitrary limit is imposed on the range of integer numbers. Two NULL flavors are defined for the positive and negative infinity.""" subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(INT, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, valueOf_, mixedclass_, content_, extensiontype_, ) self.value = _cast(None, value) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, INT) if subclass is not None: return subclass(*args_, **kwargs_) if INT.subclass: return INT.subclass(*args_, **kwargs_) else: return INT(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_int(self, value): # Validate type int, a restriction on xs:integer. if value is not None and Validate_simpletypes_: pass
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(INT, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='INT', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='INT') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='INT', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='INT'): super(INT, self).exportAttributes(outfile, level, already_processed, namespace_, name_='INT') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='INT', fromsubclass_=False, pretty_print=True): super(INT, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') try: self.value = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.value) # validate type int value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(INT, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(INT, self).buildChildren(child_, node, nodeName_, True) pass
# end class INT
[docs]class REAL(QTY): """Fractional numbers. Typically used whenever quantities are measured, estimated, or computed from other real numbers. The typical representation is decimal, where the number of significant decimal digits is known as the precision. Real numbers are needed beyond integers whenever quantities of the real world are measured, estimated, or computed from other real numbers. The term "Real number" in this specification is used to mean that fractional values are covered without necessarily implying the full set of the mathematical real numbers.""" subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(REAL, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, valueOf_, mixedclass_, content_, extensiontype_, ) self.value = _cast(None, value) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, REAL) if subclass is not None: return subclass(*args_, **kwargs_) if REAL.subclass: return REAL.subclass(*args_, **kwargs_) else: return REAL(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_real(self, value): # Validate type real, a restriction on None. pass
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(REAL, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='REAL', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='REAL') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='REAL', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='REAL'): super(REAL, self).exportAttributes(outfile, level, already_processed, namespace_, name_='REAL') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='REAL', fromsubclass_=False, pretty_print=True): super(REAL, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_real(self.value) # validate type real value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(REAL, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(REAL, self).buildChildren(child_, node, nodeName_, True) pass
# end class REAL
[docs]class PQR(CV): """A representation of a physical quantity in a unit from any code system. Used to show alternative representation for a physical quantity. The magnitude of the measurement value in terms of the unit specified in the code.""" subclass = None superclass = CV def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None, value=None): self.original_tagname_ = None super(PQR, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, ) self.value = _cast(None, value)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PQR) if subclass is not None: return subclass(*args_, **kwargs_) if PQR.subclass: return PQR.subclass(*args_, **kwargs_) else: return PQR(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def validate_real(self, value): # Validate type real, a restriction on None. pass
[docs] def hasContent_(self): if ( super(PQR, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PQR', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PQR') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PQR', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PQR'): super(PQR, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PQR') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PQR', fromsubclass_=False, pretty_print=True): super(PQR, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_real(self.value) # validate type real super(PQR, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(PQR, self).buildChildren(child_, node, nodeName_, True) pass
# end class PQR
[docs]class PQ(QTY): """A dimensioned quantity expressing the result of a measurement act. The magnitude of the quantity measured in terms of the unit. The unit of measure specified in the Unified Code for Units of Measure (UCUM) [http://aurora.rg.iupui.edu/UCUM]. CodingRationale provides a reason why a particular has been provided, either as the root concept or as one of the translations.""" subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, valueOf_, mixedclass_, content_, extensiontype_, ) self.value = _cast(None, value) self.unit = _cast(None, unit) self.codingRationale = _cast(None, codingRationale) if translation is None: self.translation = [] else: self.translation = translation self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PQ) if subclass is not None: return subclass(*args_, **kwargs_) if PQ.subclass: return PQ.subclass(*args_, **kwargs_) else: return PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_translation(self): return self.translation
[docs] def set_translation(self, translation): self.translation = translation
[docs] def add_translation(self, value): self.translation.append(value)
[docs] def insert_translation_at(self, index, value): self.translation.insert(index, value)
[docs] def replace_translation_at(self, index, value): self.translation[index] = value
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_unit(self): return self.unit
[docs] def set_unit(self, unit): self.unit = unit
[docs] def get_codingRationale(self): return self.codingRationale
[docs] def set_codingRationale(self, codingRationale): self.codingRationale = codingRationale
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_real(self, value): # Validate type real, a restriction on None. pass
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_set_CodingRationale(self, value): # Validate type set_CodingRationale, a restriction on CodingRationale. pass
[docs] def hasContent_(self): if ( self.translation or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PQ'): super(PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PQ') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.unit != "1" and 'unit' not in already_processed: already_processed.add('unit') outfile.write(' unit=%s' % (quote_attrib(self.unit), )) if self.codingRationale is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') outfile.write(' codingRationale=%s' % (quote_attrib(self.codingRationale), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PQ', fromsubclass_=False, pretty_print=True): super(PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_real(self.value) # validate type real value = find_attr_value_('unit', node) if value is not None and 'unit' not in already_processed: already_processed.add('unit') self.unit = value self.unit = ' '.join(self.unit.split()) self.validate_cs(self.unit) # validate type cs value = find_attr_value_('codingRationale', node) if value is not None and 'codingRationale' not in already_processed: already_processed.add('codingRationale') self.codingRationale = value self.validate_set_CodingRationale(self.codingRationale) # validate type set_CodingRationale value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'translation': obj_ = PQR.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'translation', obj_) self.content_.append(obj_) if hasattr(self, 'add_translation'): self.add_translation(obj_.value) elif hasattr(self, 'set_translation'): self.set_translation(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(PQ, self).buildChildren(child_, node, nodeName_, True)
# end class PQ
[docs]class MO(QTY): """A monetary amount is a quantity expressing the amount of money in some currency. Currencies are the units in which monetary amounts are denominated in different economic regions. While the monetary amount is a single kind of quantity (money) the exchange rates between the different units are variable. This is the principle difference between physical quantity and monetary amounts, and the reason why currency units are not physical units. The magnitude of the monetary amount in terms of the currency unit. The currency unit as defined in ISO 4217.""" subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, currency=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(MO, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, valueOf_, mixedclass_, content_, extensiontype_, ) self.value = _cast(None, value) self.currency = _cast(None, currency) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, MO) if subclass is not None: return subclass(*args_, **kwargs_) if MO.subclass: return MO.subclass(*args_, **kwargs_) else: return MO(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_currency(self): return self.currency
[docs] def set_currency(self, currency): self.currency = currency
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_real(self, value): # Validate type real, a restriction on None. pass
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(MO, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='MO', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='MO') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='MO', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MO'): super(MO, self).exportAttributes(outfile, level, already_processed, namespace_, name_='MO') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.currency is not None and 'currency' not in already_processed: already_processed.add('currency') outfile.write(' currency=%s' % (quote_attrib(self.currency), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='MO', fromsubclass_=False, pretty_print=True): super(MO, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_real(self.value) # validate type real value = find_attr_value_('currency', node) if value is not None and 'currency' not in already_processed: already_processed.add('currency') self.currency = value self.currency = ' '.join(self.currency.split()) self.validate_cs(self.currency) # validate type cs value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(MO, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(MO, self).buildChildren(child_, node, nodeName_, True) pass
# end class MO
[docs]class EIVL_event(CE): """A code for a common (periodical) activity of daily living based on which the event related periodic interval is specified.""" subclass = None superclass = CE def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None): self.original_tagname_ = None super(EIVL_event, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, ) self.code = _cast(None, code) self.codeSystem = _cast(None, codeSystem) self.codeSystemName = _cast(None, codeSystemName)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, EIVL_event) if subclass is not None: return subclass(*args_, **kwargs_) if EIVL_event.subclass: return EIVL_event.subclass(*args_, **kwargs_) else: return EIVL_event(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_codeSystem(self): return self.codeSystem
[docs] def set_codeSystem(self, codeSystem): self.codeSystem = codeSystem
[docs] def get_codeSystemName(self): return self.codeSystemName
[docs] def set_codeSystemName(self, codeSystemName): self.codeSystemName = codeSystemName
[docs] def validate_TimingEvent(self, value): # Validate type TimingEvent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AC', 'ACD', 'ACM', 'ACV', 'C', 'CD', 'CM', 'CV', 'HS', 'IC', 'ICD', 'ICM', 'ICV', 'PC', 'PCD', 'PCM', 'PCV', 'WAKE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on TimingEvent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_TimingEvent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_TimingEvent_patterns_, ))
validate_TimingEvent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( super(EIVL_event, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='EIVL.event', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='EIVL.event') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='EIVL.event', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EIVL.event'): super(EIVL_event, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EIVL.event') if self.code is not None and 'code' not in already_processed: already_processed.add('code') outfile.write(' code=%s' % (quote_attrib(self.code), )) if self.codeSystem is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') outfile.write(' codeSystem=%s' % (quote_attrib(self.codeSystem), )) if self.codeSystemName is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') outfile.write(' codeSystemName=%s' % (quote_attrib(self.codeSystemName), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='EIVL.event', fromsubclass_=False, pretty_print=True): pass
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('code', node) if value is not None and 'code' not in already_processed: already_processed.add('code') self.code = value self.validate_TimingEvent(self.code) # validate type TimingEvent value = find_attr_value_('codeSystem', node) if value is not None and 'codeSystem' not in already_processed: already_processed.add('codeSystem') self.codeSystem = value self.validate_uid(self.codeSystem) # validate type uid value = find_attr_value_('codeSystemName', node) if value is not None and 'codeSystemName' not in already_processed: already_processed.add('codeSystemName') self.codeSystemName = value self.validate_st(self.codeSystemName) # validate type st super(EIVL_event, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass
# end class EIVL_event
[docs]class RTO_QTY_QTY(QTY): subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, numerator=None, denominator=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(RTO_QTY_QTY, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, valueOf_, mixedclass_, content_, extensiontype_, ) self.numerator = numerator self.denominator = denominator self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, RTO_QTY_QTY) if subclass is not None: return subclass(*args_, **kwargs_) if RTO_QTY_QTY.subclass: return RTO_QTY_QTY.subclass(*args_, **kwargs_) else: return RTO_QTY_QTY(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_numerator(self): return self.numerator
[docs] def set_numerator(self, numerator): self.numerator = numerator
[docs] def get_denominator(self): return self.denominator
[docs] def set_denominator(self, denominator): self.denominator = denominator
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self): if ( self.numerator is not None or self.denominator is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(RTO_QTY_QTY, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='RTO_QTY_QTY', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_QTY_QTY') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='RTO_QTY_QTY', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='RTO_QTY_QTY'): super(RTO_QTY_QTY, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_QTY_QTY') if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='RTO_QTY_QTY', fromsubclass_=False, pretty_print=True): super(RTO_QTY_QTY, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(RTO_QTY_QTY, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'numerator': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <numerator> element') obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'numerator', obj_) self.content_.append(obj_) if hasattr(self, 'add_numerator'): self.add_numerator(obj_.value) elif hasattr(self, 'set_numerator'): self.set_numerator(obj_.value) elif nodeName_ == 'denominator': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <denominator> element') obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'denominator', obj_) self.content_.append(obj_) if hasattr(self, 'add_denominator'): self.add_denominator(obj_.value) elif hasattr(self, 'set_denominator'): self.set_denominator(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(RTO_QTY_QTY, self).buildChildren(child_, node, nodeName_, True)
# end class RTO_QTY_QTY
[docs]class POCP_MT030100UV_ActDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, product=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime if product is None: self.product = [] else: self.product = product if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_ActDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_ActDefinition.subclass: return POCP_MT030100UV_ActDefinition.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_ActDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_product(self): return self.product
[docs] def set_product(self, product): self.product = product
[docs] def add_product(self, value): self.product.append(value)
[docs] def insert_product_at(self, index, value): self.product.insert(index, value)
[docs] def replace_product_at(self, index, value): self.product[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.product or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.ActDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.ActDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.ActDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.ActDefinition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.ActDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for product_ in self.product: product_.export(outfile, level, namespace_, name_='product', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'product': obj_ = POCP_MT030100UV_Product.factory() obj_.build(child_) self.product.append(obj_) obj_.original_tagname_ = 'product' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT030100UV_ActDefinition
[docs]class POCP_MT030100UV_AssignedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ASSIGNED', realmCode=None, typeId=None, templateId=None, code=None, confidentialityCode=None, assignedOrganization=None, subjectOf=None, performance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.confidentialityCode = confidentialityCode self.assignedOrganization = assignedOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if performance is None: self.performance = [] else: self.performance = performance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_AssignedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_AssignedEntity.subclass: return POCP_MT030100UV_AssignedEntity.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_AssignedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_assignedOrganization(self): return self.assignedOrganization
[docs] def set_assignedOrganization(self, assignedOrganization): self.assignedOrganization = assignedOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_performance(self): return self.performance
[docs] def set_performance(self, performance): self.performance = performance
[docs] def add_performance(self, value): self.performance.append(value)
[docs] def insert_performance_at(self, index, value): self.performance.insert(index, value)
[docs] def replace_performance_at(self, index, value): self.performance[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.confidentialityCode is not None or self.assignedOrganization is not None or self.subjectOf or self.performance ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.AssignedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.AssignedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.AssignedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.AssignedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ASSIGNED" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.AssignedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.assignedOrganization is not None: self.assignedOrganization.export(outfile, level, namespace_, name_='assignedOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for performance_ in self.performance: performance_.export(outfile, level, namespace_, name_='performance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'assignedOrganization': obj_ = POCP_MT030100UV_Organization.factory() obj_.build(child_) self.assignedOrganization = obj_ obj_.original_tagname_ = 'assignedOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030100UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'performance': obj_ = POCP_MT030100UV_PrimaryPerformer.factory() obj_.build(child_) self.performance.append(obj_) obj_.original_tagname_ = 'performance'
# end class POCP_MT030100UV_AssignedEntity
[docs]class POCP_MT030100UV_AssignedEntity2(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ASSIGNED', realmCode=None, typeId=None, templateId=None, id=None, addr=None, telecom=None, assignedPerson=None, representedOrganization=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.assignedPerson = assignedPerson self.representedOrganization = representedOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_AssignedEntity2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_AssignedEntity2.subclass: return POCP_MT030100UV_AssignedEntity2.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_AssignedEntity2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_assignedPerson(self): return self.assignedPerson
[docs] def set_assignedPerson(self, assignedPerson): self.assignedPerson = assignedPerson
[docs] def get_representedOrganization(self): return self.representedOrganization
[docs] def set_representedOrganization(self, representedOrganization): self.representedOrganization = representedOrganization
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.addr is not None or self.telecom or self.assignedPerson is not None or self.representedOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.AssignedEntity2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.AssignedEntity2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.AssignedEntity2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.AssignedEntity2'): if self.classCode != "ASSIGNED" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.AssignedEntity2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.assignedPerson is not None: self.assignedPerson.export(outfile, level, namespace_, name_='assignedPerson', pretty_print=pretty_print) if self.representedOrganization is not None: self.representedOrganization.export(outfile, level, namespace_, name_='representedOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'assignedPerson': obj_ = POCP_MT030100UV_Person.factory() obj_.build(child_) self.assignedPerson = obj_ obj_.original_tagname_ = 'assignedPerson' elif nodeName_ == 'representedOrganization': obj_ = POCP_MT030100UV_Organization.factory() obj_.build(child_) self.representedOrganization = obj_ obj_.original_tagname_ = 'representedOrganization'
# end class POCP_MT030100UV_AssignedEntity2
[docs]class POCP_MT030100UV_AssignedEntity3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ASSIGNED', realmCode=None, typeId=None, templateId=None, code=None, confidentialityCode=None, representedOrganization=None, subjectOf=None, performance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.confidentialityCode = confidentialityCode self.representedOrganization = representedOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if performance is None: self.performance = [] else: self.performance = performance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_AssignedEntity3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_AssignedEntity3.subclass: return POCP_MT030100UV_AssignedEntity3.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_AssignedEntity3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_representedOrganization(self): return self.representedOrganization
[docs] def set_representedOrganization(self, representedOrganization): self.representedOrganization = representedOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_performance(self): return self.performance
[docs] def set_performance(self, performance): self.performance = performance
[docs] def add_performance(self, value): self.performance.append(value)
[docs] def insert_performance_at(self, index, value): self.performance.insert(index, value)
[docs] def replace_performance_at(self, index, value): self.performance[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.confidentialityCode is not None or self.representedOrganization is not None or self.subjectOf or self.performance ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.AssignedEntity3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.AssignedEntity3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.AssignedEntity3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.AssignedEntity3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ASSIGNED" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.AssignedEntity3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.representedOrganization is not None: self.representedOrganization.export(outfile, level, namespace_, name_='representedOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for performance_ in self.performance: performance_.export(outfile, level, namespace_, name_='performance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'representedOrganization': obj_ = POCP_MT030100UV_Organization.factory() obj_.build(child_) self.representedOrganization = obj_ obj_.original_tagname_ = 'representedOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030100UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'performance': obj_ = POCP_MT030100UV_PrimaryPerformer.factory() obj_.build(child_) self.performance.append(obj_) obj_.original_tagname_ = 'performance'
# end class POCP_MT030100UV_AssignedEntity3
[docs]class POCP_MT030100UV_ContactParty(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CON', realmCode=None, typeId=None, templateId=None, code=None, name=None, addr=None, telecom=None, confidentialityCode=None, contactPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.confidentialityCode = confidentialityCode self.contactPerson = contactPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_ContactParty) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_ContactParty.subclass: return POCP_MT030100UV_ContactParty.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_ContactParty(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_contactPerson(self): return self.contactPerson
[docs] def set_contactPerson(self, contactPerson): self.contactPerson = contactPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContact(self, value): # Validate type RoleClassContact, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CON', 'ECON', 'NOK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContact' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContact_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContact_patterns_, ))
validate_RoleClassContact_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.addr is not None or self.telecom or self.confidentialityCode is not None or self.contactPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.ContactParty', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.ContactParty') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.ContactParty', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.ContactParty'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CON" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.ContactParty', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.contactPerson is not None: self.contactPerson.export(outfile, level, namespace_, name_='contactPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContact(self.classCode) # validate type RoleClassContact
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'contactPerson': obj_ = POCP_MT030100UV_Person.factory() obj_.build(child_) self.contactPerson = obj_ obj_.original_tagname_ = 'contactPerson'
# end class POCP_MT030100UV_ContactParty
[docs]class POCP_MT030100UV_ManufacturedProduct3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturedMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturedMaterialKind = manufacturedMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_ManufacturedProduct3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_ManufacturedProduct3.subclass: return POCP_MT030100UV_ManufacturedProduct3.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_ManufacturedProduct3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturedMaterialKind(self): return self.manufacturedMaterialKind
[docs] def set_manufacturedMaterialKind(self, manufacturedMaterialKind): self.manufacturedMaterialKind = manufacturedMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturedMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.ManufacturedProduct3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.ManufacturedProduct3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.ManufacturedProduct3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.ManufacturedProduct3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.ManufacturedProduct3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturedMaterialKind is not None: self.manufacturedMaterialKind.export(outfile, level, namespace_, name_='manufacturedMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturedMaterialKind': obj_ = POCP_MT010400UV_MaterialKind.factory() obj_.build(child_) self.manufacturedMaterialKind = obj_ obj_.original_tagname_ = 'manufacturedMaterialKind'
# end class POCP_MT030100UV_ManufacturedProduct3
[docs]class POCP_MT030100UV_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, telecom=None, addr=None, assignedEntity1=None, asNamedEntity=None, contactParty=None, assignedEntity=None, otherLocation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.name = name if telecom is None: self.telecom = [] else: self.telecom = telecom self.addr = addr if assignedEntity1 is None: self.assignedEntity1 = [] else: self.assignedEntity1 = assignedEntity1 if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if contactParty is None: self.contactParty = [] else: self.contactParty = contactParty if assignedEntity is None: self.assignedEntity = [] else: self.assignedEntity = assignedEntity if otherLocation is None: self.otherLocation = [] else: self.otherLocation = otherLocation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_Organization.subclass: return POCP_MT030100UV_Organization.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_assignedEntity1(self): return self.assignedEntity1
[docs] def set_assignedEntity1(self, assignedEntity1): self.assignedEntity1 = assignedEntity1
[docs] def add_assignedEntity1(self, value): self.assignedEntity1.append(value)
[docs] def insert_assignedEntity1_at(self, index, value): self.assignedEntity1.insert(index, value)
[docs] def replace_assignedEntity1_at(self, index, value): self.assignedEntity1[index] = value
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_contactParty(self): return self.contactParty
[docs] def set_contactParty(self, contactParty): self.contactParty = contactParty
[docs] def add_contactParty(self, value): self.contactParty.append(value)
[docs] def insert_contactParty_at(self, index, value): self.contactParty.insert(index, value)
[docs] def replace_contactParty_at(self, index, value): self.contactParty[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def add_assignedEntity(self, value): self.assignedEntity.append(value)
[docs] def insert_assignedEntity_at(self, index, value): self.assignedEntity.insert(index, value)
[docs] def replace_assignedEntity_at(self, index, value): self.assignedEntity[index] = value
[docs] def get_otherLocation(self): return self.otherLocation
[docs] def set_otherLocation(self, otherLocation): self.otherLocation = otherLocation
[docs] def add_otherLocation(self, value): self.otherLocation.append(value)
[docs] def insert_otherLocation_at(self, index, value): self.otherLocation.insert(index, value)
[docs] def replace_otherLocation_at(self, index, value): self.otherLocation[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.name is not None or self.telecom or self.addr is not None or self.assignedEntity1 or self.asNamedEntity or self.contactParty or self.assignedEntity or self.otherLocation ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.Organization'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for assignedEntity1_ in self.assignedEntity1: assignedEntity1_.export(outfile, level, namespace_, name_='assignedEntity1', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for contactParty_ in self.contactParty: contactParty_.export(outfile, level, namespace_, name_='contactParty', pretty_print=pretty_print) for assignedEntity_ in self.assignedEntity: assignedEntity_.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print) for otherLocation_ in self.otherLocation: otherLocation_.export(outfile, level, namespace_, name_='otherLocation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'assignedEntity1': obj_ = POCP_MT030100UV_AssignedEntity3.factory() obj_.build(child_) self.assignedEntity1.append(obj_) obj_.original_tagname_ = 'assignedEntity1' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT000100UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'contactParty': obj_ = POCP_MT030100UV_ContactParty.factory() obj_.build(child_) self.contactParty.append(obj_) obj_.original_tagname_ = 'contactParty' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity.factory() obj_.build(child_) self.assignedEntity.append(obj_) obj_.original_tagname_ = 'assignedEntity' elif nodeName_ == 'otherLocation': obj_ = POCP_MT030100UV_OtherLocation.factory() obj_.build(child_) self.otherLocation.append(obj_) obj_.original_tagname_ = 'otherLocation'
# end class POCP_MT030100UV_Organization
[docs]class POCP_MT030100UV_OtherLocation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SDLOC', realmCode=None, typeId=None, templateId=None, code=None, addr=None, telecom=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_OtherLocation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_OtherLocation.subclass: return POCP_MT030100UV_OtherLocation.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_OtherLocation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassServiceDeliveryLocation(self, value): # Validate type RoleClassServiceDeliveryLocation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SDLOC', 'DSDLOC', 'ISDLOC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassServiceDeliveryLocation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassServiceDeliveryLocation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassServiceDeliveryLocation_patterns_, ))
validate_RoleClassServiceDeliveryLocation_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.addr is not None or self.telecom ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.OtherLocation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.OtherLocation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.OtherLocation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.OtherLocation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SDLOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.OtherLocation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassServiceDeliveryLocation(self.classCode) # validate type RoleClassServiceDeliveryLocation
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom'
# end class POCP_MT030100UV_OtherLocation
[docs]class POCP_MT030100UV_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PSN', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_Person) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_Person.subclass: return POCP_MT030100UV_Person.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.Person'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PSN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT030100UV_Person
[docs]class POCP_MT030100UV_PrimaryPerformer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PPRF', realmCode=None, typeId=None, templateId=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_PrimaryPerformer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_PrimaryPerformer.subclass: return POCP_MT030100UV_PrimaryPerformer.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_PrimaryPerformer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPrimaryPerformer(self, value): # Validate type ParticipationPrimaryPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPrimaryPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPrimaryPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPrimaryPerformer_patterns_, ))
validate_ParticipationPrimaryPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.PrimaryPerformer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.PrimaryPerformer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.PrimaryPerformer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.PrimaryPerformer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PPRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.PrimaryPerformer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPrimaryPerformer(self.typeCode) # validate type ParticipationPrimaryPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'actDefinition': obj_ = POCP_MT030100UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT030100UV_PrimaryPerformer
[docs]class POCP_MT030100UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, manufacturedProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct = manufacturedProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_Product.subclass: return POCP_MT030100UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT030100UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct'
# end class POCP_MT030100UV_Product
[docs]class POCP_MT030100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_Subject.subclass: return POCP_MT030100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT030100UV_Subject
[docs]class POCP_MT030100UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, position=None, characteristic=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.position = position self.characteristic = characteristic
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030100UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030100UV_Subject2.subclass: return POCP_MT030100UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT030100UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_position(self): return self.position
[docs] def set_position(self, position): self.position = position
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.position is not None or self.characteristic is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030100UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030100UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030100UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030100UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.position is not None: self.position.export(outfile, level, namespace_, name_='position', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'position': obj_ = COCT_MT960000UV05_Position.factory() obj_.build(child_) self.position = obj_ obj_.original_tagname_ = 'position' elif nodeName_ == 'characteristic': obj_ = POCP_MT050500UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic'
# end class POCP_MT030100UV_Subject2
[docs]class POCP_MT000100UV_NamedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='IDENT', realmCode=None, typeId=None, templateId=None, code=None, name=None, statusCode=None, effectiveTime=None, assigningTerritory=None, assigningOrganization=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.statusCode = statusCode self.effectiveTime = effectiveTime self.assigningTerritory = assigningTerritory self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT000100UV_NamedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT000100UV_NamedEntity.subclass: return POCP_MT000100UV_NamedEntity.subclass(*args_, **kwargs_) else: return POCP_MT000100UV_NamedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_assigningTerritory(self): return self.assigningTerritory
[docs] def set_assigningTerritory(self, assigningTerritory): self.assigningTerritory = assigningTerritory
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.statusCode is not None or self.effectiveTime is not None or self.assigningTerritory is not None or self.assigningOrganization is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT000100UV.NamedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT000100UV.NamedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT000100UV.NamedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT000100UV.NamedEntity'): if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT000100UV.NamedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.assigningTerritory is not None: self.assigningTerritory.export(outfile, level, namespace_, name_='assigningTerritory', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'assigningTerritory': obj_ = POCP_MT000100UV_Territory.factory() obj_.build(child_) self.assigningTerritory = obj_ obj_.original_tagname_ = 'assigningTerritory' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT000100UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT000100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT000100UV_NamedEntity
[docs]class POCP_MT000100UV_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, territorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.name = name if territorialAuthority is None: self.territorialAuthority = [] else: self.territorialAuthority = territorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT000100UV_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT000100UV_Organization.subclass: return POCP_MT000100UV_Organization.subclass(*args_, **kwargs_) else: return POCP_MT000100UV_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_territorialAuthority(self): return self.territorialAuthority
[docs] def set_territorialAuthority(self, territorialAuthority): self.territorialAuthority = territorialAuthority
[docs] def add_territorialAuthority(self, value): self.territorialAuthority.append(value)
[docs] def insert_territorialAuthority_at(self, index, value): self.territorialAuthority.insert(index, value)
[docs] def replace_territorialAuthority_at(self, index, value): self.territorialAuthority[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.name is not None or self.territorialAuthority ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT000100UV.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT000100UV.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT000100UV.Organization'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for territorialAuthority_ in self.territorialAuthority: territorialAuthority_.export(outfile, level, namespace_, name_='territorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'territorialAuthority': obj_ = POCP_MT000100UV_TerritorialAuthority.factory() obj_.build(child_) self.territorialAuthority.append(obj_) obj_.original_tagname_ = 'territorialAuthority'
# end class POCP_MT000100UV_Organization
[docs]class POCP_MT000100UV_Policy(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='POLICY', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, statusCode=None, effectiveTime=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT000100UV_Policy) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT000100UV_Policy.subclass: return POCP_MT000100UV_Policy.subclass(*args_, **kwargs_) else: return POCP_MT000100UV_Policy(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassPolicy(self, value): # Validate type ActClassPolicy, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEADrugSchedule', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPolicy' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPolicy_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPolicy_patterns_, ))
validate_ActClassPolicy_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.statusCode is not None or self.effectiveTime is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Policy', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT000100UV.Policy') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT000100UV.Policy', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT000100UV.Policy'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "POLICY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Policy', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPolicy(self.classCode) # validate type ActClassPolicy value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime'
# end class POCP_MT000100UV_Policy
[docs]class POCP_MT000100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, policy=None, substanceSpecification=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.policy = policy self.substanceSpecification = substanceSpecification self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT000100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT000100UV_Subject.subclass: return POCP_MT000100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT000100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.policy is not None or self.substanceSpecification is not None or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT000100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT000100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT000100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'policy': obj_ = POCP_MT000100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT000100UV_Subject
[docs]class POCP_MT000100UV_TerritorialAuthority(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, territory=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.territory = territory
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT000100UV_TerritorialAuthority) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT000100UV_TerritorialAuthority.subclass: return POCP_MT000100UV_TerritorialAuthority.subclass(*args_, **kwargs_) else: return POCP_MT000100UV_TerritorialAuthority(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_territory(self): return self.territory
[docs] def set_territory(self, territory): self.territory = territory
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.territory is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT000100UV.TerritorialAuthority') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.territory is not None: self.territory.export(outfile, level, namespace_, name_='territory', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'territory': obj_ = POCP_MT000100UV_Territory.factory() obj_.build(child_) self.territory = obj_ obj_.original_tagname_ = 'territory'
# end class POCP_MT000100UV_TerritorialAuthority
[docs]class POCP_MT000100UV_TerritorialAuthority1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, governingOrganization=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.governingOrganization = governingOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT000100UV_TerritorialAuthority1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT000100UV_TerritorialAuthority1.subclass: return POCP_MT000100UV_TerritorialAuthority1.subclass(*args_, **kwargs_) else: return POCP_MT000100UV_TerritorialAuthority1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_governingOrganization(self): return self.governingOrganization
[docs] def set_governingOrganization(self, governingOrganization): self.governingOrganization = governingOrganization
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.governingOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT000100UV.TerritorialAuthority1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT000100UV.TerritorialAuthority1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.governingOrganization is not None: self.governingOrganization.export(outfile, level, namespace_, name_='governingOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'governingOrganization': obj_ = POCP_MT000100UV_Organization.factory() obj_.build(child_) self.governingOrganization = obj_ obj_.original_tagname_ = 'governingOrganization'
# end class POCP_MT000100UV_TerritorialAuthority1
[docs]class POCP_MT000100UV_Territory(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='STATE', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, code=None, name=None, asTerritorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name if asTerritorialAuthority is None: self.asTerritorialAuthority = [] else: self.asTerritorialAuthority = asTerritorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT000100UV_Territory) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT000100UV_Territory.subclass: return POCP_MT000100UV_Territory.subclass(*args_, **kwargs_) else: return POCP_MT000100UV_Territory(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_asTerritorialAuthority(self): return self.asTerritorialAuthority
[docs] def set_asTerritorialAuthority(self, asTerritorialAuthority): self.asTerritorialAuthority = asTerritorialAuthority
[docs] def add_asTerritorialAuthority(self, value): self.asTerritorialAuthority.append(value)
[docs] def insert_asTerritorialAuthority_at(self, index, value): self.asTerritorialAuthority.insert(index, value)
[docs] def replace_asTerritorialAuthority_at(self, index, value): self.asTerritorialAuthority[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassState(self, value): # Validate type EntityClassState, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassState' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassState_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassState_patterns_, ))
validate_EntityClassState_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.asTerritorialAuthority ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Territory', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT000100UV.Territory') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT000100UV.Territory', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT000100UV.Territory'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "STATE" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT000100UV.Territory', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for asTerritorialAuthority_ in self.asTerritorialAuthority: asTerritorialAuthority_.export(outfile, level, namespace_, name_='asTerritorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassState(self.classCode) # validate type EntityClassState value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'asTerritorialAuthority': obj_ = POCP_MT000100UV_TerritorialAuthority1.factory() obj_.build(child_) self.asTerritorialAuthority.append(obj_) obj_.original_tagname_ = 'asTerritorialAuthority'
# end class POCP_MT000100UV_Territory
[docs]class POCP_MT090100UV_Analyte(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ALY', realmCode=None, typeId=None, templateId=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Analyte) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Analyte.subclass: return POCP_MT090100UV_Analyte.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Analyte(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAnalyte(self, value): # Validate type ParticipationAnalyte, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAnalyte' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAnalyte_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAnalyte_patterns_, ))
validate_ParticipationAnalyte_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Analyte', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Analyte') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Analyte', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Analyte'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ALY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Analyte', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAnalyte(self.typeCode) # validate type ParticipationAnalyte
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT090100UV_Analyte
[docs]class POCP_MT090100UV_Author(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Author) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Author.subclass: return POCP_MT090100UV_Author.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Author(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Author', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Author') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Author', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Author'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Author', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030300UV_AssignedEntity.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT090100UV_Author
[docs]class POCP_MT090100UV_Component(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, processStep=None, observation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.processStep = processStep self.observation = observation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Component) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Component.subclass: return POCP_MT090100UV_Component.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_processStep(self): return self.processStep
[docs] def set_processStep(self, processStep): self.processStep = processStep
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.processStep is not None or self.observation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Component', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Component') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Component', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Component'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Component', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.processStep is not None: self.processStep.export(outfile, level, namespace_, name_='processStep', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'processStep': obj_ = POCP_MT090100UV_ProcessStep.factory() obj_.build(child_) self.processStep = obj_ obj_.original_tagname_ = 'processStep' elif nodeName_ == 'observation': obj_ = POCP_MT090100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation'
# end class POCP_MT090100UV_Component
[docs]class POCP_MT090100UV_Component2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, processStep=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.processStep = processStep
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Component2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Component2.subclass: return POCP_MT090100UV_Component2.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Component2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_processStep(self): return self.processStep
[docs] def set_processStep(self, processStep): self.processStep = processStep
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.processStep is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Component2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Component2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Component2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Component2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Component2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.processStep is not None: self.processStep.export(outfile, level, namespace_, name_='processStep', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'processStep': obj_ = POCP_MT090100UV_ProcessStep.factory() obj_.build(child_) self.processStep = obj_ obj_.original_tagname_ = 'processStep'
# end class POCP_MT090100UV_Component2
[docs]class POCP_MT090100UV_Consumable(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, manufacturedProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct = manufacturedProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Consumable) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Consumable.subclass: return POCP_MT090100UV_Consumable.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Consumable(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Consumable', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Consumable') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Consumable', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Consumable'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Consumable', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010100UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct'
# end class POCP_MT090100UV_Consumable
[docs]class POCP_MT090100UV_ControlVariable(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CTRLV', realmCode=None, typeId=None, templateId=None, observation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observation = observation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_ControlVariable) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_ControlVariable.subclass: return POCP_MT090100UV_ControlVariable.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_ControlVariable(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasControlVariable(self, value): # Validate type ActRelationshipHasControlVariable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CTRLV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasControlVariable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasControlVariable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasControlVariable_patterns_, ))
validate_ActRelationshipHasControlVariable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ControlVariable', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.ControlVariable') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.ControlVariable', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.ControlVariable'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CTRLV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ControlVariable', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasControlVariable(self.typeCode) # validate type ActRelationshipHasControlVariable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observation': obj_ = POCP_MT090100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation'
# end class POCP_MT090100UV_ControlVariable
[docs]class POCP_MT090100UV_Device(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DEV', realmCode=None, typeId=None, templateId=None, functionCode=None, instanceOfKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.instanceOfKind = instanceOfKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Device) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Device.subclass: return POCP_MT090100UV_Device.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Device(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_instanceOfKind(self): return self.instanceOfKind
[docs] def set_instanceOfKind(self, instanceOfKind): self.instanceOfKind = instanceOfKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.instanceOfKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Device', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Device') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Device', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Device'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DEV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Device', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.instanceOfKind is not None: self.instanceOfKind.export(outfile, level, namespace_, name_='instanceOfKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'instanceOfKind': obj_ = POCP_MT020200UV_InstanceOfKind.factory() obj_.build(child_) self.instanceOfKind = obj_ obj_.original_tagname_ = 'instanceOfKind'
# end class POCP_MT090100UV_Device
[docs]class POCP_MT090100UV_Interactor(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Interactor) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Interactor.subclass: return POCP_MT090100UV_Interactor.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Interactor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Interactor', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Interactor') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Interactor', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Interactor'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Interactor', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT090100UV_Interactor
[docs]class POCP_MT090100UV_Observation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, value=None, methodCode=None, analyte=None, referenceRange=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.text = text self.value = value self.methodCode = methodCode if analyte is None: self.analyte = [] else: self.analyte = analyte if referenceRange is None: self.referenceRange = [] else: self.referenceRange = referenceRange if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Observation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Observation.subclass: return POCP_MT090100UV_Observation.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Observation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def get_analyte(self): return self.analyte
[docs] def set_analyte(self, analyte): self.analyte = analyte
[docs] def add_analyte(self, value): self.analyte.append(value)
[docs] def insert_analyte_at(self, index, value): self.analyte.insert(index, value)
[docs] def replace_analyte_at(self, index, value): self.analyte[index] = value
[docs] def get_referenceRange(self): return self.referenceRange
[docs] def set_referenceRange(self, referenceRange): self.referenceRange = referenceRange
[docs] def add_referenceRange(self, value): self.referenceRange.append(value)
[docs] def insert_referenceRange_at(self, index, value): self.referenceRange.insert(index, value)
[docs] def replace_referenceRange_at(self, index, value): self.referenceRange[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.text is not None or self.value is not None or self.methodCode is not None or self.analyte or self.referenceRange or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Observation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Observation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Observation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Observation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Observation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.methodCode is not None: self.methodCode.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) for analyte_ in self.analyte: analyte_.export(outfile, level, namespace_, name_='analyte', pretty_print=pretty_print) for referenceRange_ in self.referenceRange: referenceRange_.export(outfile, level, namespace_, name_='referenceRange', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode = obj_ obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'analyte': obj_ = POCP_MT090100UV_Analyte.factory() obj_.build(child_) self.analyte.append(obj_) obj_.original_tagname_ = 'analyte' elif nodeName_ == 'referenceRange': obj_ = POCP_MT090100UV_ReferenceRange.factory() obj_.build(child_) self.referenceRange.append(obj_) obj_.original_tagname_ = 'referenceRange' elif nodeName_ == 'subjectOf': obj_ = POCP_MT090100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT090100UV_Observation
[docs]class POCP_MT090100UV_ObservationCriterion(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN.CRT', realmCode=None, typeId=None, templateId=None, value=None, interpretationCode=None, subject=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.value = value self.interpretationCode = interpretationCode if subject is None: self.subject = [] else: self.subject = subject if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_ObservationCriterion) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_ObservationCriterion.subclass: return POCP_MT090100UV_ObservationCriterion.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_ObservationCriterion(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_interpretationCode(self): return self.interpretationCode
[docs] def set_interpretationCode(self, interpretationCode): self.interpretationCode = interpretationCode
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def add_subject(self, value): self.subject.append(value)
[docs] def insert_subject_at(self, index, value): self.subject.insert(index, value)
[docs] def replace_subject_at(self, index, value): self.subject[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.value is not None or self.interpretationCode is not None or self.subject or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ObservationCriterion', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.ObservationCriterion') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.ObservationCriterion', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.ObservationCriterion'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ObservationCriterion', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.interpretationCode is not None: self.interpretationCode.export(outfile, level, namespace_, name_='interpretationCode', pretty_print=pretty_print) for subject_ in self.subject: subject_.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'interpretationCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.interpretationCode = obj_ obj_.original_tagname_ = 'interpretationCode' elif nodeName_ == 'subject': obj_ = POCP_MT090100UV_Subject3.factory() obj_.build(child_) self.subject.append(obj_) obj_.original_tagname_ = 'subject' elif nodeName_ == 'subjectOf': obj_ = POCP_MT090100UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT090100UV_ObservationCriterion
[docs]class POCP_MT090100UV_PrimaryPerformer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PPRF', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_PrimaryPerformer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_PrimaryPerformer.subclass: return POCP_MT090100UV_PrimaryPerformer.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_PrimaryPerformer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPrimaryPerformer(self, value): # Validate type ParticipationPrimaryPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPrimaryPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPrimaryPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPrimaryPerformer_patterns_, ))
validate_ParticipationPrimaryPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.PrimaryPerformer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.PrimaryPerformer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.PrimaryPerformer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.PrimaryPerformer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PPRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.PrimaryPerformer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPrimaryPerformer(self.typeCode) # validate type ParticipationPrimaryPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030300UV_AssignedEntity.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT090100UV_PrimaryPerformer
[docs]class POCP_MT090100UV_ProcessStep(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, methodCode=None, device=None, primaryPerformer=None, interactor=None, controlVariable=None, component=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime self.methodCode = methodCode if device is None: self.device = [] else: self.device = device if primaryPerformer is None: self.primaryPerformer = [] else: self.primaryPerformer = primaryPerformer if interactor is None: self.interactor = [] else: self.interactor = interactor if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if component is None: self.component = [] else: self.component = component if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_ProcessStep) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_ProcessStep.subclass: return POCP_MT090100UV_ProcessStep.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_ProcessStep(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def get_device(self): return self.device
[docs] def set_device(self, device): self.device = device
[docs] def add_device(self, value): self.device.append(value)
[docs] def insert_device_at(self, index, value): self.device.insert(index, value)
[docs] def replace_device_at(self, index, value): self.device[index] = value
[docs] def get_primaryPerformer(self): return self.primaryPerformer
[docs] def set_primaryPerformer(self, primaryPerformer): self.primaryPerformer = primaryPerformer
[docs] def add_primaryPerformer(self, value): self.primaryPerformer.append(value)
[docs] def insert_primaryPerformer_at(self, index, value): self.primaryPerformer.insert(index, value)
[docs] def replace_primaryPerformer_at(self, index, value): self.primaryPerformer[index] = value
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.methodCode is not None or self.device or self.primaryPerformer or self.interactor or self.controlVariable or self.component or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ProcessStep', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.ProcessStep') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.ProcessStep', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.ProcessStep'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ProcessStep', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.methodCode is not None: self.methodCode.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) for device_ in self.device: device_.export(outfile, level, namespace_, name_='device', pretty_print=pretty_print) for primaryPerformer_ in self.primaryPerformer: primaryPerformer_.export(outfile, level, namespace_, name_='primaryPerformer', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode = obj_ obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'device': obj_ = POCP_MT090100UV_Device.factory() obj_.build(child_) self.device.append(obj_) obj_.original_tagname_ = 'device' elif nodeName_ == 'primaryPerformer': obj_ = POCP_MT090100UV_PrimaryPerformer.factory() obj_.build(child_) self.primaryPerformer.append(obj_) obj_.original_tagname_ = 'primaryPerformer' elif nodeName_ == 'interactor': obj_ = POCP_MT090100UV_Interactor.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'controlVariable': obj_ = POCP_MT090100UV_ControlVariable.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'component': obj_ = POCP_MT090100UV_Component2.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component' elif nodeName_ == 'subjectOf': obj_ = POCP_MT090100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT090100UV_ProcessStep
[docs]class POCP_MT090100UV_ReferenceRange(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='REFV', realmCode=None, typeId=None, templateId=None, observationCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observationCriterion = observationCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_ReferenceRange) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_ReferenceRange.subclass: return POCP_MT090100UV_ReferenceRange.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_ReferenceRange(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observationCriterion(self): return self.observationCriterion
[docs] def set_observationCriterion(self, observationCriterion): self.observationCriterion = observationCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasReferenceValues(self, value): # Validate type ActRelationshipHasReferenceValues, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['REFV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasReferenceValues' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasReferenceValues_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasReferenceValues_patterns_, ))
validate_ActRelationshipHasReferenceValues_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observationCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ReferenceRange', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.ReferenceRange') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.ReferenceRange', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.ReferenceRange'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "REFV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.ReferenceRange', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observationCriterion is not None: self.observationCriterion.export(outfile, level, namespace_, name_='observationCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasReferenceValues(self.typeCode) # validate type ActRelationshipHasReferenceValues
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observationCriterion': obj_ = POCP_MT090100UV_ObservationCriterion.factory() obj_.build(child_) self.observationCriterion = obj_ obj_.original_tagname_ = 'observationCriterion'
# end class POCP_MT090100UV_ReferenceRange
[docs]class POCP_MT090100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Subject.subclass: return POCP_MT090100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT090100UV_Subject
[docs]class POCP_MT090100UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Subject2.subclass: return POCP_MT090100UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT090100UV_Subject2
[docs]class POCP_MT090100UV_Subject3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_Subject3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_Subject3.subclass: return POCP_MT090100UV_Subject3.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_Subject3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Subject3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.Subject3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.Subject3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.Subject3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.Subject3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT090100UV_Subject3
[docs]class POCP_MT090100UV_SubstanceSpecification(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, consumable=None, author=None, component=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if consumable is None: self.consumable = [] else: self.consumable = consumable if author is None: self.author = [] else: self.author = author if component is None: self.component = [] else: self.component = component if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT090100UV_SubstanceSpecification) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT090100UV_SubstanceSpecification.subclass: return POCP_MT090100UV_SubstanceSpecification.subclass(*args_, **kwargs_) else: return POCP_MT090100UV_SubstanceSpecification(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_consumable(self): return self.consumable
[docs] def set_consumable(self, consumable): self.consumable = consumable
[docs] def add_consumable(self, value): self.consumable.append(value)
[docs] def insert_consumable_at(self, index, value): self.consumable.insert(index, value)
[docs] def replace_consumable_at(self, index, value): self.consumable[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.consumable or self.author or self.component or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT090100UV.SubstanceSpecification', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT090100UV.SubstanceSpecification') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT090100UV.SubstanceSpecification', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT090100UV.SubstanceSpecification'): if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT090100UV.SubstanceSpecification', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for consumable_ in self.consumable: consumable_.export(outfile, level, namespace_, name_='consumable', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'consumable': obj_ = POCP_MT090100UV_Consumable.factory() obj_.build(child_) self.consumable.append(obj_) obj_.original_tagname_ = 'consumable' elif nodeName_ == 'author': obj_ = POCP_MT090100UV_Author.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'component': obj_ = POCP_MT090100UV_Component.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component' elif nodeName_ == 'subjectOf': obj_ = POCP_MT090100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT090100UV_SubstanceSpecification
[docs]class POCP_MT050600UV_Action(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, reasonCode=None, author=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime if reasonCode is None: self.reasonCode = [] else: self.reasonCode = reasonCode self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050600UV_Action) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050600UV_Action.subclass: return POCP_MT050600UV_Action.subclass(*args_, **kwargs_) else: return POCP_MT050600UV_Action(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_reasonCode(self): return self.reasonCode
[docs] def set_reasonCode(self, reasonCode): self.reasonCode = reasonCode
[docs] def add_reasonCode(self, value): self.reasonCode.append(value)
[docs] def insert_reasonCode_at(self, index, value): self.reasonCode.insert(index, value)
[docs] def replace_reasonCode_at(self, index, value): self.reasonCode[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.effectiveTime is not None or self.reasonCode or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Action', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050600UV.Action') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050600UV.Action', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050600UV.Action'): if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Action', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for reasonCode_ in self.reasonCode: reasonCode_.export(outfile, level, namespace_, name_='reasonCode', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'reasonCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.reasonCode.append(obj_) obj_.original_tagname_ = 'reasonCode' elif nodeName_ == 'author': obj_ = POCP_MT050600UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050600UV_Action
[docs]class POCP_MT050600UV_Analyte(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ALY', realmCode=None, typeId=None, templateId=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050600UV_Analyte) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050600UV_Analyte.subclass: return POCP_MT050600UV_Analyte.subclass(*args_, **kwargs_) else: return POCP_MT050600UV_Analyte(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAnalyte(self, value): # Validate type ParticipationAnalyte, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAnalyte' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAnalyte_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAnalyte_patterns_, ))
validate_ParticipationAnalyte_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Analyte', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050600UV.Analyte') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050600UV.Analyte', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050600UV.Analyte'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ALY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Analyte', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAnalyte(self.typeCode) # validate type ParticipationAnalyte
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050600UV_Analyte
[docs]class POCP_MT050600UV_Author1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050600UV_Author1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050600UV_Author1.subclass: return POCP_MT050600UV_Author1.subclass(*args_, **kwargs_) else: return POCP_MT050600UV_Author1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Author1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050600UV.Author1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050600UV.Author1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050600UV.Author1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Author1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT050600UV_Author1
[docs]class POCP_MT050600UV_Characteristic(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='OBS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, value=None, methodCode=None, analyte=None, author=None, interactor=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime self.value = value if methodCode is None: self.methodCode = [] else: self.methodCode = methodCode self.analyte = analyte self.author = author if interactor is None: self.interactor = [] else: self.interactor = interactor if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050600UV_Characteristic) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050600UV_Characteristic.subclass: return POCP_MT050600UV_Characteristic.subclass(*args_, **kwargs_) else: return POCP_MT050600UV_Characteristic(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def add_methodCode(self, value): self.methodCode.append(value)
[docs] def insert_methodCode_at(self, index, value): self.methodCode.insert(index, value)
[docs] def replace_methodCode_at(self, index, value): self.methodCode[index] = value
[docs] def get_analyte(self): return self.analyte
[docs] def set_analyte(self, analyte): self.analyte = analyte
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.value is not None or self.methodCode or self.analyte is not None or self.author is not None or self.interactor or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Characteristic', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050600UV.Characteristic') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050600UV.Characteristic', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050600UV.Characteristic'): if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Characteristic', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for methodCode_ in self.methodCode: methodCode_.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) if self.analyte is not None: self.analyte.export(outfile, level, namespace_, name_='analyte', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode.append(obj_) obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'analyte': obj_ = POCP_MT050600UV_Analyte.factory() obj_.build(child_) self.analyte = obj_ obj_.original_tagname_ = 'analyte' elif nodeName_ == 'author': obj_ = POCP_MT050600UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'interactor': obj_ = POCP_MT050600UV_Interactor.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050600UV_Characteristic
[docs]class POCP_MT050600UV_Document(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='DOC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, title=None, text=None, effectiveTime=None, confidentialityCode=None, languageCode=None, setId=None, versionNumber=None, bibliographicDesignationText=None, author=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.title = title self.text = text self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.languageCode = languageCode self.setId = setId self.versionNumber = versionNumber self.bibliographicDesignationText = bibliographicDesignationText self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050600UV_Document) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050600UV_Document.subclass: return POCP_MT050600UV_Document.subclass(*args_, **kwargs_) else: return POCP_MT050600UV_Document(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_languageCode(self): return self.languageCode
[docs] def set_languageCode(self, languageCode): self.languageCode = languageCode
[docs] def get_setId(self): return self.setId
[docs] def set_setId(self, setId): self.setId = setId
[docs] def get_versionNumber(self): return self.versionNumber
[docs] def set_versionNumber(self, versionNumber): self.versionNumber = versionNumber
[docs] def get_bibliographicDesignationText(self): return self.bibliographicDesignationText
[docs] def set_bibliographicDesignationText(self, bibliographicDesignationText): self.bibliographicDesignationText = bibliographicDesignationText
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassDocument(self, value): # Validate type ActClassDocument, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOC', 'DOCCLIN', 'CDALVLONE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocument' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocument_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocument_patterns_, ))
validate_ActClassDocument_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.title is not None or self.text is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.languageCode is not None or self.setId is not None or self.versionNumber is not None or self.bibliographicDesignationText is not None or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Document', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050600UV.Document') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050600UV.Document', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050600UV.Document'): if self.classCode != "DOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Document', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.languageCode is not None: self.languageCode.export(outfile, level, namespace_, name_='languageCode', pretty_print=pretty_print) if self.setId is not None: self.setId.export(outfile, level, namespace_, name_='setId', pretty_print=pretty_print) if self.versionNumber is not None: self.versionNumber.export(outfile, level, namespace_, name_='versionNumber', pretty_print=pretty_print) if self.bibliographicDesignationText is not None: self.bibliographicDesignationText.export(outfile, level, namespace_, name_='bibliographicDesignationText', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocument(self.classCode) # validate type ActClassDocument value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': obj_ = ED.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'languageCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.languageCode = obj_ obj_.original_tagname_ = 'languageCode' elif nodeName_ == 'setId': obj_ = II.factory() obj_.build(child_) self.setId = obj_ obj_.original_tagname_ = 'setId' elif nodeName_ == 'versionNumber': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.versionNumber = obj_ obj_.original_tagname_ = 'versionNumber' elif nodeName_ == 'bibliographicDesignationText': obj_ = ED.factory() obj_.build(child_) self.bibliographicDesignationText = obj_ obj_.original_tagname_ = 'bibliographicDesignationText' elif nodeName_ == 'author': obj_ = POCP_MT050600UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050600UV_Document
[docs]class POCP_MT050600UV_Interactor(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050600UV_Interactor) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050600UV_Interactor.subclass: return POCP_MT050600UV_Interactor.subclass(*args_, **kwargs_) else: return POCP_MT050600UV_Interactor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Interactor', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050600UV.Interactor') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050600UV.Interactor', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050600UV.Interactor'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Interactor', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050600UV_Interactor
[docs]class POCP_MT050600UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050600UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050600UV_Subject.subclass: return POCP_MT050600UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT050600UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050600UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050600UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050600UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050600UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT050600UV_Subject
[docs]class POCP_MT080300UV_Bond(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='BOND', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, positionNumber=None, distalMoiety=None, subjectOf=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity if positionNumber is None: self.positionNumber = [] else: self.positionNumber = positionNumber self.distalMoiety = distalMoiety if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Bond) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Bond.subclass: return POCP_MT080300UV_Bond.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Bond(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_positionNumber(self): return self.positionNumber
[docs] def set_positionNumber(self, positionNumber): self.positionNumber = positionNumber
[docs] def add_positionNumber(self, value): self.positionNumber.append(value)
[docs] def insert_positionNumber_at(self, index, value): self.positionNumber.insert(index, value)
[docs] def replace_positionNumber_at(self, index, value): self.positionNumber[index] = value
[docs] def get_distalMoiety(self): return self.distalMoiety
[docs] def set_distalMoiety(self, distalMoiety): self.distalMoiety = distalMoiety
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassMolecularBond(self, value): # Validate type RoleClassMolecularBond, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['BOND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassMolecularBond' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassMolecularBond_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassMolecularBond_patterns_, ))
validate_RoleClassMolecularBond_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.positionNumber or self.distalMoiety is not None or self.subjectOf or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Bond', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Bond') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Bond', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Bond'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "BOND" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Bond', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) for positionNumber_ in self.positionNumber: positionNumber_.export(outfile, level, namespace_, name_='positionNumber', pretty_print=pretty_print) if self.distalMoiety is not None: self.distalMoiety.export(outfile, level, namespace_, name_='distalMoiety', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassMolecularBond(self.classCode) # validate type RoleClassMolecularBond
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'positionNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.positionNumber.append(obj_) obj_.original_tagname_ = 'positionNumber' elif nodeName_ == 'distalMoiety': obj_ = POCP_MT080300UV_Moiety1.factory() obj_.build(child_) self.distalMoiety = obj_ obj_.original_tagname_ = 'distalMoiety' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT080300UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT080300UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT080300UV_Bond
[docs]class POCP_MT080300UV_Component(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, splitCode=None, joinCode=None, derivationProcess=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.splitCode = splitCode self.joinCode = joinCode self.derivationProcess = derivationProcess
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Component) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Component.subclass: return POCP_MT080300UV_Component.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_splitCode(self): return self.splitCode
[docs] def set_splitCode(self, splitCode): self.splitCode = splitCode
[docs] def get_joinCode(self): return self.joinCode
[docs] def set_joinCode(self, joinCode): self.joinCode = joinCode
[docs] def get_derivationProcess(self): return self.derivationProcess
[docs] def set_derivationProcess(self, derivationProcess): self.derivationProcess = derivationProcess
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.splitCode is not None or self.joinCode is not None or self.derivationProcess is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Component', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Component') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Component', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Component'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Component', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.splitCode is not None: self.splitCode.export(outfile, level, namespace_, name_='splitCode', pretty_print=pretty_print) if self.joinCode is not None: self.joinCode.export(outfile, level, namespace_, name_='joinCode', pretty_print=pretty_print) if self.derivationProcess is not None: self.derivationProcess.export(outfile, level, namespace_, name_='derivationProcess', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'splitCode': obj_ = CS.factory() obj_.build(child_) self.splitCode = obj_ obj_.original_tagname_ = 'splitCode' elif nodeName_ == 'joinCode': obj_ = CS.factory() obj_.build(child_) self.joinCode = obj_ obj_.original_tagname_ = 'joinCode' elif nodeName_ == 'derivationProcess': obj_ = POCP_MT080300UV_DerivationProcess.factory() obj_.build(child_) self.derivationProcess = obj_ obj_.original_tagname_ = 'derivationProcess'
# end class POCP_MT080300UV_Component
[docs]class POCP_MT080300UV_ControlVariable(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CTRLV', realmCode=None, typeId=None, templateId=None, characteristic=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.characteristic = characteristic
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_ControlVariable) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_ControlVariable.subclass: return POCP_MT080300UV_ControlVariable.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_ControlVariable(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasControlVariable(self, value): # Validate type ActRelationshipHasControlVariable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CTRLV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasControlVariable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasControlVariable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasControlVariable_patterns_, ))
validate_ActRelationshipHasControlVariable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.characteristic is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.ControlVariable', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.ControlVariable') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.ControlVariable', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.ControlVariable'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CTRLV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.ControlVariable', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasControlVariable(self.typeCode) # validate type ActRelationshipHasControlVariable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'characteristic': obj_ = POCP_MT050500UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic'
# end class POCP_MT080300UV_ControlVariable
[docs]class POCP_MT080300UV_DerivationProcess(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, effectiveTime=None, interactor=None, generalization=None, controlVariable=None, component=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.effectiveTime = effectiveTime if interactor is None: self.interactor = [] else: self.interactor = interactor if generalization is None: self.generalization = [] else: self.generalization = generalization if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if component is None: self.component = [] else: self.component = component if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_DerivationProcess) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_DerivationProcess.subclass: return POCP_MT080300UV_DerivationProcess.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_DerivationProcess(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_generalization(self): return self.generalization
[docs] def set_generalization(self, generalization): self.generalization = generalization
[docs] def add_generalization(self, value): self.generalization.append(value)
[docs] def insert_generalization_at(self, index, value): self.generalization.insert(index, value)
[docs] def replace_generalization_at(self, index, value): self.generalization[index] = value
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.effectiveTime is not None or self.interactor or self.generalization or self.controlVariable or self.component or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.DerivationProcess', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.DerivationProcess') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.DerivationProcess', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.DerivationProcess'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.DerivationProcess', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for generalization_ in self.generalization: generalization_.export(outfile, level, namespace_, name_='generalization', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'interactor': obj_ = POCP_MT080300UV_Interactor2.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'generalization': obj_ = POCP_MT080300UV_Generalization1.factory() obj_.build(child_) self.generalization.append(obj_) obj_.original_tagname_ = 'generalization' elif nodeName_ == 'controlVariable': obj_ = POCP_MT080300UV_ControlVariable.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'component': obj_ = POCP_MT080300UV_Component.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT080300UV_DerivationProcess
[docs]class POCP_MT080300UV_EquivalentSubstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='EQUIV', realmCode=None, typeId=None, templateId=None, code=None, statusCode=None, effectiveTime=None, definingSubstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime self.definingSubstance = definingSubstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_EquivalentSubstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_EquivalentSubstance.subclass: return POCP_MT080300UV_EquivalentSubstance.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_EquivalentSubstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_definingSubstance(self): return self.definingSubstance
[docs] def set_definingSubstance(self, definingSubstance): self.definingSubstance = definingSubstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassEquivalentEntity(self, value): # Validate type RoleClassEquivalentEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EQUIV', 'SAME', 'SUBY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassEquivalentEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassEquivalentEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassEquivalentEntity_patterns_, ))
validate_RoleClassEquivalentEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.statusCode is not None or self.effectiveTime is not None or self.definingSubstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.EquivalentSubstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.EquivalentSubstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.EquivalentSubstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.EquivalentSubstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "EQUIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.EquivalentSubstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.definingSubstance is not None: self.definingSubstance.export(outfile, level, namespace_, name_='definingSubstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassEquivalentEntity(self.classCode) # validate type RoleClassEquivalentEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'definingSubstance': obj_ = POCP_MT080300UV_Substance.factory() obj_.build(child_) self.definingSubstance = obj_ obj_.original_tagname_ = 'definingSubstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT080300UV_EquivalentSubstance
[docs]class POCP_MT080300UV_Generalization1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='GEN', realmCode=None, typeId=None, templateId=None, derivationProcess=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.derivationProcess = derivationProcess
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Generalization1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Generalization1.subclass: return POCP_MT080300UV_Generalization1.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Generalization1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_derivationProcess(self): return self.derivationProcess
[docs] def set_derivationProcess(self, derivationProcess): self.derivationProcess = derivationProcess
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasGeneralization(self, value): # Validate type ActRelationshipHasGeneralization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasGeneralization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasGeneralization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasGeneralization_patterns_, ))
validate_ActRelationshipHasGeneralization_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.derivationProcess is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Generalization1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Generalization1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Generalization1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Generalization1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "GEN" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Generalization1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.derivationProcess is not None: self.derivationProcess.export(outfile, level, namespace_, name_='derivationProcess', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasGeneralization(self.typeCode) # validate type ActRelationshipHasGeneralization
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'derivationProcess': obj_ = POCP_MT080300UV_DerivationProcess.factory() obj_.build(child_) self.derivationProcess = obj_ obj_.original_tagname_ = 'derivationProcess'
# end class POCP_MT080300UV_Generalization1
[docs]class POCP_MT080300UV_Generalization2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='GEN', realmCode=None, typeId=None, templateId=None, interaction=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.interaction = interaction
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Generalization2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Generalization2.subclass: return POCP_MT080300UV_Generalization2.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Generalization2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_interaction(self): return self.interaction
[docs] def set_interaction(self, interaction): self.interaction = interaction
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasGeneralization(self, value): # Validate type ActRelationshipHasGeneralization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasGeneralization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasGeneralization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasGeneralization_patterns_, ))
validate_ActRelationshipHasGeneralization_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.interaction is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Generalization2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Generalization2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Generalization2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Generalization2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "GEN" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Generalization2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.interaction is not None: self.interaction.export(outfile, level, namespace_, name_='interaction', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasGeneralization(self.typeCode) # validate type ActRelationshipHasGeneralization
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'interaction': obj_ = POCP_MT080300UV_Interaction.factory() obj_.build(child_) self.interaction = obj_ obj_.original_tagname_ = 'interaction'
# end class POCP_MT080300UV_Generalization2
[docs]class POCP_MT080300UV_IdentifiedSubstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, id=None, code=None, statusCode=None, effectiveTime=None, confidentialityCode=None, identifiedSubstance=None, assigningTerritory=None, assigningOrganization=None, subjectOf=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.identifiedSubstance = identifiedSubstance self.assigningTerritory = assigningTerritory self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_IdentifiedSubstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_IdentifiedSubstance.subclass: return POCP_MT080300UV_IdentifiedSubstance.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_IdentifiedSubstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_assigningTerritory(self): return self.assigningTerritory
[docs] def set_assigningTerritory(self, assigningTerritory): self.assigningTerritory = assigningTerritory
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.statusCode is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.identifiedSubstance is not None or self.assigningTerritory is not None or self.assigningOrganization is not None or self.subjectOf or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.IdentifiedSubstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.IdentifiedSubstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.IdentifiedSubstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.IdentifiedSubstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.IdentifiedSubstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.assigningTerritory is not None: self.assigningTerritory.export(outfile, level, namespace_, name_='assigningTerritory', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_Substance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'assigningTerritory': obj_ = POCP_MT080300UV_Territory.factory() obj_.build(child_) self.assigningTerritory = obj_ obj_.original_tagname_ = 'assigningTerritory' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT080300UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT080300UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT080300UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT080300UV_IdentifiedSubstance
[docs]class POCP_MT080300UV_Ingredient(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='INGR', realmCode=None, typeId=None, templateId=None, id=None, confidentialityCode=None, quantity=None, ingredientSubstance=None, ingredientOfProduct=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.confidentialityCode = confidentialityCode self.quantity = quantity self.ingredientSubstance = ingredientSubstance self.ingredientOfProduct = ingredientOfProduct if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Ingredient) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Ingredient.subclass: return POCP_MT080300UV_Ingredient.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Ingredient(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_ingredientSubstance(self): return self.ingredientSubstance
[docs] def set_ingredientSubstance(self, ingredientSubstance): self.ingredientSubstance = ingredientSubstance
[docs] def get_ingredientOfProduct(self): return self.ingredientOfProduct
[docs] def set_ingredientOfProduct(self, ingredientOfProduct): self.ingredientOfProduct = ingredientOfProduct
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassIngredientEntity(self, value): # Validate type RoleClassIngredientEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIngredientEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIngredientEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIngredientEntity_patterns_, ))
validate_RoleClassIngredientEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.confidentialityCode is not None or self.quantity is not None or self.ingredientSubstance is not None or self.ingredientOfProduct is not None or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Ingredient', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Ingredient') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Ingredient', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Ingredient'): if self.classCode != "INGR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Ingredient', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.ingredientSubstance is not None: self.ingredientSubstance.export(outfile, level, namespace_, name_='ingredientSubstance', pretty_print=pretty_print) if self.ingredientOfProduct is not None: self.ingredientOfProduct.export(outfile, level, namespace_, name_='ingredientOfProduct', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIngredientEntity(self.classCode) # validate type RoleClassIngredientEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'ingredientSubstance': obj_ = POCP_MT080300UV_Substance.factory() obj_.build(child_) self.ingredientSubstance = obj_ obj_.original_tagname_ = 'ingredientSubstance' elif nodeName_ == 'ingredientOfProduct': obj_ = POCP_MT010200UV_Product.factory() obj_.build(child_) self.ingredientOfProduct = obj_ obj_.original_tagname_ = 'ingredientOfProduct' elif nodeName_ == 'productOf': obj_ = POCP_MT080300UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT080300UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT080300UV_Ingredient
[docs]class POCP_MT080300UV_Interaction(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, interactor=None, generalization=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if interactor is None: self.interactor = [] else: self.interactor = interactor if generalization is None: self.generalization = [] else: self.generalization = generalization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Interaction) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Interaction.subclass: return POCP_MT080300UV_Interaction.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Interaction(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_generalization(self): return self.generalization
[docs] def set_generalization(self, generalization): self.generalization = generalization
[docs] def add_generalization(self, value): self.generalization.append(value)
[docs] def insert_generalization_at(self, index, value): self.generalization.insert(index, value)
[docs] def replace_generalization_at(self, index, value): self.generalization[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.interactor or self.generalization or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interaction', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Interaction') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Interaction', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Interaction'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interaction', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for generalization_ in self.generalization: generalization_.export(outfile, level, namespace_, name_='generalization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'interactor': obj_ = POCP_MT080300UV_Interactor.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'generalization': obj_ = POCP_MT080300UV_Generalization2.factory() obj_.build(child_) self.generalization.append(obj_) obj_.original_tagname_ = 'generalization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT080300UV_Interaction
[docs]class POCP_MT080300UV_Interactor(GeneratedsSuper): subclass = None superclass = None def __init__(self, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, presentSubstance=None): self.original_tagname_ = None self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Interactor) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Interactor.subclass: return POCP_MT080300UV_Interactor.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Interactor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interactor', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Interactor') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Interactor', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Interactor'): if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interactor', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT080300UV_Interactor
[docs]class POCP_MT080300UV_Interactor2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Interactor2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Interactor2.subclass: return POCP_MT080300UV_Interactor2.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Interactor2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interactor2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Interactor2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Interactor2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Interactor2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interactor2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT080300UV_Interactor2
[docs]class POCP_MT080300UV_Interactor3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, interaction=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.interaction = interaction
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Interactor3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Interactor3.subclass: return POCP_MT080300UV_Interactor3.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Interactor3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_interaction(self): return self.interaction
[docs] def set_interaction(self, interaction): self.interaction = interaction
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.interaction is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interactor3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Interactor3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Interactor3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Interactor3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Interactor3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.interaction is not None: self.interaction.export(outfile, level, namespace_, name_='interaction', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'interaction': obj_ = POCP_MT080300UV_Interaction.factory() obj_.build(child_) self.interaction = obj_ obj_.original_tagname_ = 'interaction'
# end class POCP_MT080300UV_Interactor3
[docs]class POCP_MT080300UV_Moiety(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='PART', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, positionNumber=None, partMoiety=None, wholeSubstance=None, subjectOf=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity if positionNumber is None: self.positionNumber = [] else: self.positionNumber = positionNumber self.partMoiety = partMoiety self.wholeSubstance = wholeSubstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Moiety) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Moiety.subclass: return POCP_MT080300UV_Moiety.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Moiety(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_positionNumber(self): return self.positionNumber
[docs] def set_positionNumber(self, positionNumber): self.positionNumber = positionNumber
[docs] def add_positionNumber(self, value): self.positionNumber.append(value)
[docs] def insert_positionNumber_at(self, index, value): self.positionNumber.insert(index, value)
[docs] def replace_positionNumber_at(self, index, value): self.positionNumber[index] = value
[docs] def get_partMoiety(self): return self.partMoiety
[docs] def set_partMoiety(self, partMoiety): self.partMoiety = partMoiety
[docs] def get_wholeSubstance(self): return self.wholeSubstance
[docs] def set_wholeSubstance(self, wholeSubstance): self.wholeSubstance = wholeSubstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.positionNumber or self.partMoiety is not None or self.wholeSubstance is not None or self.subjectOf or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Moiety', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Moiety') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Moiety', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Moiety'): if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Moiety', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) for positionNumber_ in self.positionNumber: positionNumber_.export(outfile, level, namespace_, name_='positionNumber', pretty_print=pretty_print) if self.partMoiety is not None: self.partMoiety.export(outfile, level, namespace_, name_='partMoiety', pretty_print=pretty_print) if self.wholeSubstance is not None: self.wholeSubstance.export(outfile, level, namespace_, name_='wholeSubstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'positionNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.positionNumber.append(obj_) obj_.original_tagname_ = 'positionNumber' elif nodeName_ == 'partMoiety': obj_ = POCP_MT080300UV_Moiety1.factory() obj_.build(child_) self.partMoiety = obj_ obj_.original_tagname_ = 'partMoiety' elif nodeName_ == 'wholeSubstance': obj_ = POCP_MT080300UV_Substance.factory() obj_.build(child_) self.wholeSubstance = obj_ obj_.original_tagname_ = 'wholeSubstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT080300UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT080300UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT080300UV_Moiety
[docs]class POCP_MT080300UV_Moiety1(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, id=None, code=None, name=None, asSpecializedKind=None, bond=None, moiety=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code if name is None: self.name = [] else: self.name = name if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind if bond is None: self.bond = [] else: self.bond = bond if moiety is None: self.moiety = [] else: self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Moiety1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Moiety1.subclass: return POCP_MT080300UV_Moiety1.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Moiety1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_bond(self): return self.bond
[docs] def set_bond(self, bond): self.bond = bond
[docs] def add_bond(self, value): self.bond.append(value)
[docs] def insert_bond_at(self, index, value): self.bond.insert(index, value)
[docs] def replace_bond_at(self, index, value): self.bond[index] = value
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def add_moiety(self, value): self.moiety.append(value)
[docs] def insert_moiety_at(self, index, value): self.moiety.insert(index, value)
[docs] def replace_moiety_at(self, index, value): self.moiety[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.name or self.asSpecializedKind or self.bond or self.moiety ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Moiety1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Moiety1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Moiety1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Moiety1'): if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Moiety1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) for bond_ in self.bond: bond_.export(outfile, level, namespace_, name_='bond', pretty_print=pretty_print) for moiety_ in self.moiety: moiety_.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010300UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'bond': obj_ = POCP_MT080300UV_Bond.factory() obj_.build(child_) self.bond.append(obj_) obj_.original_tagname_ = 'bond' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety2.factory() obj_.build(child_) self.moiety.append(obj_) obj_.original_tagname_ = 'moiety'
# end class POCP_MT080300UV_Moiety1
[docs]class POCP_MT080300UV_Moiety2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, positionNumber=None, partMoiety=None, subjectOf=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity if positionNumber is None: self.positionNumber = [] else: self.positionNumber = positionNumber self.partMoiety = partMoiety if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Moiety2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Moiety2.subclass: return POCP_MT080300UV_Moiety2.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Moiety2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_positionNumber(self): return self.positionNumber
[docs] def set_positionNumber(self, positionNumber): self.positionNumber = positionNumber
[docs] def add_positionNumber(self, value): self.positionNumber.append(value)
[docs] def insert_positionNumber_at(self, index, value): self.positionNumber.insert(index, value)
[docs] def replace_positionNumber_at(self, index, value): self.positionNumber[index] = value
[docs] def get_partMoiety(self): return self.partMoiety
[docs] def set_partMoiety(self, partMoiety): self.partMoiety = partMoiety
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.positionNumber or self.partMoiety is not None or self.subjectOf or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Moiety2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Moiety2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Moiety2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Moiety2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Moiety2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) for positionNumber_ in self.positionNumber: positionNumber_.export(outfile, level, namespace_, name_='positionNumber', pretty_print=pretty_print) if self.partMoiety is not None: self.partMoiety.export(outfile, level, namespace_, name_='partMoiety', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'positionNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.positionNumber.append(obj_) obj_.original_tagname_ = 'positionNumber' elif nodeName_ == 'partMoiety': obj_ = POCP_MT080300UV_Moiety1.factory() obj_.build(child_) self.partMoiety = obj_ obj_.original_tagname_ = 'partMoiety' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT080300UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT080300UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT080300UV_Moiety2
[docs]class POCP_MT080300UV_NamedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, code=None, name=None, statusCode=None, effectiveTime=None, assigningTerritory=None, assigningOrganization=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.statusCode = statusCode self.effectiveTime = effectiveTime self.assigningTerritory = assigningTerritory self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_NamedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_NamedEntity.subclass: return POCP_MT080300UV_NamedEntity.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_NamedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_assigningTerritory(self): return self.assigningTerritory
[docs] def set_assigningTerritory(self, assigningTerritory): self.assigningTerritory = assigningTerritory
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.statusCode is not None or self.effectiveTime is not None or self.assigningTerritory is not None or self.assigningOrganization is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.NamedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.NamedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.NamedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.NamedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.NamedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.assigningTerritory is not None: self.assigningTerritory.export(outfile, level, namespace_, name_='assigningTerritory', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'assigningTerritory': obj_ = POCP_MT080300UV_Territory.factory() obj_.build(child_) self.assigningTerritory = obj_ obj_.original_tagname_ = 'assigningTerritory' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT080300UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT080300UV_NamedEntity
[docs]class POCP_MT080300UV_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, territorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.name = name if territorialAuthority is None: self.territorialAuthority = [] else: self.territorialAuthority = territorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Organization.subclass: return POCP_MT080300UV_Organization.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_territorialAuthority(self): return self.territorialAuthority
[docs] def set_territorialAuthority(self, territorialAuthority): self.territorialAuthority = territorialAuthority
[docs] def add_territorialAuthority(self, value): self.territorialAuthority.append(value)
[docs] def insert_territorialAuthority_at(self, index, value): self.territorialAuthority.insert(index, value)
[docs] def replace_territorialAuthority_at(self, index, value): self.territorialAuthority[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.name is not None or self.territorialAuthority ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Organization'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for territorialAuthority_ in self.territorialAuthority: territorialAuthority_.export(outfile, level, namespace_, name_='territorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'territorialAuthority': obj_ = POCP_MT080300UV_TerritorialAuthority.factory() obj_.build(child_) self.territorialAuthority.append(obj_) obj_.original_tagname_ = 'territorialAuthority'
# end class POCP_MT080300UV_Organization
[docs]class POCP_MT080300UV_Policy(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='POLICY', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, statusCode=None, effectiveTime=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Policy) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Policy.subclass: return POCP_MT080300UV_Policy.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Policy(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassPolicy(self, value): # Validate type ActClassPolicy, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEADrugSchedule', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPolicy' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPolicy_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPolicy_patterns_, ))
validate_ActClassPolicy_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.statusCode is not None or self.effectiveTime is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Policy', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Policy') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Policy', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Policy'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "POLICY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Policy', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPolicy(self.classCode) # validate type ActClassPolicy value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime'
# end class POCP_MT080300UV_Policy
[docs]class POCP_MT080300UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, derivationProcess=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.derivationProcess = derivationProcess
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Product.subclass: return POCP_MT080300UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_derivationProcess(self): return self.derivationProcess
[docs] def set_derivationProcess(self, derivationProcess): self.derivationProcess = derivationProcess
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.derivationProcess is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.derivationProcess is not None: self.derivationProcess.export(outfile, level, namespace_, name_='derivationProcess', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'derivationProcess': obj_ = POCP_MT080300UV_DerivationProcess.factory() obj_.build(child_) self.derivationProcess = obj_ obj_.original_tagname_ = 'derivationProcess'
# end class POCP_MT080300UV_Product
[docs]class POCP_MT080300UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, policy=None, substanceSpecification=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.policy = policy self.substanceSpecification = substanceSpecification self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Subject.subclass: return POCP_MT080300UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.policy is not None or self.substanceSpecification is not None or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'policy': obj_ = POCP_MT080300UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT080300UV_Subject
[docs]class POCP_MT080300UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, policy=None, substanceSpecification=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.policy = policy self.substanceSpecification = substanceSpecification self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Subject2.subclass: return POCP_MT080300UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.policy is not None or self.substanceSpecification is not None or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'policy': obj_ = POCP_MT080300UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT080300UV_Subject2
[docs]class POCP_MT080300UV_Substance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, asNamedEntity=None, asEquivalentSubstance=None, asSpecializedKind=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if asEquivalentSubstance is None: self.asEquivalentSubstance = [] else: self.asEquivalentSubstance = asEquivalentSubstance if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind if moiety is None: self.moiety = [] else: self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Substance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Substance.subclass: return POCP_MT080300UV_Substance.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Substance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_asEquivalentSubstance(self): return self.asEquivalentSubstance
[docs] def set_asEquivalentSubstance(self, asEquivalentSubstance): self.asEquivalentSubstance = asEquivalentSubstance
[docs] def add_asEquivalentSubstance(self, value): self.asEquivalentSubstance.append(value)
[docs] def insert_asEquivalentSubstance_at(self, index, value): self.asEquivalentSubstance.insert(index, value)
[docs] def replace_asEquivalentSubstance_at(self, index, value): self.asEquivalentSubstance[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def add_moiety(self, value): self.moiety.append(value)
[docs] def insert_moiety_at(self, index, value): self.moiety.insert(index, value)
[docs] def replace_moiety_at(self, index, value): self.moiety[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.asNamedEntity or self.asEquivalentSubstance or self.asSpecializedKind or self.moiety ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Substance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Substance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Substance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Substance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Substance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for asEquivalentSubstance_ in self.asEquivalentSubstance: asEquivalentSubstance_.export(outfile, level, namespace_, name_='asEquivalentSubstance', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) for moiety_ in self.moiety: moiety_.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT080300UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'asEquivalentSubstance': obj_ = POCP_MT080300UV_EquivalentSubstance.factory() obj_.build(child_) self.asEquivalentSubstance.append(obj_) obj_.original_tagname_ = 'asEquivalentSubstance' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010300UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety2.factory() obj_.build(child_) self.moiety.append(obj_) obj_.original_tagname_ = 'moiety'
# end class POCP_MT080300UV_Substance
[docs]class POCP_MT080300UV_TerritorialAuthority(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, territory=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.territory = territory
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_TerritorialAuthority) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_TerritorialAuthority.subclass: return POCP_MT080300UV_TerritorialAuthority.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_TerritorialAuthority(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_territory(self): return self.territory
[docs] def set_territory(self, territory): self.territory = territory
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.territory is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.TerritorialAuthority') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.territory is not None: self.territory.export(outfile, level, namespace_, name_='territory', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'territory': obj_ = POCP_MT080300UV_Territory.factory() obj_.build(child_) self.territory = obj_ obj_.original_tagname_ = 'territory'
# end class POCP_MT080300UV_TerritorialAuthority
[docs]class POCP_MT080300UV_TerritorialAuthority1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, governingOrganization=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.governingOrganization = governingOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_TerritorialAuthority1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_TerritorialAuthority1.subclass: return POCP_MT080300UV_TerritorialAuthority1.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_TerritorialAuthority1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_governingOrganization(self): return self.governingOrganization
[docs] def set_governingOrganization(self, governingOrganization): self.governingOrganization = governingOrganization
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.governingOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.TerritorialAuthority1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.TerritorialAuthority1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.governingOrganization is not None: self.governingOrganization.export(outfile, level, namespace_, name_='governingOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'governingOrganization': obj_ = POCP_MT080300UV_Organization.factory() obj_.build(child_) self.governingOrganization = obj_ obj_.original_tagname_ = 'governingOrganization'
# end class POCP_MT080300UV_TerritorialAuthority1
[docs]class POCP_MT080300UV_Territory(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='STATE', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, code=None, name=None, asTerritorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name if asTerritorialAuthority is None: self.asTerritorialAuthority = [] else: self.asTerritorialAuthority = asTerritorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080300UV_Territory) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080300UV_Territory.subclass: return POCP_MT080300UV_Territory.subclass(*args_, **kwargs_) else: return POCP_MT080300UV_Territory(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_asTerritorialAuthority(self): return self.asTerritorialAuthority
[docs] def set_asTerritorialAuthority(self, asTerritorialAuthority): self.asTerritorialAuthority = asTerritorialAuthority
[docs] def add_asTerritorialAuthority(self, value): self.asTerritorialAuthority.append(value)
[docs] def insert_asTerritorialAuthority_at(self, index, value): self.asTerritorialAuthority.insert(index, value)
[docs] def replace_asTerritorialAuthority_at(self, index, value): self.asTerritorialAuthority[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassState(self, value): # Validate type EntityClassState, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassState' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassState_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassState_patterns_, ))
validate_EntityClassState_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.asTerritorialAuthority ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Territory', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080300UV.Territory') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080300UV.Territory', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080300UV.Territory'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "STATE" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080300UV.Territory', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for asTerritorialAuthority_ in self.asTerritorialAuthority: asTerritorialAuthority_.export(outfile, level, namespace_, name_='asTerritorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassState(self.classCode) # validate type EntityClassState value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'asTerritorialAuthority': obj_ = POCP_MT080300UV_TerritorialAuthority1.factory() obj_.build(child_) self.asTerritorialAuthority.append(obj_) obj_.original_tagname_ = 'asTerritorialAuthority'
# end class POCP_MT080300UV_Territory
[docs]class POCP_MT010300UV_MaterialKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010300UV_MaterialKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010300UV_MaterialKind.subclass: return POCP_MT010300UV_MaterialKind.subclass(*args_, **kwargs_) else: return POCP_MT010300UV_MaterialKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassMaterial(self, value): # Validate type EntityClassMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MAT', 'CHEM', 'FOOD', 'MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassMaterial_patterns_, ))
validate_EntityClassMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010300UV.MaterialKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010300UV.MaterialKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010300UV.MaterialKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010300UV.MaterialKind'): if self.classCode != "MAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010300UV.MaterialKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassMaterial(self.classCode) # validate type EntityClassMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010300UV_MaterialKind
[docs]class POCP_MT010300UV_SpecializedKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='GEN', realmCode=None, typeId=None, templateId=None, code=None, generalizedMaterialKind=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.generalizedMaterialKind = generalizedMaterialKind if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010300UV_SpecializedKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010300UV_SpecializedKind.subclass: return POCP_MT010300UV_SpecializedKind.subclass(*args_, **kwargs_) else: return POCP_MT010300UV_SpecializedKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_generalizedMaterialKind(self): return self.generalizedMaterialKind
[docs] def set_generalizedMaterialKind(self, generalizedMaterialKind): self.generalizedMaterialKind = generalizedMaterialKind
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassIsSpeciesEntity(self, value): # Validate type RoleClassIsSpeciesEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN', 'GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIsSpeciesEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIsSpeciesEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIsSpeciesEntity_patterns_, ))
validate_RoleClassIsSpeciesEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.generalizedMaterialKind is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010300UV.SpecializedKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010300UV.SpecializedKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010300UV.SpecializedKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010300UV.SpecializedKind'): if self.classCode != "GEN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010300UV.SpecializedKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.generalizedMaterialKind is not None: self.generalizedMaterialKind.export(outfile, level, namespace_, name_='generalizedMaterialKind', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIsSpeciesEntity(self.classCode) # validate type RoleClassIsSpeciesEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'generalizedMaterialKind': obj_ = POCP_MT010300UV_MaterialKind.factory() obj_.build(child_) self.generalizedMaterialKind = obj_ obj_.original_tagname_ = 'generalizedMaterialKind' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT010300UV_SpecializedKind
[docs]class POCP_MT010300UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', negationInd='false', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None, approval=None, policy=None, marketingAct=None, monitoringProgram=None, storage=None, observationGoal=None, substanceSpecification=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.negationInd = _cast(None, negationInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action self.approval = approval self.policy = policy self.marketingAct = marketingAct self.monitoringProgram = monitoringProgram self.storage = storage self.observationGoal = observationGoal self.substanceSpecification = substanceSpecification
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010300UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010300UV_Subject.subclass: return POCP_MT010300UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT010300UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_marketingAct(self): return self.marketingAct
[docs] def set_marketingAct(self, marketingAct): self.marketingAct = marketingAct
[docs] def get_monitoringProgram(self): return self.monitoringProgram
[docs] def set_monitoringProgram(self, monitoringProgram): self.monitoringProgram = monitoringProgram
[docs] def get_storage(self): return self.storage
[docs] def set_storage(self, storage): self.storage = storage
[docs] def get_observationGoal(self): return self.observationGoal
[docs] def set_observationGoal(self, observationGoal): self.observationGoal = observationGoal
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_negationInd(self): return self.negationInd
[docs] def set_negationInd(self, negationInd): self.negationInd = negationInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None or self.approval is not None or self.policy is not None or self.marketingAct is not None or self.monitoringProgram is not None or self.storage is not None or self.observationGoal is not None or self.substanceSpecification is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010300UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010300UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010300UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010300UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.negationInd and 'negationInd' not in already_processed: already_processed.add('negationInd') outfile.write(' negationInd=%s' % (quote_attrib(self.negationInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010300UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.marketingAct is not None: self.marketingAct.export(outfile, level, namespace_, name_='marketingAct', pretty_print=pretty_print) if self.monitoringProgram is not None: self.monitoringProgram.export(outfile, level, namespace_, name_='monitoringProgram', pretty_print=pretty_print) if self.storage is not None: self.storage.export(outfile, level, namespace_, name_='storage', pretty_print=pretty_print) if self.observationGoal is not None: self.observationGoal.export(outfile, level, namespace_, name_='observationGoal', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject value = find_attr_value_('negationInd', node) if value is not None and 'negationInd' not in already_processed: already_processed.add('negationInd') if value in ('true', '1'): self.negationInd = True elif value in ('false', '0'): self.negationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.negationInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050100UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050100UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050100UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval' elif nodeName_ == 'policy': obj_ = POCP_MT050100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'marketingAct': obj_ = POCP_MT050100UV_MarketingAct.factory() obj_.build(child_) self.marketingAct = obj_ obj_.original_tagname_ = 'marketingAct' elif nodeName_ == 'monitoringProgram': obj_ = POCP_MT050100UV_MonitoringProgram.factory() obj_.build(child_) self.monitoringProgram = obj_ obj_.original_tagname_ = 'monitoringProgram' elif nodeName_ == 'storage': obj_ = POCP_MT050100UV_Storage.factory() obj_.build(child_) self.storage = obj_ obj_.original_tagname_ = 'storage' elif nodeName_ == 'observationGoal': obj_ = POCP_MT050100UV_ObservationGoal.factory() obj_.build(child_) self.observationGoal = obj_ obj_.original_tagname_ = 'observationGoal' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification'
# end class POCP_MT010300UV_Subject
[docs]class POCP_MT050100UV_Action(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, reasonCode=None, author=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime if reasonCode is None: self.reasonCode = [] else: self.reasonCode = reasonCode self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Action) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Action.subclass: return POCP_MT050100UV_Action.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Action(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_reasonCode(self): return self.reasonCode
[docs] def set_reasonCode(self, reasonCode): self.reasonCode = reasonCode
[docs] def add_reasonCode(self, value): self.reasonCode.append(value)
[docs] def insert_reasonCode_at(self, index, value): self.reasonCode.insert(index, value)
[docs] def replace_reasonCode_at(self, index, value): self.reasonCode[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.effectiveTime is not None or self.reasonCode or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Action', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Action') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Action', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Action'): if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Action', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for reasonCode_ in self.reasonCode: reasonCode_.export(outfile, level, namespace_, name_='reasonCode', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'reasonCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.reasonCode.append(obj_) obj_.original_tagname_ = 'reasonCode' elif nodeName_ == 'author': obj_ = POCP_MT050100UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_Action
[docs]class POCP_MT050100UV_Agency(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PUB', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, addr=None, contactParty=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.name = name self.addr = addr if contactParty is None: self.contactParty = [] else: self.contactParty = contactParty
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Agency) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Agency.subclass: return POCP_MT050100UV_Agency.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Agency(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_contactParty(self): return self.contactParty
[docs] def set_contactParty(self, contactParty): self.contactParty = contactParty
[docs] def add_contactParty(self, value): self.contactParty.append(value)
[docs] def insert_contactParty_at(self, index, value): self.contactParty.insert(index, value)
[docs] def replace_contactParty_at(self, index, value): self.contactParty[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassPublicInstitution(self, value): # Validate type EntityClassPublicInstitution, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PUB'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPublicInstitution' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPublicInstitution_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPublicInstitution_patterns_, ))
validate_EntityClassPublicInstitution_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.name is not None or self.addr is not None or self.contactParty ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Agency', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Agency') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Agency', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Agency'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PUB" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Agency', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for contactParty_ in self.contactParty: contactParty_.export(outfile, level, namespace_, name_='contactParty', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPublicInstitution(self.classCode) # validate type EntityClassPublicInstitution value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'contactParty': obj_ = POCP_MT050100UV_ContactParty.factory() obj_.build(child_) self.contactParty.append(obj_) obj_.original_tagname_ = 'contactParty'
# end class POCP_MT050100UV_Agency
[docs]class POCP_MT050100UV_Analyte(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ALY', realmCode=None, typeId=None, templateId=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Analyte) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Analyte.subclass: return POCP_MT050100UV_Analyte.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Analyte(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAnalyte(self, value): # Validate type ParticipationAnalyte, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAnalyte' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAnalyte_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAnalyte_patterns_, ))
validate_ParticipationAnalyte_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Analyte', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Analyte') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Analyte', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Analyte'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ALY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Analyte', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAnalyte(self.typeCode) # validate type ParticipationAnalyte
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050100UV_Analyte
[docs]class POCP_MT050100UV_Approval(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CNTRCT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, statusCode=None, effectiveTime=None, activityTime=None, availabilityTime=None, holder=None, author=None, pertinentInformation=None, outboundRelationship=None, subjectOf=None, inboundRelationship=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.statusCode = statusCode self.effectiveTime = effectiveTime self.activityTime = activityTime self.availabilityTime = availabilityTime if holder is None: self.holder = [] else: self.holder = holder if author is None: self.author = [] else: self.author = author if pertinentInformation is None: self.pertinentInformation = [] else: self.pertinentInformation = pertinentInformation if outboundRelationship is None: self.outboundRelationship = [] else: self.outboundRelationship = outboundRelationship if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if inboundRelationship is None: self.inboundRelationship = [] else: self.inboundRelationship = inboundRelationship
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Approval) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Approval.subclass: return POCP_MT050100UV_Approval.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Approval(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_activityTime(self): return self.activityTime
[docs] def set_activityTime(self, activityTime): self.activityTime = activityTime
[docs] def get_availabilityTime(self): return self.availabilityTime
[docs] def set_availabilityTime(self, availabilityTime): self.availabilityTime = availabilityTime
[docs] def get_holder(self): return self.holder
[docs] def set_holder(self, holder): self.holder = holder
[docs] def add_holder(self, value): self.holder.append(value)
[docs] def insert_holder_at(self, index, value): self.holder.insert(index, value)
[docs] def replace_holder_at(self, index, value): self.holder[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_pertinentInformation(self): return self.pertinentInformation
[docs] def set_pertinentInformation(self, pertinentInformation): self.pertinentInformation = pertinentInformation
[docs] def add_pertinentInformation(self, value): self.pertinentInformation.append(value)
[docs] def insert_pertinentInformation_at(self, index, value): self.pertinentInformation.insert(index, value)
[docs] def replace_pertinentInformation_at(self, index, value): self.pertinentInformation[index] = value
[docs] def get_outboundRelationship(self): return self.outboundRelationship
[docs] def set_outboundRelationship(self, outboundRelationship): self.outboundRelationship = outboundRelationship
[docs] def add_outboundRelationship(self, value): self.outboundRelationship.append(value)
[docs] def insert_outboundRelationship_at(self, index, value): self.outboundRelationship.insert(index, value)
[docs] def replace_outboundRelationship_at(self, index, value): self.outboundRelationship[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_inboundRelationship(self): return self.inboundRelationship
[docs] def set_inboundRelationship(self, inboundRelationship): self.inboundRelationship = inboundRelationship
[docs] def add_inboundRelationship(self, value): self.inboundRelationship.append(value)
[docs] def insert_inboundRelationship_at(self, index, value): self.inboundRelationship.insert(index, value)
[docs] def replace_inboundRelationship_at(self, index, value): self.inboundRelationship[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassContract(self, value): # Validate type ActClassContract, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CNTRCT', 'FCNTRCT', 'COV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassContract' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassContract_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassContract_patterns_, ))
validate_ActClassContract_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.statusCode is not None or self.effectiveTime is not None or self.activityTime is not None or self.availabilityTime is not None or self.holder or self.author or self.pertinentInformation or self.outboundRelationship or self.subjectOf or self.inboundRelationship ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Approval', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Approval') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Approval', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Approval'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CNTRCT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Approval', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.activityTime is not None: self.activityTime.export(outfile, level, namespace_, name_='activityTime', pretty_print=pretty_print) if self.availabilityTime is not None: self.availabilityTime.export(outfile, level, namespace_, name_='availabilityTime', pretty_print=pretty_print) for holder_ in self.holder: holder_.export(outfile, level, namespace_, name_='holder', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for pertinentInformation_ in self.pertinentInformation: pertinentInformation_.export(outfile, level, namespace_, name_='pertinentInformation', pretty_print=pretty_print) for outboundRelationship_ in self.outboundRelationship: outboundRelationship_.export(outfile, level, namespace_, name_='outboundRelationship', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for inboundRelationship_ in self.inboundRelationship: inboundRelationship_.export(outfile, level, namespace_, name_='inboundRelationship', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassContract(self.classCode) # validate type ActClassContract value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'activityTime': obj_ = IVL_TS.factory() obj_.build(child_) self.activityTime = obj_ obj_.original_tagname_ = 'activityTime' elif nodeName_ == 'availabilityTime': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.availabilityTime = obj_ obj_.original_tagname_ = 'availabilityTime' elif nodeName_ == 'holder': obj_ = POCP_MT050100UV_Holder.factory() obj_.build(child_) self.holder.append(obj_) obj_.original_tagname_ = 'holder' elif nodeName_ == 'author': obj_ = POCP_MT050100UV_Author2.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'pertinentInformation': obj_ = POCP_MT050100UV_PertinentInformation.factory() obj_.build(child_) self.pertinentInformation.append(obj_) obj_.original_tagname_ = 'pertinentInformation' elif nodeName_ == 'outboundRelationship': obj_ = POCP_MT050100UV_SourceOf.factory() obj_.build(child_) self.outboundRelationship.append(obj_) obj_.original_tagname_ = 'outboundRelationship' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'inboundRelationship': obj_ = POCP_MT050100UV_SourceOf2.factory() obj_.build(child_) self.inboundRelationship.append(obj_) obj_.original_tagname_ = 'inboundRelationship'
# end class POCP_MT050100UV_Approval
[docs]class POCP_MT050100UV_Author1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Author1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Author1.subclass: return POCP_MT050100UV_Author1.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Author1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Author1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Author1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Author1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Author1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Author1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT050100UV_Author1
[docs]class POCP_MT050100UV_Author2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, time=None, territorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.time = time self.territorialAuthority = territorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Author2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Author2.subclass: return POCP_MT050100UV_Author2.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Author2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_time(self): return self.time
[docs] def set_time(self, time): self.time = time
[docs] def get_territorialAuthority(self): return self.territorialAuthority
[docs] def set_territorialAuthority(self, territorialAuthority): self.territorialAuthority = territorialAuthority
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.time is not None or self.territorialAuthority is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Author2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Author2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Author2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Author2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Author2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.time is not None: self.time.export(outfile, level, namespace_, name_='time', pretty_print=pretty_print) if self.territorialAuthority is not None: self.territorialAuthority.export(outfile, level, namespace_, name_='territorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'time': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.time = obj_ obj_.original_tagname_ = 'time' elif nodeName_ == 'territorialAuthority': obj_ = POCP_MT050100UV_TerritorialAuthority.factory() obj_.build(child_) self.territorialAuthority = obj_ obj_.original_tagname_ = 'territorialAuthority'
# end class POCP_MT050100UV_Author2
[docs]class POCP_MT050100UV_Characteristic(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='OBS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, value=None, methodCode=None, analyte=None, author=None, interactor=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime self.value = value if methodCode is None: self.methodCode = [] else: self.methodCode = methodCode self.analyte = analyte self.author = author if interactor is None: self.interactor = [] else: self.interactor = interactor if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Characteristic) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Characteristic.subclass: return POCP_MT050100UV_Characteristic.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Characteristic(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def add_methodCode(self, value): self.methodCode.append(value)
[docs] def insert_methodCode_at(self, index, value): self.methodCode.insert(index, value)
[docs] def replace_methodCode_at(self, index, value): self.methodCode[index] = value
[docs] def get_analyte(self): return self.analyte
[docs] def set_analyte(self, analyte): self.analyte = analyte
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.value is not None or self.methodCode or self.analyte is not None or self.author is not None or self.interactor or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Characteristic', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Characteristic') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Characteristic', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Characteristic'): if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Characteristic', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for methodCode_ in self.methodCode: methodCode_.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) if self.analyte is not None: self.analyte.export(outfile, level, namespace_, name_='analyte', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode.append(obj_) obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'analyte': obj_ = POCP_MT050100UV_Analyte.factory() obj_.build(child_) self.analyte = obj_ obj_.original_tagname_ = 'analyte' elif nodeName_ == 'author': obj_ = POCP_MT050100UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'interactor': obj_ = POCP_MT050100UV_Interactor.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_Characteristic
[docs]class POCP_MT050100UV_ContactParty(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CON', realmCode=None, typeId=None, templateId=None, code=None, name=None, addr=None, telecom=None, confidentialityCode=None, contactPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.confidentialityCode = confidentialityCode self.contactPerson = contactPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_ContactParty) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_ContactParty.subclass: return POCP_MT050100UV_ContactParty.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_ContactParty(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_contactPerson(self): return self.contactPerson
[docs] def set_contactPerson(self, contactPerson): self.contactPerson = contactPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContact(self, value): # Validate type RoleClassContact, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CON', 'ECON', 'NOK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContact' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContact_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContact_patterns_, ))
validate_RoleClassContact_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.addr is not None or self.telecom or self.confidentialityCode is not None or self.contactPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.ContactParty', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.ContactParty') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.ContactParty', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.ContactParty'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CON" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.ContactParty', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.contactPerson is not None: self.contactPerson.export(outfile, level, namespace_, name_='contactPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContact(self.classCode) # validate type RoleClassContact
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'contactPerson': obj_ = POCP_MT050100UV_Person.factory() obj_.build(child_) self.contactPerson = obj_ obj_.original_tagname_ = 'contactPerson'
# end class POCP_MT050100UV_ContactParty
[docs]class POCP_MT050100UV_ControlVariable(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CTRLV', realmCode=None, typeId=None, templateId=None, storageCondition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.storageCondition = storageCondition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_ControlVariable) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_ControlVariable.subclass: return POCP_MT050100UV_ControlVariable.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_ControlVariable(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_storageCondition(self): return self.storageCondition
[docs] def set_storageCondition(self, storageCondition): self.storageCondition = storageCondition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasControlVariable(self, value): # Validate type ActRelationshipHasControlVariable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CTRLV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasControlVariable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasControlVariable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasControlVariable_patterns_, ))
validate_ActRelationshipHasControlVariable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.storageCondition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.ControlVariable', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.ControlVariable') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.ControlVariable', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.ControlVariable'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CTRLV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.ControlVariable', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.storageCondition is not None: self.storageCondition.export(outfile, level, namespace_, name_='storageCondition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasControlVariable(self.typeCode) # validate type ActRelationshipHasControlVariable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'storageCondition': obj_ = POCP_MT050100UV_StorageCondition.factory() obj_.build(child_) self.storageCondition = obj_ obj_.original_tagname_ = 'storageCondition'
# end class POCP_MT050100UV_ControlVariable
[docs]class POCP_MT050100UV_Coverage(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COVBY', realmCode=None, typeId=None, templateId=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Coverage) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Coverage.subclass: return POCP_MT050100UV_Coverage.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Coverage(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipCoveredBy(self, value): # Validate type ActRelationshipCoveredBy, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COVBY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipCoveredBy' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipCoveredBy_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipCoveredBy_patterns_, ))
validate_ActRelationshipCoveredBy_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Coverage', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Coverage') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Coverage', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Coverage'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COVBY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Coverage', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipCoveredBy(self.typeCode) # validate type ActRelationshipCoveredBy
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT050100UV_Coverage
[docs]class POCP_MT050100UV_Custodian(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CST', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Custodian) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Custodian.subclass: return POCP_MT050100UV_Custodian.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Custodian(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationCustodian(self, value): # Validate type ParticipationCustodian, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CST'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationCustodian' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationCustodian_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationCustodian_patterns_, ))
validate_ParticipationCustodian_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Custodian', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Custodian') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Custodian', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Custodian'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CST" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Custodian', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationCustodian(self.typeCode) # validate type ParticipationCustodian
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT050100UV_Custodian
[docs]class POCP_MT050100UV_Document(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='DOC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, title=None, text=None, effectiveTime=None, confidentialityCode=None, languageCode=None, setId=None, versionNumber=None, bibliographicDesignationText=None, author=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.title = title self.text = text self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.languageCode = languageCode self.setId = setId self.versionNumber = versionNumber self.bibliographicDesignationText = bibliographicDesignationText self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Document) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Document.subclass: return POCP_MT050100UV_Document.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Document(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_languageCode(self): return self.languageCode
[docs] def set_languageCode(self, languageCode): self.languageCode = languageCode
[docs] def get_setId(self): return self.setId
[docs] def set_setId(self, setId): self.setId = setId
[docs] def get_versionNumber(self): return self.versionNumber
[docs] def set_versionNumber(self, versionNumber): self.versionNumber = versionNumber
[docs] def get_bibliographicDesignationText(self): return self.bibliographicDesignationText
[docs] def set_bibliographicDesignationText(self, bibliographicDesignationText): self.bibliographicDesignationText = bibliographicDesignationText
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassDocument(self, value): # Validate type ActClassDocument, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOC', 'DOCCLIN', 'CDALVLONE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocument' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocument_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocument_patterns_, ))
validate_ActClassDocument_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.title is not None or self.text is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.languageCode is not None or self.setId is not None or self.versionNumber is not None or self.bibliographicDesignationText is not None or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Document', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Document') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Document', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Document'): if self.classCode != "DOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Document', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.languageCode is not None: self.languageCode.export(outfile, level, namespace_, name_='languageCode', pretty_print=pretty_print) if self.setId is not None: self.setId.export(outfile, level, namespace_, name_='setId', pretty_print=pretty_print) if self.versionNumber is not None: self.versionNumber.export(outfile, level, namespace_, name_='versionNumber', pretty_print=pretty_print) if self.bibliographicDesignationText is not None: self.bibliographicDesignationText.export(outfile, level, namespace_, name_='bibliographicDesignationText', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocument(self.classCode) # validate type ActClassDocument value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': obj_ = ED.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'languageCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.languageCode = obj_ obj_.original_tagname_ = 'languageCode' elif nodeName_ == 'setId': obj_ = II.factory() obj_.build(child_) self.setId = obj_ obj_.original_tagname_ = 'setId' elif nodeName_ == 'versionNumber': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.versionNumber = obj_ obj_.original_tagname_ = 'versionNumber' elif nodeName_ == 'bibliographicDesignationText': obj_ = ED.factory() obj_.build(child_) self.bibliographicDesignationText = obj_ obj_.original_tagname_ = 'bibliographicDesignationText' elif nodeName_ == 'author': obj_ = POCP_MT050100UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_Document
[docs]class POCP_MT050100UV_Holder(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='HLD', realmCode=None, typeId=None, templateId=None, role=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.role = role
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Holder) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Holder.subclass: return POCP_MT050100UV_Holder.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Holder(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_role(self): return self.role
[docs] def set_role(self, role): self.role = role
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationHolder(self, value): # Validate type ParticipationHolder, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['HLD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationHolder' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationHolder_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationHolder_patterns_, ))
validate_ParticipationHolder_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.role is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Holder', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Holder') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Holder', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Holder'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "HLD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Holder', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.role is not None: self.role.export(outfile, level, namespace_, name_='role', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationHolder(self.typeCode) # validate type ParticipationHolder
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'role': obj_ = POCP_MT050100UV_Role.factory() obj_.build(child_) self.role = obj_ obj_.original_tagname_ = 'role'
# end class POCP_MT050100UV_Holder
[docs]class POCP_MT050100UV_Interactor(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Interactor) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Interactor.subclass: return POCP_MT050100UV_Interactor.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Interactor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Interactor', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Interactor') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Interactor', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Interactor'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Interactor', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050100UV_Interactor
[docs]class POCP_MT050100UV_Location(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='LOC', realmCode=None, typeId=None, templateId=None, territorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.territorialAuthority = territorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Location) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Location.subclass: return POCP_MT050100UV_Location.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Location(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_territorialAuthority(self): return self.territorialAuthority
[docs] def set_territorialAuthority(self, territorialAuthority): self.territorialAuthority = territorialAuthority
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetLocation(self, value): # Validate type ParticipationTargetLocation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['LOC', 'DST', 'ELOC', 'ORG', 'RML', 'VIA'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetLocation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetLocation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetLocation_patterns_, ))
validate_ParticipationTargetLocation_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.territorialAuthority is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Location', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Location') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Location', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Location'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "LOC" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Location', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.territorialAuthority is not None: self.territorialAuthority.export(outfile, level, namespace_, name_='territorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetLocation(self.typeCode) # validate type ParticipationTargetLocation
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'territorialAuthority': obj_ = POCP_MT050100UV_TerritorialAuthority.factory() obj_.build(child_) self.territorialAuthority = obj_ obj_.original_tagname_ = 'territorialAuthority'
# end class POCP_MT050100UV_Location
[docs]class POCP_MT050100UV_MarketingAct(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, statusCode=None, effectiveTime=None, location=None, coverage=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime if location is None: self.location = [] else: self.location = location if coverage is None: self.coverage = [] else: self.coverage = coverage if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_MarketingAct) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_MarketingAct.subclass: return POCP_MT050100UV_MarketingAct.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_MarketingAct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_location(self): return self.location
[docs] def set_location(self, location): self.location = location
[docs] def add_location(self, value): self.location.append(value)
[docs] def insert_location_at(self, index, value): self.location.insert(index, value)
[docs] def replace_location_at(self, index, value): self.location[index] = value
[docs] def get_coverage(self): return self.coverage
[docs] def set_coverage(self, coverage): self.coverage = coverage
[docs] def add_coverage(self, value): self.coverage.append(value)
[docs] def insert_coverage_at(self, index, value): self.coverage.insert(index, value)
[docs] def replace_coverage_at(self, index, value): self.coverage[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.statusCode is not None or self.effectiveTime is not None or self.location or self.coverage or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.MarketingAct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.MarketingAct') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.MarketingAct', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.MarketingAct'): if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.MarketingAct', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for location_ in self.location: location_.export(outfile, level, namespace_, name_='location', pretty_print=pretty_print) for coverage_ in self.coverage: coverage_.export(outfile, level, namespace_, name_='coverage', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'location': obj_ = POCP_MT050100UV_Location.factory() obj_.build(child_) self.location.append(obj_) obj_.original_tagname_ = 'location' elif nodeName_ == 'coverage': obj_ = POCP_MT050100UV_Coverage.factory() obj_.build(child_) self.coverage.append(obj_) obj_.original_tagname_ = 'coverage' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_MarketingAct
[docs]class POCP_MT050100UV_MonitoringProgram(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MPROT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, title=None, custodian=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.title = title self.custodian = custodian if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_MonitoringProgram) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_MonitoringProgram.subclass: return POCP_MT050100UV_MonitoringProgram.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_MonitoringProgram(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_custodian(self): return self.custodian
[docs] def set_custodian(self, custodian): self.custodian = custodian
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassMonitoringProgram(self, value): # Validate type ActClassMonitoringProgram, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MPROT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassMonitoringProgram' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassMonitoringProgram_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassMonitoringProgram_patterns_, ))
validate_ActClassMonitoringProgram_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.title is not None or self.custodian is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.MonitoringProgram', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.MonitoringProgram') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.MonitoringProgram', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.MonitoringProgram'): if self.classCode != "MPROT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.MonitoringProgram', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.custodian is not None: self.custodian.export(outfile, level, namespace_, name_='custodian', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassMonitoringProgram(self.classCode) # validate type ActClassMonitoringProgram value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'custodian': obj_ = POCP_MT050100UV_Custodian.factory() obj_.build(child_) self.custodian = obj_ obj_.original_tagname_ = 'custodian' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_MonitoringProgram
[docs]class POCP_MT050100UV_ObservationGoal(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='OBS', moodCode='GOL', realmCode=None, typeId=None, templateId=None, code=None, text=None, value=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.value = value if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_ObservationGoal) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_ObservationGoal.subclass: return POCP_MT050100UV_ObservationGoal.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_ObservationGoal(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodGoal(self, value): # Validate type ActMoodGoal, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GOL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodGoal' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodGoal_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodGoal_patterns_, ))
validate_ActMoodGoal_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.value is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.ObservationGoal', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.ObservationGoal') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.ObservationGoal', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.ObservationGoal'): if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "GOL" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.ObservationGoal', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodGoal(self.moodCode) # validate type ActMoodGoal
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_ObservationGoal
[docs]class POCP_MT050100UV_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='PSN', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Person) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Person.subclass: return POCP_MT050100UV_Person.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Person'): if self.classCode != "PSN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT050100UV_Person
[docs]class POCP_MT050100UV_PertinentInformation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PERT', realmCode=None, typeId=None, templateId=None, policy=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.policy = policy
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_PertinentInformation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_PertinentInformation.subclass: return POCP_MT050100UV_PertinentInformation.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_PertinentInformation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipPertains(self, value): # Validate type ActRelationshipPertains, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PERT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipPertains' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipPertains_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipPertains_patterns_, ))
validate_ActRelationshipPertains_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.policy is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.PertinentInformation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.PertinentInformation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.PertinentInformation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.PertinentInformation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PERT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.PertinentInformation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipPertains(self.typeCode) # validate type ActRelationshipPertains
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'policy': obj_ = POCP_MT050100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy'
# end class POCP_MT050100UV_PertinentInformation
[docs]class POCP_MT050100UV_Policy(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='POLICY', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Policy) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Policy.subclass: return POCP_MT050100UV_Policy.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Policy(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassPolicy(self, value): # Validate type ActClassPolicy, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEADrugSchedule', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPolicy' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPolicy_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPolicy_patterns_, ))
validate_ActClassPolicy_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Policy', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Policy') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Policy', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Policy'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "POLICY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Policy', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPolicy(self.classCode) # validate type ActClassPolicy value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_Policy
[docs]class POCP_MT050100UV_Role(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ROL', realmCode=None, typeId=None, templateId=None, confidentialityCode=None, playingOrganization=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.confidentialityCode = confidentialityCode self.playingOrganization = playingOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Role) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Role.subclass: return POCP_MT050100UV_Role.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Role(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_playingOrganization(self): return self.playingOrganization
[docs] def set_playingOrganization(self, playingOrganization): self.playingOrganization = playingOrganization
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassRoot(self, value): # Validate type RoleClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ROL', 'AFFL', 'AGNT', 'ASSIGNED', 'COMPAR', 'SGNOFF', 'CON', 'ECON', 'NOK', 'GUARD', 'CIT', 'COVPTY', 'CLAIM', 'NAMED', 'DEPEN', 'INDIV', 'SUBSCR', 'PROG', 'CRINV', 'CRSPNSR', 'EMP', 'MIL', 'GUAR', 'INVSBJ', 'CASEBJ', 'RESBJ', 'LIC', 'NOT', 'PROV', 'PAT', 'PAYEE', 'PAYOR', 'POLHOLD', 'QUAL', 'SPNSR', 'STD', 'UNDWRT', 'CAREGIVER', 'PRS', 'ACCESS', 'ADJY', 'CONC', 'BOND', 'CONY', 'ADMM', 'BIRTHPL', 'DEATHPLC', 'DST', 'RET', 'EXLOC', 'SDLOC', 'DSDLOC', 'ISDLOC', 'EXPR', 'HLD', 'HLTHCHRT', 'IDENT', 'MANU', 'THER', 'MNT', 'OWN', 'RGPR', 'TERR', 'USED', 'WRTE', 'EQUIV', 'SAME', 'SUBY', 'GEN', 'GRIC', 'INST', 'CONT', 'EXPAGTCAR', 'EXPVECTOR', 'FOMITE', 'INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH', 'LOCE', 'STOR', 'MBR', 'PART', 'ACTM', 'SPEC', 'ALQT', 'ISLT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassRoot_patterns_, ))
validate_RoleClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.confidentialityCode is not None or self.playingOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Role', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Role') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Role', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Role'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ROL" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Role', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.playingOrganization is not None: self.playingOrganization.export(outfile, level, namespace_, name_='playingOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassRoot(self.classCode) # validate type RoleClassRoot
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'playingOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.playingOrganization = obj_ obj_.original_tagname_ = 'playingOrganization'
# end class POCP_MT050100UV_Role
[docs]class POCP_MT050100UV_SourceOf(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ART', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_SourceOf) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_SourceOf.subclass: return POCP_MT050100UV_SourceOf.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_SourceOf(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipType(self, value): # Validate type ActRelationshipType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACTIMM', 'ADJUNCT', 'APND', 'ARR', 'ART', 'AUTH', 'BLOCK', 'BSLN', 'CAUS', 'CHRG', 'CIND', 'COMP', 'COMPLY', 'CONCURRENT', 'COST', 'COVBY', 'CREDIT', 'CTRLV', 'DEBIT', 'DEP', 'DIAG', 'DOC', 'DRIV', 'DURING', 'EAE', 'EAEORECW', 'EAS', 'EASORECWS', 'EBE', 'EBEORECW', 'EBS', 'EBSORECWS', 'ECW', 'ECWS', 'EDU', 'ELNK', 'ENE', 'ENS', 'EVID', 'EXACBY', 'EXPL', 'FLFS', 'GEN', 'GEVL', 'GOAL', 'IMM', 'INDEPENDENT', 'INST', 'INTF', 'ITEMSLOC', 'LIMIT', 'MBR', 'META', 'MFST', 'MITGT', 'MOD', 'MTCH', 'MTREAT', 'NAME', 'OBJC', 'OBJF', 'OCCR', 'OPTN', 'OREF', 'OUTC', 'OVERLAP', 'PALLTREAT', 'PART', 'PASSIMM', 'PERT', 'PRCN', 'PREV', 'PRYLX', 'QUALF', 'RCHAL', 'RCVY', 'REFR', 'REFV', 'RELVBY', 'REV', 'RISK', 'RPLC', 'RSON', 'SAE', 'SAEORSCWE', 'SAS', 'SASEAE', 'SASECWE', 'SASORSCW', 'SASSBEEAS', 'SBE', 'SBEEAE', 'SBEORSCWE', 'SBS', 'SBSEAE', 'SBSEAS', 'SBSEASEBE', 'SBSEBE', 'SBSECWE', 'SBSORSCW', 'SCH', 'SCW', 'SCWE', 'SCWSEAE', 'SCWSEBE', 'SDU', 'SEQL', 'SNE', 'SNS', 'SPRT', 'SPRTBND', 'STEP', 'SUBJ', 'SUCC', 'SUMM', 'SYMP', 'TREAT', 'TRIG', 'UPDT', 'USE', 'VALUE', 'VRXCRPT', 'XCRPT', 'XFRM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipType_patterns_, ))
validate_ActRelationshipType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.SourceOf', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.SourceOf') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.SourceOf', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.SourceOf'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ART" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.SourceOf', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipType(self.typeCode) # validate type ActRelationshipType
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT050100UV_SourceOf
[docs]class POCP_MT050100UV_SourceOf2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ART', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_SourceOf2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_SourceOf2.subclass: return POCP_MT050100UV_SourceOf2.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_SourceOf2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipType(self, value): # Validate type ActRelationshipType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACTIMM', 'ADJUNCT', 'APND', 'ARR', 'ART', 'AUTH', 'BLOCK', 'BSLN', 'CAUS', 'CHRG', 'CIND', 'COMP', 'COMPLY', 'CONCURRENT', 'COST', 'COVBY', 'CREDIT', 'CTRLV', 'DEBIT', 'DEP', 'DIAG', 'DOC', 'DRIV', 'DURING', 'EAE', 'EAEORECW', 'EAS', 'EASORECWS', 'EBE', 'EBEORECW', 'EBS', 'EBSORECWS', 'ECW', 'ECWS', 'EDU', 'ELNK', 'ENE', 'ENS', 'EVID', 'EXACBY', 'EXPL', 'FLFS', 'GEN', 'GEVL', 'GOAL', 'IMM', 'INDEPENDENT', 'INST', 'INTF', 'ITEMSLOC', 'LIMIT', 'MBR', 'META', 'MFST', 'MITGT', 'MOD', 'MTCH', 'MTREAT', 'NAME', 'OBJC', 'OBJF', 'OCCR', 'OPTN', 'OREF', 'OUTC', 'OVERLAP', 'PALLTREAT', 'PART', 'PASSIMM', 'PERT', 'PRCN', 'PREV', 'PRYLX', 'QUALF', 'RCHAL', 'RCVY', 'REFR', 'REFV', 'RELVBY', 'REV', 'RISK', 'RPLC', 'RSON', 'SAE', 'SAEORSCWE', 'SAS', 'SASEAE', 'SASECWE', 'SASORSCW', 'SASSBEEAS', 'SBE', 'SBEEAE', 'SBEORSCWE', 'SBS', 'SBSEAE', 'SBSEAS', 'SBSEASEBE', 'SBSEBE', 'SBSECWE', 'SBSORSCW', 'SCH', 'SCW', 'SCWE', 'SCWSEAE', 'SCWSEBE', 'SDU', 'SEQL', 'SNE', 'SNS', 'SPRT', 'SPRTBND', 'STEP', 'SUBJ', 'SUCC', 'SUMM', 'SYMP', 'TREAT', 'TRIG', 'UPDT', 'USE', 'VALUE', 'VRXCRPT', 'XCRPT', 'XFRM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipType_patterns_, ))
validate_ActRelationshipType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.SourceOf2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.SourceOf2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.SourceOf2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.SourceOf2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ART" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.SourceOf2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipType(self.typeCode) # validate type ActRelationshipType
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT050100UV_SourceOf2
[docs]class POCP_MT050100UV_Storage(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='STORE', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, controlVariable=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Storage) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Storage.subclass: return POCP_MT050100UV_Storage.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Storage(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassStorage(self, value): # Validate type ActClassStorage, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['STORE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassStorage' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassStorage_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassStorage_patterns_, ))
validate_ActClassStorage_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.controlVariable or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Storage', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Storage') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Storage', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Storage'): if self.classCode != "STORE" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Storage', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassStorage(self.classCode) # validate type ActClassStorage value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'controlVariable': obj_ = POCP_MT050100UV_ControlVariable.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050100UV_Storage
[docs]class POCP_MT050100UV_StorageCondition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN.CRT', isCriterionInd=None, realmCode=None, typeId=None, templateId=None, code=None, value=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.value = value
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_StorageCondition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_StorageCondition.subclass: return POCP_MT050100UV_StorageCondition.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_StorageCondition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.value is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.StorageCondition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.StorageCondition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.StorageCondition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.StorageCondition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.StorageCondition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value'
# end class POCP_MT050100UV_StorageCondition
[docs]class POCP_MT050100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Subject.subclass: return POCP_MT050100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050100UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050100UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050100UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT050100UV_Subject
[docs]class POCP_MT050100UV_TerritorialAuthority(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, territory=None, governingAgency=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.territory = territory self.governingAgency = governingAgency
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_TerritorialAuthority) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_TerritorialAuthority.subclass: return POCP_MT050100UV_TerritorialAuthority.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_TerritorialAuthority(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_territory(self): return self.territory
[docs] def set_territory(self, territory): self.territory = territory
[docs] def get_governingAgency(self): return self.governingAgency
[docs] def set_governingAgency(self, governingAgency): self.governingAgency = governingAgency
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.territory is not None or self.governingAgency is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.TerritorialAuthority', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.TerritorialAuthority') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.TerritorialAuthority', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.TerritorialAuthority'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.TerritorialAuthority', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.territory is not None: self.territory.export(outfile, level, namespace_, name_='territory', pretty_print=pretty_print) if self.governingAgency is not None: self.governingAgency.export(outfile, level, namespace_, name_='governingAgency', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'territory': obj_ = POCP_MT050100UV_Territory.factory() obj_.build(child_) self.territory = obj_ obj_.original_tagname_ = 'territory' elif nodeName_ == 'governingAgency': obj_ = POCP_MT050100UV_Agency.factory() obj_.build(child_) self.governingAgency = obj_ obj_.original_tagname_ = 'governingAgency'
# end class POCP_MT050100UV_TerritorialAuthority
[docs]class POCP_MT050100UV_Territory(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='STATE', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050100UV_Territory) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050100UV_Territory.subclass: return POCP_MT050100UV_Territory.subclass(*args_, **kwargs_) else: return POCP_MT050100UV_Territory(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Territory', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050100UV.Territory') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050100UV.Territory', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050100UV.Territory'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "STATE" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050100UV.Territory', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.classCode = ' '.join(self.classCode.split()) self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT050100UV_Territory
[docs]class POCP_MT030200UV_ActDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, product=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime if product is None: self.product = [] else: self.product = product if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_ActDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_ActDefinition.subclass: return POCP_MT030200UV_ActDefinition.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_ActDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_product(self): return self.product
[docs] def set_product(self, product): self.product = product
[docs] def add_product(self, value): self.product.append(value)
[docs] def insert_product_at(self, index, value): self.product.insert(index, value)
[docs] def replace_product_at(self, index, value): self.product[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.product or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.ActDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.ActDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.ActDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.ActDefinition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.ActDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for product_ in self.product: product_.export(outfile, level, namespace_, name_='product', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'product': obj_ = POCP_MT030200UV_Product.factory() obj_.build(child_) self.product.append(obj_) obj_.original_tagname_ = 'product' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT030200UV_ActDefinition
[docs]class POCP_MT030200UV_AssignedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ASSIGNED', realmCode=None, typeId=None, templateId=None, code=None, confidentialityCode=None, assignedOrganization=None, subjectOf=None, performance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.confidentialityCode = confidentialityCode self.assignedOrganization = assignedOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if performance is None: self.performance = [] else: self.performance = performance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_AssignedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_AssignedEntity.subclass: return POCP_MT030200UV_AssignedEntity.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_AssignedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_assignedOrganization(self): return self.assignedOrganization
[docs] def set_assignedOrganization(self, assignedOrganization): self.assignedOrganization = assignedOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_performance(self): return self.performance
[docs] def set_performance(self, performance): self.performance = performance
[docs] def add_performance(self, value): self.performance.append(value)
[docs] def insert_performance_at(self, index, value): self.performance.insert(index, value)
[docs] def replace_performance_at(self, index, value): self.performance[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.confidentialityCode is not None or self.assignedOrganization is not None or self.subjectOf or self.performance ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.AssignedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.AssignedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.AssignedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.AssignedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ASSIGNED" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.AssignedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.assignedOrganization is not None: self.assignedOrganization.export(outfile, level, namespace_, name_='assignedOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for performance_ in self.performance: performance_.export(outfile, level, namespace_, name_='performance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'assignedOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.assignedOrganization = obj_ obj_.original_tagname_ = 'assignedOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030200UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'performance': obj_ = POCP_MT030200UV_PrimaryPerformer.factory() obj_.build(child_) self.performance.append(obj_) obj_.original_tagname_ = 'performance'
# end class POCP_MT030200UV_AssignedEntity
[docs]class POCP_MT030200UV_AssignedEntity3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ASSIGNED', realmCode=None, typeId=None, templateId=None, code=None, confidentialityCode=None, representedOrganization=None, subjectOf=None, performance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.confidentialityCode = confidentialityCode self.representedOrganization = representedOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if performance is None: self.performance = [] else: self.performance = performance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_AssignedEntity3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_AssignedEntity3.subclass: return POCP_MT030200UV_AssignedEntity3.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_AssignedEntity3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_representedOrganization(self): return self.representedOrganization
[docs] def set_representedOrganization(self, representedOrganization): self.representedOrganization = representedOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_performance(self): return self.performance
[docs] def set_performance(self, performance): self.performance = performance
[docs] def add_performance(self, value): self.performance.append(value)
[docs] def insert_performance_at(self, index, value): self.performance.insert(index, value)
[docs] def replace_performance_at(self, index, value): self.performance[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.confidentialityCode is not None or self.representedOrganization is not None or self.subjectOf or self.performance ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.AssignedEntity3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.AssignedEntity3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.AssignedEntity3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.AssignedEntity3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ASSIGNED" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.AssignedEntity3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.representedOrganization is not None: self.representedOrganization.export(outfile, level, namespace_, name_='representedOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for performance_ in self.performance: performance_.export(outfile, level, namespace_, name_='performance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'representedOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.representedOrganization = obj_ obj_.original_tagname_ = 'representedOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030200UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'performance': obj_ = POCP_MT030200UV_PrimaryPerformer.factory() obj_.build(child_) self.performance.append(obj_) obj_.original_tagname_ = 'performance'
# end class POCP_MT030200UV_AssignedEntity3
[docs]class POCP_MT030200UV_ContactParty(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CON', realmCode=None, typeId=None, templateId=None, code=None, name=None, addr=None, telecom=None, confidentialityCode=None, contactPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.confidentialityCode = confidentialityCode self.contactPerson = contactPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_ContactParty) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_ContactParty.subclass: return POCP_MT030200UV_ContactParty.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_ContactParty(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_contactPerson(self): return self.contactPerson
[docs] def set_contactPerson(self, contactPerson): self.contactPerson = contactPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContact(self, value): # Validate type RoleClassContact, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CON', 'ECON', 'NOK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContact' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContact_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContact_patterns_, ))
validate_RoleClassContact_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.addr is not None or self.telecom or self.confidentialityCode is not None or self.contactPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.ContactParty', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.ContactParty') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.ContactParty', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.ContactParty'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CON" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.ContactParty', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.contactPerson is not None: self.contactPerson.export(outfile, level, namespace_, name_='contactPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContact(self.classCode) # validate type RoleClassContact
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'contactPerson': obj_ = POCP_MT030200UV_Person.factory() obj_.build(child_) self.contactPerson = obj_ obj_.original_tagname_ = 'contactPerson'
# end class POCP_MT030200UV_ContactParty
[docs]class POCP_MT030200UV_ManufacturedProduct3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturedMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturedMaterialKind = manufacturedMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_ManufacturedProduct3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_ManufacturedProduct3.subclass: return POCP_MT030200UV_ManufacturedProduct3.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_ManufacturedProduct3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturedMaterialKind(self): return self.manufacturedMaterialKind
[docs] def set_manufacturedMaterialKind(self, manufacturedMaterialKind): self.manufacturedMaterialKind = manufacturedMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturedMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.ManufacturedProduct3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.ManufacturedProduct3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.ManufacturedProduct3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.ManufacturedProduct3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.ManufacturedProduct3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturedMaterialKind is not None: self.manufacturedMaterialKind.export(outfile, level, namespace_, name_='manufacturedMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturedMaterialKind': obj_ = POCP_MT010400UV_MaterialKind.factory() obj_.build(child_) self.manufacturedMaterialKind = obj_ obj_.original_tagname_ = 'manufacturedMaterialKind'
# end class POCP_MT030200UV_ManufacturedProduct3
[docs]class POCP_MT030200UV_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, telecom=None, addr=None, assignedEntity1=None, asNamedEntity=None, contactParty=None, assignedEntity=None, otherLocation=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.name = name if telecom is None: self.telecom = [] else: self.telecom = telecom self.addr = addr if assignedEntity1 is None: self.assignedEntity1 = [] else: self.assignedEntity1 = assignedEntity1 if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if contactParty is None: self.contactParty = [] else: self.contactParty = contactParty if assignedEntity is None: self.assignedEntity = [] else: self.assignedEntity = assignedEntity if otherLocation is None: self.otherLocation = [] else: self.otherLocation = otherLocation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_Organization.subclass: return POCP_MT030200UV_Organization.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_assignedEntity1(self): return self.assignedEntity1
[docs] def set_assignedEntity1(self, assignedEntity1): self.assignedEntity1 = assignedEntity1
[docs] def add_assignedEntity1(self, value): self.assignedEntity1.append(value)
[docs] def insert_assignedEntity1_at(self, index, value): self.assignedEntity1.insert(index, value)
[docs] def replace_assignedEntity1_at(self, index, value): self.assignedEntity1[index] = value
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_contactParty(self): return self.contactParty
[docs] def set_contactParty(self, contactParty): self.contactParty = contactParty
[docs] def add_contactParty(self, value): self.contactParty.append(value)
[docs] def insert_contactParty_at(self, index, value): self.contactParty.insert(index, value)
[docs] def replace_contactParty_at(self, index, value): self.contactParty[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def add_assignedEntity(self, value): self.assignedEntity.append(value)
[docs] def insert_assignedEntity_at(self, index, value): self.assignedEntity.insert(index, value)
[docs] def replace_assignedEntity_at(self, index, value): self.assignedEntity[index] = value
[docs] def get_otherLocation(self): return self.otherLocation
[docs] def set_otherLocation(self, otherLocation): self.otherLocation = otherLocation
[docs] def add_otherLocation(self, value): self.otherLocation.append(value)
[docs] def insert_otherLocation_at(self, index, value): self.otherLocation.insert(index, value)
[docs] def replace_otherLocation_at(self, index, value): self.otherLocation[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.name is not None or self.telecom or self.addr is not None or self.assignedEntity1 or self.asNamedEntity or self.contactParty or self.assignedEntity or self.otherLocation ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.Organization'): if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for assignedEntity1_ in self.assignedEntity1: assignedEntity1_.export(outfile, level, namespace_, name_='assignedEntity1', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for contactParty_ in self.contactParty: contactParty_.export(outfile, level, namespace_, name_='contactParty', pretty_print=pretty_print) for assignedEntity_ in self.assignedEntity: assignedEntity_.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print) for otherLocation_ in self.otherLocation: otherLocation_.export(outfile, level, namespace_, name_='otherLocation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'assignedEntity1': obj_ = POCP_MT030200UV_AssignedEntity3.factory() obj_.build(child_) self.assignedEntity1.append(obj_) obj_.original_tagname_ = 'assignedEntity1' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT000100UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'contactParty': obj_ = POCP_MT030200UV_ContactParty.factory() obj_.build(child_) self.contactParty.append(obj_) obj_.original_tagname_ = 'contactParty' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030200UV_AssignedEntity.factory() obj_.build(child_) self.assignedEntity.append(obj_) obj_.original_tagname_ = 'assignedEntity' elif nodeName_ == 'otherLocation': obj_ = POCP_MT030200UV_OtherLocation.factory() obj_.build(child_) self.otherLocation.append(obj_) obj_.original_tagname_ = 'otherLocation'
# end class POCP_MT030200UV_Organization
[docs]class POCP_MT030200UV_OtherLocation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SDLOC', realmCode=None, typeId=None, templateId=None, code=None, addr=None, telecom=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_OtherLocation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_OtherLocation.subclass: return POCP_MT030200UV_OtherLocation.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_OtherLocation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassServiceDeliveryLocation(self, value): # Validate type RoleClassServiceDeliveryLocation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SDLOC', 'DSDLOC', 'ISDLOC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassServiceDeliveryLocation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassServiceDeliveryLocation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassServiceDeliveryLocation_patterns_, ))
validate_RoleClassServiceDeliveryLocation_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.addr is not None or self.telecom ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.OtherLocation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.OtherLocation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.OtherLocation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.OtherLocation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SDLOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.OtherLocation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassServiceDeliveryLocation(self.classCode) # validate type RoleClassServiceDeliveryLocation
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom'
# end class POCP_MT030200UV_OtherLocation
[docs]class POCP_MT030200UV_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='PSN', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_Person) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_Person.subclass: return POCP_MT030200UV_Person.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.Person'): if self.classCode != "PSN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT030200UV_Person
[docs]class POCP_MT030200UV_PrimaryPerformer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PPRF', realmCode=None, typeId=None, templateId=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_PrimaryPerformer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_PrimaryPerformer.subclass: return POCP_MT030200UV_PrimaryPerformer.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_PrimaryPerformer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPrimaryPerformer(self, value): # Validate type ParticipationPrimaryPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPrimaryPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPrimaryPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPrimaryPerformer_patterns_, ))
validate_ParticipationPrimaryPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.PrimaryPerformer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.PrimaryPerformer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.PrimaryPerformer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.PrimaryPerformer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PPRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.PrimaryPerformer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPrimaryPerformer(self.typeCode) # validate type ParticipationPrimaryPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'actDefinition': obj_ = POCP_MT030200UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT030200UV_PrimaryPerformer
[docs]class POCP_MT030200UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, manufacturedProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct = manufacturedProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_Product.subclass: return POCP_MT030200UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT030200UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct'
# end class POCP_MT030200UV_Product
[docs]class POCP_MT030200UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_Subject.subclass: return POCP_MT030200UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT030200UV_Subject
[docs]class POCP_MT030200UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, position=None, characteristic=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.position = position self.characteristic = characteristic
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030200UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030200UV_Subject2.subclass: return POCP_MT030200UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT030200UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_position(self): return self.position
[docs] def set_position(self, position): self.position = position
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.position is not None or self.characteristic is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030200UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030200UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030200UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030200UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.position is not None: self.position.export(outfile, level, namespace_, name_='position', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'position': obj_ = COCT_MT960000UV05_Position.factory() obj_.build(child_) self.position = obj_ obj_.original_tagname_ = 'position' elif nodeName_ == 'characteristic': obj_ = POCP_MT050500UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic'
# end class POCP_MT030200UV_Subject2
[docs]class COCT_MT960000UV05_Author(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, contextControlCode='OP', realmCode=None, typeId=None, templateId=None, assignedPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedPerson = assignedPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_Author) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_Author.subclass: return COCT_MT960000UV05_Author.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_Author(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedPerson(self): return self.assignedPerson
[docs] def set_assignedPerson(self, assignedPerson): self.assignedPerson = assignedPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Author', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.Author') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.Author', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.Author'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "OP" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Author', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedPerson is not None: self.assignedPerson.export(outfile, level, namespace_, name_='assignedPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedPerson': obj_ = COCT_MT090108UV_AssignedPerson.factory() obj_.build(child_) self.assignedPerson = obj_ obj_.original_tagname_ = 'assignedPerson'
# end class COCT_MT960000UV05_Author
[docs]class COCT_MT960000UV05_Component1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, contextControlCode='AN', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, positionCoordinate=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.positionCoordinate = positionCoordinate
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_Component1) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_Component1.subclass: return COCT_MT960000UV05_Component1.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_Component1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_positionCoordinate(self): return self.positionCoordinate
[docs] def set_positionCoordinate(self, positionCoordinate): self.positionCoordinate = positionCoordinate
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.positionCoordinate is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Component1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.Component1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.Component1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.Component1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "AN" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Component1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.positionCoordinate is not None: self.positionCoordinate.export(outfile, level, namespace_, name_='positionCoordinate', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'positionCoordinate': obj_ = COCT_MT960000UV05_PositionCoordinate.factory() obj_.build(child_) self.positionCoordinate = obj_ obj_.original_tagname_ = 'positionCoordinate'
# end class COCT_MT960000UV05_Component1
[docs]class COCT_MT960000UV05_Component2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, contextControlCode='AP', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, positionAccuracy=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.positionAccuracy = positionAccuracy
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_Component2) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_Component2.subclass: return COCT_MT960000UV05_Component2.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_Component2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_positionAccuracy(self): return self.positionAccuracy
[docs] def set_positionAccuracy(self, positionAccuracy): self.positionAccuracy = positionAccuracy
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.positionAccuracy is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Component2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.Component2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.Component2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.Component2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "AP" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Component2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.positionAccuracy is not None: self.positionAccuracy.export(outfile, level, namespace_, name_='positionAccuracy', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'positionAccuracy': obj_ = COCT_MT960000UV05_PositionAccuracy.factory() obj_.build(child_) self.positionAccuracy = obj_ obj_.original_tagname_ = 'positionAccuracy'
# end class COCT_MT960000UV05_Component2
[docs]class COCT_MT960000UV05_Device1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, contextControlCode='ON', realmCode=None, typeId=None, templateId=None, assignedDevice=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedDevice = assignedDevice
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_Device1) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_Device1.subclass: return COCT_MT960000UV05_Device1.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_Device1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedDevice(self): return self.assignedDevice
[docs] def set_assignedDevice(self, assignedDevice): self.assignedDevice = assignedDevice
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedDevice is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Device1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.Device1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.Device1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.Device1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "ON" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Device1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedDevice is not None: self.assignedDevice.export(outfile, level, namespace_, name_='assignedDevice', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedDevice': obj_ = COCT_MT090303UV01_AssignedDevice.factory() obj_.build(child_) self.assignedDevice = obj_ obj_.original_tagname_ = 'assignedDevice'
# end class COCT_MT960000UV05_Device1
[docs]class COCT_MT960000UV05_Device2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, contextControlCode='ON', realmCode=None, typeId=None, templateId=None, assignedDevice=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedDevice = assignedDevice
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_Device2) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_Device2.subclass: return COCT_MT960000UV05_Device2.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_Device2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedDevice(self): return self.assignedDevice
[docs] def set_assignedDevice(self, assignedDevice): self.assignedDevice = assignedDevice
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedDevice is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Device2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.Device2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.Device2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.Device2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "ON" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Device2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedDevice is not None: self.assignedDevice.export(outfile, level, namespace_, name_='assignedDevice', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedDevice': obj_ = COCT_MT090303UV01_AssignedDevice.factory() obj_.build(child_) self.assignedDevice = obj_ obj_.original_tagname_ = 'assignedDevice'
# end class COCT_MT960000UV05_Device2
[docs]class COCT_MT960000UV05_Position(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, activityTime=None, value=None, device=None, author=None, component1=None, component2=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime self.activityTime = activityTime self.value = value if device is None: self.device = [] else: self.device = device self.author = author if component1 is None: self.component1 = [] else: self.component1 = component1 self.component2 = component2
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_Position) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_Position.subclass: return COCT_MT960000UV05_Position.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_Position(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_activityTime(self): return self.activityTime
[docs] def set_activityTime(self, activityTime): self.activityTime = activityTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_device(self): return self.device
[docs] def set_device(self, device): self.device = device
[docs] def add_device(self, value): self.device.append(value)
[docs] def insert_device_at(self, index, value): self.device.insert(index, value)
[docs] def replace_device_at(self, index, value): self.device[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_component1(self): return self.component1
[docs] def set_component1(self, component1): self.component1 = component1
[docs] def add_component1(self, value): self.component1.append(value)
[docs] def insert_component1_at(self, index, value): self.component1.insert(index, value)
[docs] def replace_component1_at(self, index, value): self.component1[index] = value
[docs] def get_component2(self): return self.component2
[docs] def set_component2(self, component2): self.component2 = component2
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassPosition(self, value): # Validate type ActClassPosition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['POS', 'POSACC', 'POSCOORD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPosition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPosition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPosition_patterns_, ))
validate_ActClassPosition_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.text is not None or self.effectiveTime is not None or self.activityTime is not None or self.value is not None or self.device or self.author is not None or self.component1 or self.component2 is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Position', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.Position') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.Position', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.Position'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.Position', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.activityTime is not None: self.activityTime.export(outfile, level, namespace_, name_='activityTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for device_ in self.device: device_.export(outfile, level, namespace_, name_='device', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for component1_ in self.component1: component1_.export(outfile, level, namespace_, name_='component1', pretty_print=pretty_print) if self.component2 is not None: self.component2.export(outfile, level, namespace_, name_='component2', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPosition(self.classCode) # validate type ActClassPosition value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'activityTime': obj_ = IVL_TS.factory() obj_.build(child_) self.activityTime = obj_ obj_.original_tagname_ = 'activityTime' elif nodeName_ == 'value': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'device': obj_ = COCT_MT960000UV05_Device2.factory() obj_.build(child_) self.device.append(obj_) obj_.original_tagname_ = 'device' elif nodeName_ == 'author': obj_ = COCT_MT960000UV05_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'component1': obj_ = COCT_MT960000UV05_Component1.factory() obj_.build(child_) self.component1.append(obj_) obj_.original_tagname_ = 'component1' elif nodeName_ == 'component2': obj_ = COCT_MT960000UV05_Component2.factory() obj_.build(child_) self.component2 = obj_ obj_.original_tagname_ = 'component2'
# end class COCT_MT960000UV05_Position
[docs]class COCT_MT960000UV05_PositionAccuracy(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, moodCode=None, realmCode=None, typeId=None, templateId=None, code=None, value=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.value = value
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_PositionAccuracy) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_PositionAccuracy.subclass: return COCT_MT960000UV05_PositionAccuracy.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_PositionAccuracy(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassPositionAccuracy(self, value): # Validate type ActClassPositionAccuracy, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['POSACC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPositionAccuracy' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPositionAccuracy_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPositionAccuracy_patterns_, ))
validate_ActClassPositionAccuracy_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.value is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.PositionAccuracy', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.PositionAccuracy') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.PositionAccuracy', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.PositionAccuracy'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.PositionAccuracy', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPositionAccuracy(self.classCode) # validate type ActClassPositionAccuracy value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value'
# end class COCT_MT960000UV05_PositionAccuracy
[docs]class COCT_MT960000UV05_PositionCoordinate(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, moodCode=None, realmCode=None, typeId=None, templateId=None, code=None, text=None, value=None, methodCode=None, device=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.value = value self.methodCode = methodCode if device is None: self.device = [] else: self.device = device
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT960000UV05_PositionCoordinate) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT960000UV05_PositionCoordinate.subclass: return COCT_MT960000UV05_PositionCoordinate.subclass(*args_, **kwargs_) else: return COCT_MT960000UV05_PositionCoordinate(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def get_device(self): return self.device
[docs] def set_device(self, device): self.device = device
[docs] def add_device(self, value): self.device.append(value)
[docs] def insert_device_at(self, index, value): self.device.insert(index, value)
[docs] def replace_device_at(self, index, value): self.device[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassPositionCoordinate(self, value): # Validate type ActClassPositionCoordinate, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['POSCOORD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPositionCoordinate' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPositionCoordinate_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPositionCoordinate_patterns_, ))
validate_ActClassPositionCoordinate_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.value is not None or self.methodCode is not None or self.device ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.PositionCoordinate', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT960000UV05.PositionCoordinate') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT960000UV05.PositionCoordinate', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT960000UV05.PositionCoordinate'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT960000UV05.PositionCoordinate', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.methodCode is not None: self.methodCode.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) for device_ in self.device: device_.export(outfile, level, namespace_, name_='device', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPositionCoordinate(self.classCode) # validate type ActClassPositionCoordinate value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode = obj_ obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'device': obj_ = COCT_MT960000UV05_Device1.factory() obj_.build(child_) self.device.append(obj_) obj_.original_tagname_ = 'device'
# end class COCT_MT960000UV05_PositionCoordinate
[docs]class COCT_MT090303UV01_AssignedDevice(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, addr=None, telecom=None, assignedDevice=None, representedOrganization=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if addr is None: self.addr = [] else: self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.assignedDevice = assignedDevice self.representedOrganization = representedOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT090303UV01_AssignedDevice) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT090303UV01_AssignedDevice.subclass: return COCT_MT090303UV01_AssignedDevice.subclass(*args_, **kwargs_) else: return COCT_MT090303UV01_AssignedDevice(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def add_addr(self, value): self.addr.append(value)
[docs] def insert_addr_at(self, index, value): self.addr.insert(index, value)
[docs] def replace_addr_at(self, index, value): self.addr[index] = value
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_assignedDevice(self): return self.assignedDevice
[docs] def set_assignedDevice(self, assignedDevice): self.assignedDevice = assignedDevice
[docs] def get_representedOrganization(self): return self.representedOrganization
[docs] def set_representedOrganization(self, representedOrganization): self.representedOrganization = representedOrganization
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.addr or self.telecom or self.assignedDevice is not None or self.representedOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT090303UV01.AssignedDevice', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT090303UV01.AssignedDevice') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT090303UV01.AssignedDevice', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT090303UV01.AssignedDevice'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT090303UV01.AssignedDevice', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for addr_ in self.addr: addr_.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.assignedDevice is not None: self.assignedDevice.export(outfile, level, namespace_, name_='assignedDevice', pretty_print=pretty_print) if self.representedOrganization is not None: self.representedOrganization.export(outfile, level, namespace_, name_='representedOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr.append(obj_) obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'assignedDevice': obj_ = COCT_MT090303UV01_Device.factory() obj_.build(child_) self.assignedDevice = obj_ obj_.original_tagname_ = 'assignedDevice' elif nodeName_ == 'representedOrganization': obj_ = COCT_MT150003UV03_Organization.factory() obj_.build(child_) self.representedOrganization = obj_ obj_.original_tagname_ = 'representedOrganization'
# end class COCT_MT090303UV01_AssignedDevice
[docs]class COCT_MT090303UV01_Device(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, determinerCode=None, realmCode=None, typeId=None, templateId=None, id=None, manufacturerModelName=None, softwareName=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.manufacturerModelName = manufacturerModelName self.softwareName = softwareName
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT090303UV01_Device) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT090303UV01_Device.subclass: return COCT_MT090303UV01_Device.subclass(*args_, **kwargs_) else: return COCT_MT090303UV01_Device(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_manufacturerModelName(self): return self.manufacturerModelName
[docs] def set_manufacturerModelName(self, manufacturerModelName): self.manufacturerModelName = manufacturerModelName
[docs] def get_softwareName(self): return self.softwareName
[docs] def set_softwareName(self, softwareName): self.softwareName = softwareName
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassDevice(self, value): # Validate type EntityClassDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassDevice_patterns_, ))
validate_EntityClassDevice_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.manufacturerModelName is not None or self.softwareName is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT090303UV01.Device', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT090303UV01.Device') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT090303UV01.Device', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT090303UV01.Device'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT090303UV01.Device', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturerModelName is not None: self.manufacturerModelName.export(outfile, level, namespace_, name_='manufacturerModelName', pretty_print=pretty_print) if self.softwareName is not None: self.softwareName.export(outfile, level, namespace_, name_='softwareName', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassDevice(self.classCode) # validate type EntityClassDevice value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturerModelName': class_obj_ = self.get_class_obj_(child_, SC) obj_ = class_obj_.factory() obj_.build(child_) self.manufacturerModelName = obj_ obj_.original_tagname_ = 'manufacturerModelName' elif nodeName_ == 'softwareName': class_obj_ = self.get_class_obj_(child_, SC) obj_ = class_obj_.factory() obj_.build(child_) self.softwareName = obj_ obj_.original_tagname_ = 'softwareName'
# end class COCT_MT090303UV01_Device
[docs]class COCT_MT150003UV03_ContactParty(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, addr=None, telecom=None, contactPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if addr is None: self.addr = [] else: self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.contactPerson = contactPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT150003UV03_ContactParty) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT150003UV03_ContactParty.subclass: return COCT_MT150003UV03_ContactParty.subclass(*args_, **kwargs_) else: return COCT_MT150003UV03_ContactParty(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def add_addr(self, value): self.addr.append(value)
[docs] def insert_addr_at(self, index, value): self.addr.insert(index, value)
[docs] def replace_addr_at(self, index, value): self.addr[index] = value
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_contactPerson(self): return self.contactPerson
[docs] def set_contactPerson(self, contactPerson): self.contactPerson = contactPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContact(self, value): # Validate type RoleClassContact, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CON', 'ECON', 'NOK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContact' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContact_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContact_patterns_, ))
validate_RoleClassContact_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.addr or self.telecom or self.contactPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT150003UV03.ContactParty', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT150003UV03.ContactParty') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT150003UV03.ContactParty', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT150003UV03.ContactParty'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT150003UV03.ContactParty', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for addr_ in self.addr: addr_.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.contactPerson is not None: self.contactPerson.export(outfile, level, namespace_, name_='contactPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContact(self.classCode) # validate type RoleClassContact
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr.append(obj_) obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'contactPerson': obj_ = COCT_MT150003UV03_Person.factory() obj_.build(child_) self.contactPerson = obj_ obj_.original_tagname_ = 'contactPerson'
# end class COCT_MT150003UV03_ContactParty
[docs]class COCT_MT150003UV03_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, determinerCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, name=None, contactParty=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if name is None: self.name = [] else: self.name = name if contactParty is None: self.contactParty = [] else: self.contactParty = contactParty
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT150003UV03_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT150003UV03_Organization.subclass: return COCT_MT150003UV03_Organization.subclass(*args_, **kwargs_) else: return COCT_MT150003UV03_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_contactParty(self): return self.contactParty
[docs] def set_contactParty(self, contactParty): self.contactParty = contactParty
[docs] def add_contactParty(self, value): self.contactParty.append(value)
[docs] def insert_contactParty_at(self, index, value): self.contactParty.insert(index, value)
[docs] def replace_contactParty_at(self, index, value): self.contactParty[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.name or self.contactParty ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT150003UV03.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT150003UV03.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT150003UV03.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT150003UV03.Organization'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT150003UV03.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for contactParty_ in self.contactParty: contactParty_.export(outfile, level, namespace_, name_='contactParty', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'contactParty': obj_ = COCT_MT150003UV03_ContactParty.factory() obj_.build(child_) self.contactParty.append(obj_) obj_.original_tagname_ = 'contactParty'
# end class COCT_MT150003UV03_Organization
[docs]class COCT_MT150003UV03_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, determinerCode=None, realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT150003UV03_Person) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT150003UV03_Person.subclass: return COCT_MT150003UV03_Person.subclass(*args_, **kwargs_) else: return COCT_MT150003UV03_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT150003UV03.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT150003UV03.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT150003UV03.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT150003UV03.Person'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT150003UV03.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class COCT_MT150003UV03_Person
[docs]class COCT_MT090108UV_AssignedPerson(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, addr=None, telecom=None, assignedPerson=None, representedOrganization=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if addr is None: self.addr = [] else: self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.assignedPerson = assignedPerson self.representedOrganization = representedOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT090108UV_AssignedPerson) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT090108UV_AssignedPerson.subclass: return COCT_MT090108UV_AssignedPerson.subclass(*args_, **kwargs_) else: return COCT_MT090108UV_AssignedPerson(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def add_addr(self, value): self.addr.append(value)
[docs] def insert_addr_at(self, index, value): self.addr.insert(index, value)
[docs] def replace_addr_at(self, index, value): self.addr[index] = value
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_assignedPerson(self): return self.assignedPerson
[docs] def set_assignedPerson(self, assignedPerson): self.assignedPerson = assignedPerson
[docs] def get_representedOrganization(self): return self.representedOrganization
[docs] def set_representedOrganization(self, representedOrganization): self.representedOrganization = representedOrganization
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.addr or self.telecom or self.assignedPerson is not None or self.representedOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT090108UV.AssignedPerson', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT090108UV.AssignedPerson') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT090108UV.AssignedPerson', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT090108UV.AssignedPerson'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT090108UV.AssignedPerson', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for addr_ in self.addr: addr_.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.assignedPerson is not None: self.assignedPerson.export(outfile, level, namespace_, name_='assignedPerson', pretty_print=pretty_print) if self.representedOrganization is not None: self.representedOrganization.export(outfile, level, namespace_, name_='representedOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr.append(obj_) obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'assignedPerson': obj_ = COCT_MT090108UV_Person.factory() obj_.build(child_) self.assignedPerson = obj_ obj_.original_tagname_ = 'assignedPerson' elif nodeName_ == 'representedOrganization': obj_ = COCT_MT150007UV_Organization.factory() obj_.build(child_) self.representedOrganization = obj_ obj_.original_tagname_ = 'representedOrganization'
# end class COCT_MT090108UV_AssignedPerson
[docs]class COCT_MT090108UV_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, determinerCode=None, realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT090108UV_Person) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT090108UV_Person.subclass: return COCT_MT090108UV_Person.subclass(*args_, **kwargs_) else: return COCT_MT090108UV_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT090108UV.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT090108UV.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT090108UV.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT090108UV.Person'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT090108UV.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class COCT_MT090108UV_Person
[docs]class COCT_MT150007UV_ContactParty(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, addr=None, telecom=None, contactPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if addr is None: self.addr = [] else: self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.contactPerson = contactPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT150007UV_ContactParty) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT150007UV_ContactParty.subclass: return COCT_MT150007UV_ContactParty.subclass(*args_, **kwargs_) else: return COCT_MT150007UV_ContactParty(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def add_addr(self, value): self.addr.append(value)
[docs] def insert_addr_at(self, index, value): self.addr.insert(index, value)
[docs] def replace_addr_at(self, index, value): self.addr[index] = value
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_contactPerson(self): return self.contactPerson
[docs] def set_contactPerson(self, contactPerson): self.contactPerson = contactPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContact(self, value): # Validate type RoleClassContact, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CON', 'ECON', 'NOK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContact' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContact_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContact_patterns_, ))
validate_RoleClassContact_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.addr or self.telecom or self.contactPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT150007UV.ContactParty', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT150007UV.ContactParty') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT150007UV.ContactParty', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT150007UV.ContactParty'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT150007UV.ContactParty', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for addr_ in self.addr: addr_.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.contactPerson is not None: self.contactPerson.export(outfile, level, namespace_, name_='contactPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContact(self.classCode) # validate type RoleClassContact
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr.append(obj_) obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'contactPerson': obj_ = COCT_MT150007UV_Person.factory() obj_.build(child_) self.contactPerson = obj_ obj_.original_tagname_ = 'contactPerson'
# end class COCT_MT150007UV_ContactParty
[docs]class COCT_MT150007UV_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, determinerCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, name=None, contactParty=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if name is None: self.name = [] else: self.name = name if contactParty is None: self.contactParty = [] else: self.contactParty = contactParty
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT150007UV_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT150007UV_Organization.subclass: return COCT_MT150007UV_Organization.subclass(*args_, **kwargs_) else: return COCT_MT150007UV_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_contactParty(self): return self.contactParty
[docs] def set_contactParty(self, contactParty): self.contactParty = contactParty
[docs] def add_contactParty(self, value): self.contactParty.append(value)
[docs] def insert_contactParty_at(self, index, value): self.contactParty.insert(index, value)
[docs] def replace_contactParty_at(self, index, value): self.contactParty[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.name or self.contactParty ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT150007UV.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT150007UV.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT150007UV.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT150007UV.Organization'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT150007UV.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for contactParty_ in self.contactParty: contactParty_.export(outfile, level, namespace_, name_='contactParty', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'contactParty': obj_ = COCT_MT150007UV_ContactParty.factory() obj_.build(child_) self.contactParty.append(obj_) obj_.original_tagname_ = 'contactParty'
# end class COCT_MT150007UV_Organization
[docs]class COCT_MT150007UV_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, determinerCode=None, realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT150007UV_Person) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT150007UV_Person.subclass: return COCT_MT150007UV_Person.subclass(*args_, **kwargs_) else: return COCT_MT150007UV_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT150007UV.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT150007UV.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT150007UV.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT150007UV.Person'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT150007UV.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class COCT_MT150007UV_Person
[docs]class POCP_MT050500UV_Action(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, reasonCode=None, author=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime if reasonCode is None: self.reasonCode = [] else: self.reasonCode = reasonCode self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050500UV_Action) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050500UV_Action.subclass: return POCP_MT050500UV_Action.subclass(*args_, **kwargs_) else: return POCP_MT050500UV_Action(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_reasonCode(self): return self.reasonCode
[docs] def set_reasonCode(self, reasonCode): self.reasonCode = reasonCode
[docs] def add_reasonCode(self, value): self.reasonCode.append(value)
[docs] def insert_reasonCode_at(self, index, value): self.reasonCode.insert(index, value)
[docs] def replace_reasonCode_at(self, index, value): self.reasonCode[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.effectiveTime is not None or self.reasonCode or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Action', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050500UV.Action') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050500UV.Action', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050500UV.Action'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Action', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for reasonCode_ in self.reasonCode: reasonCode_.export(outfile, level, namespace_, name_='reasonCode', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'reasonCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.reasonCode.append(obj_) obj_.original_tagname_ = 'reasonCode' elif nodeName_ == 'author': obj_ = POCP_MT050500UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050500UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050500UV_Action
[docs]class POCP_MT050500UV_Analyte(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ALY', realmCode=None, typeId=None, templateId=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050500UV_Analyte) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050500UV_Analyte.subclass: return POCP_MT050500UV_Analyte.subclass(*args_, **kwargs_) else: return POCP_MT050500UV_Analyte(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAnalyte(self, value): # Validate type ParticipationAnalyte, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAnalyte' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAnalyte_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAnalyte_patterns_, ))
validate_ParticipationAnalyte_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Analyte', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050500UV.Analyte') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050500UV.Analyte', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050500UV.Analyte'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ALY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Analyte', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAnalyte(self.typeCode) # validate type ParticipationAnalyte
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050500UV_Analyte
[docs]class POCP_MT050500UV_Author1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050500UV_Author1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050500UV_Author1.subclass: return POCP_MT050500UV_Author1.subclass(*args_, **kwargs_) else: return POCP_MT050500UV_Author1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Author1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050500UV.Author1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050500UV.Author1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050500UV.Author1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Author1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT050500UV_Author1
[docs]class POCP_MT050500UV_Characteristic(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, value=None, methodCode=None, analyte=None, author=None, interactor=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime self.value = value if methodCode is None: self.methodCode = [] else: self.methodCode = methodCode self.analyte = analyte self.author = author if interactor is None: self.interactor = [] else: self.interactor = interactor if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050500UV_Characteristic) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050500UV_Characteristic.subclass: return POCP_MT050500UV_Characteristic.subclass(*args_, **kwargs_) else: return POCP_MT050500UV_Characteristic(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def add_methodCode(self, value): self.methodCode.append(value)
[docs] def insert_methodCode_at(self, index, value): self.methodCode.insert(index, value)
[docs] def replace_methodCode_at(self, index, value): self.methodCode[index] = value
[docs] def get_analyte(self): return self.analyte
[docs] def set_analyte(self, analyte): self.analyte = analyte
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.value is not None or self.methodCode or self.analyte is not None or self.author is not None or self.interactor or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Characteristic', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050500UV.Characteristic') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050500UV.Characteristic', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050500UV.Characteristic'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Characteristic', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for methodCode_ in self.methodCode: methodCode_.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) if self.analyte is not None: self.analyte.export(outfile, level, namespace_, name_='analyte', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode.append(obj_) obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'analyte': obj_ = POCP_MT050500UV_Analyte.factory() obj_.build(child_) self.analyte = obj_ obj_.original_tagname_ = 'analyte' elif nodeName_ == 'author': obj_ = POCP_MT050500UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'interactor': obj_ = POCP_MT050500UV_Interactor.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050500UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050500UV_Characteristic
[docs]class POCP_MT050500UV_Document(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, title=None, text=None, effectiveTime=None, confidentialityCode=None, languageCode=None, setId=None, versionNumber=None, bibliographicDesignationText=None, author=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.title = title self.text = text self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.languageCode = languageCode self.setId = setId self.versionNumber = versionNumber self.bibliographicDesignationText = bibliographicDesignationText self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050500UV_Document) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050500UV_Document.subclass: return POCP_MT050500UV_Document.subclass(*args_, **kwargs_) else: return POCP_MT050500UV_Document(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_languageCode(self): return self.languageCode
[docs] def set_languageCode(self, languageCode): self.languageCode = languageCode
[docs] def get_setId(self): return self.setId
[docs] def set_setId(self, setId): self.setId = setId
[docs] def get_versionNumber(self): return self.versionNumber
[docs] def set_versionNumber(self, versionNumber): self.versionNumber = versionNumber
[docs] def get_bibliographicDesignationText(self): return self.bibliographicDesignationText
[docs] def set_bibliographicDesignationText(self, bibliographicDesignationText): self.bibliographicDesignationText = bibliographicDesignationText
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocument(self, value): # Validate type ActClassDocument, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOC', 'DOCCLIN', 'CDALVLONE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocument' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocument_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocument_patterns_, ))
validate_ActClassDocument_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.title is not None or self.text is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.languageCode is not None or self.setId is not None or self.versionNumber is not None or self.bibliographicDesignationText is not None or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Document', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050500UV.Document') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050500UV.Document', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050500UV.Document'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Document', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.languageCode is not None: self.languageCode.export(outfile, level, namespace_, name_='languageCode', pretty_print=pretty_print) if self.setId is not None: self.setId.export(outfile, level, namespace_, name_='setId', pretty_print=pretty_print) if self.versionNumber is not None: self.versionNumber.export(outfile, level, namespace_, name_='versionNumber', pretty_print=pretty_print) if self.bibliographicDesignationText is not None: self.bibliographicDesignationText.export(outfile, level, namespace_, name_='bibliographicDesignationText', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocument(self.classCode) # validate type ActClassDocument value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': obj_ = ED.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'languageCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.languageCode = obj_ obj_.original_tagname_ = 'languageCode' elif nodeName_ == 'setId': obj_ = II.factory() obj_.build(child_) self.setId = obj_ obj_.original_tagname_ = 'setId' elif nodeName_ == 'versionNumber': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.versionNumber = obj_ obj_.original_tagname_ = 'versionNumber' elif nodeName_ == 'bibliographicDesignationText': obj_ = ED.factory() obj_.build(child_) self.bibliographicDesignationText = obj_ obj_.original_tagname_ = 'bibliographicDesignationText' elif nodeName_ == 'author': obj_ = POCP_MT050500UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050500UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050500UV_Document
[docs]class POCP_MT050500UV_Interactor(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050500UV_Interactor) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050500UV_Interactor.subclass: return POCP_MT050500UV_Interactor.subclass(*args_, **kwargs_) else: return POCP_MT050500UV_Interactor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Interactor', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050500UV.Interactor') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050500UV.Interactor', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050500UV.Interactor'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Interactor', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050500UV_Interactor
[docs]class POCP_MT050500UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050500UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050500UV_Subject.subclass: return POCP_MT050500UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT050500UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050500UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050500UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050500UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050500UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050500UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050500UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050500UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT050500UV_Subject
[docs]class POCP_MT010400UV_MaterialKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010400UV_MaterialKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010400UV_MaterialKind.subclass: return POCP_MT010400UV_MaterialKind.subclass(*args_, **kwargs_) else: return POCP_MT010400UV_MaterialKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassMaterial(self, value): # Validate type EntityClassMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MAT', 'CHEM', 'FOOD', 'MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassMaterial_patterns_, ))
validate_EntityClassMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010400UV.MaterialKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010400UV.MaterialKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010400UV.MaterialKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010400UV.MaterialKind'): if self.classCode != "MAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010400UV.MaterialKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassMaterial(self.classCode) # validate type EntityClassMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010400UV_MaterialKind
[docs]class POCP_MT050700UV_Action(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, reasonCode=None, author=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime if reasonCode is None: self.reasonCode = [] else: self.reasonCode = reasonCode self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Action) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Action.subclass: return POCP_MT050700UV_Action.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Action(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_reasonCode(self): return self.reasonCode
[docs] def set_reasonCode(self, reasonCode): self.reasonCode = reasonCode
[docs] def add_reasonCode(self, value): self.reasonCode.append(value)
[docs] def insert_reasonCode_at(self, index, value): self.reasonCode.insert(index, value)
[docs] def replace_reasonCode_at(self, index, value): self.reasonCode[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.effectiveTime is not None or self.reasonCode or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Action', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Action') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Action', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Action'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Action', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for reasonCode_ in self.reasonCode: reasonCode_.export(outfile, level, namespace_, name_='reasonCode', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'reasonCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.reasonCode.append(obj_) obj_.original_tagname_ = 'reasonCode' elif nodeName_ == 'author': obj_ = POCP_MT050700UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050700UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050700UV_Action
[docs]class POCP_MT050700UV_Agency(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PUB', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, addr=None, contactParty=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.name = name self.addr = addr if contactParty is None: self.contactParty = [] else: self.contactParty = contactParty
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Agency) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Agency.subclass: return POCP_MT050700UV_Agency.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Agency(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_contactParty(self): return self.contactParty
[docs] def set_contactParty(self, contactParty): self.contactParty = contactParty
[docs] def add_contactParty(self, value): self.contactParty.append(value)
[docs] def insert_contactParty_at(self, index, value): self.contactParty.insert(index, value)
[docs] def replace_contactParty_at(self, index, value): self.contactParty[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassPublicInstitution(self, value): # Validate type EntityClassPublicInstitution, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PUB'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPublicInstitution' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPublicInstitution_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPublicInstitution_patterns_, ))
validate_EntityClassPublicInstitution_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.name is not None or self.addr is not None or self.contactParty ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Agency', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Agency') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Agency', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Agency'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PUB" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Agency', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for contactParty_ in self.contactParty: contactParty_.export(outfile, level, namespace_, name_='contactParty', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPublicInstitution(self.classCode) # validate type EntityClassPublicInstitution value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'contactParty': obj_ = POCP_MT050700UV_ContactParty.factory() obj_.build(child_) self.contactParty.append(obj_) obj_.original_tagname_ = 'contactParty'
# end class POCP_MT050700UV_Agency
[docs]class POCP_MT050700UV_Analyte(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ALY', realmCode=None, typeId=None, templateId=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Analyte) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Analyte.subclass: return POCP_MT050700UV_Analyte.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Analyte(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAnalyte(self, value): # Validate type ParticipationAnalyte, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAnalyte' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAnalyte_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAnalyte_patterns_, ))
validate_ParticipationAnalyte_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Analyte', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Analyte') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Analyte', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Analyte'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ALY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Analyte', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAnalyte(self.typeCode) # validate type ParticipationAnalyte
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050700UV_Analyte
[docs]class POCP_MT050700UV_Approval(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CNTRCT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, statusCode=None, effectiveTime=None, activityTime=None, availabilityTime=None, holder=None, author=None, pertinentInformation=None, outboundRelationship=None, subjectOf=None, inboundRelationship=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.statusCode = statusCode self.effectiveTime = effectiveTime self.activityTime = activityTime self.availabilityTime = availabilityTime if holder is None: self.holder = [] else: self.holder = holder if author is None: self.author = [] else: self.author = author if pertinentInformation is None: self.pertinentInformation = [] else: self.pertinentInformation = pertinentInformation if outboundRelationship is None: self.outboundRelationship = [] else: self.outboundRelationship = outboundRelationship if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if inboundRelationship is None: self.inboundRelationship = [] else: self.inboundRelationship = inboundRelationship
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Approval) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Approval.subclass: return POCP_MT050700UV_Approval.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Approval(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_activityTime(self): return self.activityTime
[docs] def set_activityTime(self, activityTime): self.activityTime = activityTime
[docs] def get_availabilityTime(self): return self.availabilityTime
[docs] def set_availabilityTime(self, availabilityTime): self.availabilityTime = availabilityTime
[docs] def get_holder(self): return self.holder
[docs] def set_holder(self, holder): self.holder = holder
[docs] def add_holder(self, value): self.holder.append(value)
[docs] def insert_holder_at(self, index, value): self.holder.insert(index, value)
[docs] def replace_holder_at(self, index, value): self.holder[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_pertinentInformation(self): return self.pertinentInformation
[docs] def set_pertinentInformation(self, pertinentInformation): self.pertinentInformation = pertinentInformation
[docs] def add_pertinentInformation(self, value): self.pertinentInformation.append(value)
[docs] def insert_pertinentInformation_at(self, index, value): self.pertinentInformation.insert(index, value)
[docs] def replace_pertinentInformation_at(self, index, value): self.pertinentInformation[index] = value
[docs] def get_outboundRelationship(self): return self.outboundRelationship
[docs] def set_outboundRelationship(self, outboundRelationship): self.outboundRelationship = outboundRelationship
[docs] def add_outboundRelationship(self, value): self.outboundRelationship.append(value)
[docs] def insert_outboundRelationship_at(self, index, value): self.outboundRelationship.insert(index, value)
[docs] def replace_outboundRelationship_at(self, index, value): self.outboundRelationship[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_inboundRelationship(self): return self.inboundRelationship
[docs] def set_inboundRelationship(self, inboundRelationship): self.inboundRelationship = inboundRelationship
[docs] def add_inboundRelationship(self, value): self.inboundRelationship.append(value)
[docs] def insert_inboundRelationship_at(self, index, value): self.inboundRelationship.insert(index, value)
[docs] def replace_inboundRelationship_at(self, index, value): self.inboundRelationship[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassContract(self, value): # Validate type ActClassContract, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CNTRCT', 'FCNTRCT', 'COV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassContract' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassContract_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassContract_patterns_, ))
validate_ActClassContract_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.statusCode is not None or self.effectiveTime is not None or self.activityTime is not None or self.availabilityTime is not None or self.holder or self.author or self.pertinentInformation or self.outboundRelationship or self.subjectOf or self.inboundRelationship ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Approval', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Approval') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Approval', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Approval'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CNTRCT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Approval', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.activityTime is not None: self.activityTime.export(outfile, level, namespace_, name_='activityTime', pretty_print=pretty_print) if self.availabilityTime is not None: self.availabilityTime.export(outfile, level, namespace_, name_='availabilityTime', pretty_print=pretty_print) for holder_ in self.holder: holder_.export(outfile, level, namespace_, name_='holder', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for pertinentInformation_ in self.pertinentInformation: pertinentInformation_.export(outfile, level, namespace_, name_='pertinentInformation', pretty_print=pretty_print) for outboundRelationship_ in self.outboundRelationship: outboundRelationship_.export(outfile, level, namespace_, name_='outboundRelationship', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for inboundRelationship_ in self.inboundRelationship: inboundRelationship_.export(outfile, level, namespace_, name_='inboundRelationship', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassContract(self.classCode) # validate type ActClassContract value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'activityTime': obj_ = IVL_TS.factory() obj_.build(child_) self.activityTime = obj_ obj_.original_tagname_ = 'activityTime' elif nodeName_ == 'availabilityTime': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.availabilityTime = obj_ obj_.original_tagname_ = 'availabilityTime' elif nodeName_ == 'holder': obj_ = POCP_MT050700UV_Holder.factory() obj_.build(child_) self.holder.append(obj_) obj_.original_tagname_ = 'holder' elif nodeName_ == 'author': obj_ = POCP_MT050700UV_Author2.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'pertinentInformation': obj_ = POCP_MT050700UV_PertinentInformation.factory() obj_.build(child_) self.pertinentInformation.append(obj_) obj_.original_tagname_ = 'pertinentInformation' elif nodeName_ == 'outboundRelationship': obj_ = POCP_MT050700UV_SourceOf.factory() obj_.build(child_) self.outboundRelationship.append(obj_) obj_.original_tagname_ = 'outboundRelationship' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050700UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'inboundRelationship': obj_ = POCP_MT050700UV_SourceOf2.factory() obj_.build(child_) self.inboundRelationship.append(obj_) obj_.original_tagname_ = 'inboundRelationship'
# end class POCP_MT050700UV_Approval
[docs]class POCP_MT050700UV_Author1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Author1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Author1.subclass: return POCP_MT050700UV_Author1.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Author1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Author1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Author1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Author1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Author1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Author1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT050700UV_Author1
[docs]class POCP_MT050700UV_Author2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, time=None, territorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.time = time self.territorialAuthority = territorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Author2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Author2.subclass: return POCP_MT050700UV_Author2.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Author2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_time(self): return self.time
[docs] def set_time(self, time): self.time = time
[docs] def get_territorialAuthority(self): return self.territorialAuthority
[docs] def set_territorialAuthority(self, territorialAuthority): self.territorialAuthority = territorialAuthority
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.time is not None or self.territorialAuthority is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Author2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Author2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Author2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Author2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Author2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.time is not None: self.time.export(outfile, level, namespace_, name_='time', pretty_print=pretty_print) if self.territorialAuthority is not None: self.territorialAuthority.export(outfile, level, namespace_, name_='territorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'time': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.time = obj_ obj_.original_tagname_ = 'time' elif nodeName_ == 'territorialAuthority': obj_ = POCP_MT050700UV_TerritorialAuthority.factory() obj_.build(child_) self.territorialAuthority = obj_ obj_.original_tagname_ = 'territorialAuthority'
# end class POCP_MT050700UV_Author2
[docs]class POCP_MT050700UV_Characteristic(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, value=None, methodCode=None, analyte=None, author=None, interactor=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime self.value = value if methodCode is None: self.methodCode = [] else: self.methodCode = methodCode self.analyte = analyte self.author = author if interactor is None: self.interactor = [] else: self.interactor = interactor if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Characteristic) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Characteristic.subclass: return POCP_MT050700UV_Characteristic.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Characteristic(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def add_methodCode(self, value): self.methodCode.append(value)
[docs] def insert_methodCode_at(self, index, value): self.methodCode.insert(index, value)
[docs] def replace_methodCode_at(self, index, value): self.methodCode[index] = value
[docs] def get_analyte(self): return self.analyte
[docs] def set_analyte(self, analyte): self.analyte = analyte
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.value is not None or self.methodCode or self.analyte is not None or self.author is not None or self.interactor or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Characteristic', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Characteristic') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Characteristic', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Characteristic'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Characteristic', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for methodCode_ in self.methodCode: methodCode_.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) if self.analyte is not None: self.analyte.export(outfile, level, namespace_, name_='analyte', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode.append(obj_) obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'analyte': obj_ = POCP_MT050700UV_Analyte.factory() obj_.build(child_) self.analyte = obj_ obj_.original_tagname_ = 'analyte' elif nodeName_ == 'author': obj_ = POCP_MT050700UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'interactor': obj_ = POCP_MT050700UV_Interactor.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050700UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050700UV_Characteristic
[docs]class POCP_MT050700UV_ContactParty(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CON', realmCode=None, typeId=None, templateId=None, code=None, name=None, addr=None, telecom=None, confidentialityCode=None, contactPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.confidentialityCode = confidentialityCode self.contactPerson = contactPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_ContactParty) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_ContactParty.subclass: return POCP_MT050700UV_ContactParty.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_ContactParty(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_contactPerson(self): return self.contactPerson
[docs] def set_contactPerson(self, contactPerson): self.contactPerson = contactPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContact(self, value): # Validate type RoleClassContact, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CON', 'ECON', 'NOK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContact' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContact_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContact_patterns_, ))
validate_RoleClassContact_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.addr is not None or self.telecom or self.confidentialityCode is not None or self.contactPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.ContactParty', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.ContactParty') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.ContactParty', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.ContactParty'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CON" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.ContactParty', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.contactPerson is not None: self.contactPerson.export(outfile, level, namespace_, name_='contactPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContact(self.classCode) # validate type RoleClassContact
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'contactPerson': obj_ = POCP_MT050700UV_Person.factory() obj_.build(child_) self.contactPerson = obj_ obj_.original_tagname_ = 'contactPerson'
# end class POCP_MT050700UV_ContactParty
[docs]class POCP_MT050700UV_Document(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, title=None, text=None, effectiveTime=None, confidentialityCode=None, languageCode=None, setId=None, versionNumber=None, bibliographicDesignationText=None, author=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.title = title self.text = text self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.languageCode = languageCode self.setId = setId self.versionNumber = versionNumber self.bibliographicDesignationText = bibliographicDesignationText self.author = author if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Document) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Document.subclass: return POCP_MT050700UV_Document.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Document(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_languageCode(self): return self.languageCode
[docs] def set_languageCode(self, languageCode): self.languageCode = languageCode
[docs] def get_setId(self): return self.setId
[docs] def set_setId(self, setId): self.setId = setId
[docs] def get_versionNumber(self): return self.versionNumber
[docs] def set_versionNumber(self, versionNumber): self.versionNumber = versionNumber
[docs] def get_bibliographicDesignationText(self): return self.bibliographicDesignationText
[docs] def set_bibliographicDesignationText(self, bibliographicDesignationText): self.bibliographicDesignationText = bibliographicDesignationText
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocument(self, value): # Validate type ActClassDocument, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOC', 'DOCCLIN', 'CDALVLONE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocument' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocument_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocument_patterns_, ))
validate_ActClassDocument_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.title is not None or self.text is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.languageCode is not None or self.setId is not None or self.versionNumber is not None or self.bibliographicDesignationText is not None or self.author is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Document', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Document') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Document', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Document'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Document', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.languageCode is not None: self.languageCode.export(outfile, level, namespace_, name_='languageCode', pretty_print=pretty_print) if self.setId is not None: self.setId.export(outfile, level, namespace_, name_='setId', pretty_print=pretty_print) if self.versionNumber is not None: self.versionNumber.export(outfile, level, namespace_, name_='versionNumber', pretty_print=pretty_print) if self.bibliographicDesignationText is not None: self.bibliographicDesignationText.export(outfile, level, namespace_, name_='bibliographicDesignationText', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocument(self.classCode) # validate type ActClassDocument value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': obj_ = ED.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'languageCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.languageCode = obj_ obj_.original_tagname_ = 'languageCode' elif nodeName_ == 'setId': obj_ = II.factory() obj_.build(child_) self.setId = obj_ obj_.original_tagname_ = 'setId' elif nodeName_ == 'versionNumber': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.versionNumber = obj_ obj_.original_tagname_ = 'versionNumber' elif nodeName_ == 'bibliographicDesignationText': obj_ = ED.factory() obj_.build(child_) self.bibliographicDesignationText = obj_ obj_.original_tagname_ = 'bibliographicDesignationText' elif nodeName_ == 'author': obj_ = POCP_MT050700UV_Author1.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050700UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050700UV_Document
[docs]class POCP_MT050700UV_Holder(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='HLD', realmCode=None, typeId=None, templateId=None, role=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.role = role
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Holder) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Holder.subclass: return POCP_MT050700UV_Holder.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Holder(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_role(self): return self.role
[docs] def set_role(self, role): self.role = role
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationHolder(self, value): # Validate type ParticipationHolder, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['HLD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationHolder' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationHolder_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationHolder_patterns_, ))
validate_ParticipationHolder_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.role is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Holder', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Holder') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Holder', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Holder'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "HLD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Holder', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.role is not None: self.role.export(outfile, level, namespace_, name_='role', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationHolder(self.typeCode) # validate type ParticipationHolder
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'role': obj_ = POCP_MT050700UV_Role.factory() obj_.build(child_) self.role = obj_ obj_.original_tagname_ = 'role'
# end class POCP_MT050700UV_Holder
[docs]class POCP_MT050700UV_Interactor(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, ingredient=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.ingredient = ingredient self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Interactor) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Interactor.subclass: return POCP_MT050700UV_Interactor.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Interactor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.ingredient is not None or self.moiety is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Interactor', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Interactor') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Interactor', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Interactor'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Interactor', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) if self.moiety is not None: self.moiety.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT080300UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'ingredient': obj_ = POCP_MT080300UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'moiety': obj_ = POCP_MT080300UV_Moiety.factory() obj_.build(child_) self.moiety = obj_ obj_.original_tagname_ = 'moiety'
# end class POCP_MT050700UV_Interactor
[docs]class POCP_MT050700UV_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='PSN', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Person) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Person.subclass: return POCP_MT050700UV_Person.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Person'): if self.classCode != "PSN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT050700UV_Person
[docs]class POCP_MT050700UV_PertinentInformation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PERT', realmCode=None, typeId=None, templateId=None, policy=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.policy = policy
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_PertinentInformation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_PertinentInformation.subclass: return POCP_MT050700UV_PertinentInformation.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_PertinentInformation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipPertains(self, value): # Validate type ActRelationshipPertains, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PERT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipPertains' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipPertains_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipPertains_patterns_, ))
validate_ActRelationshipPertains_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.policy is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.PertinentInformation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.PertinentInformation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.PertinentInformation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.PertinentInformation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PERT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.PertinentInformation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipPertains(self.typeCode) # validate type ActRelationshipPertains
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'policy': obj_ = POCP_MT050700UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy'
# end class POCP_MT050700UV_PertinentInformation
[docs]class POCP_MT050700UV_Policy(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='POLICY', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Policy) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Policy.subclass: return POCP_MT050700UV_Policy.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Policy(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassPolicy(self, value): # Validate type ActClassPolicy, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEADrugSchedule', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPolicy' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPolicy_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPolicy_patterns_, ))
validate_ActClassPolicy_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Policy', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Policy') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Policy', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Policy'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "POLICY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Policy', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPolicy(self.classCode) # validate type ActClassPolicy value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'subjectOf': obj_ = POCP_MT050700UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT050700UV_Policy
[docs]class POCP_MT050700UV_Role(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ROL', realmCode=None, typeId=None, templateId=None, confidentialityCode=None, playingOrganization=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.confidentialityCode = confidentialityCode self.playingOrganization = playingOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Role) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Role.subclass: return POCP_MT050700UV_Role.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Role(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_playingOrganization(self): return self.playingOrganization
[docs] def set_playingOrganization(self, playingOrganization): self.playingOrganization = playingOrganization
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassRoot(self, value): # Validate type RoleClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ROL', 'AFFL', 'AGNT', 'ASSIGNED', 'COMPAR', 'SGNOFF', 'CON', 'ECON', 'NOK', 'GUARD', 'CIT', 'COVPTY', 'CLAIM', 'NAMED', 'DEPEN', 'INDIV', 'SUBSCR', 'PROG', 'CRINV', 'CRSPNSR', 'EMP', 'MIL', 'GUAR', 'INVSBJ', 'CASEBJ', 'RESBJ', 'LIC', 'NOT', 'PROV', 'PAT', 'PAYEE', 'PAYOR', 'POLHOLD', 'QUAL', 'SPNSR', 'STD', 'UNDWRT', 'CAREGIVER', 'PRS', 'ACCESS', 'ADJY', 'CONC', 'BOND', 'CONY', 'ADMM', 'BIRTHPL', 'DEATHPLC', 'DST', 'RET', 'EXLOC', 'SDLOC', 'DSDLOC', 'ISDLOC', 'EXPR', 'HLD', 'HLTHCHRT', 'IDENT', 'MANU', 'THER', 'MNT', 'OWN', 'RGPR', 'TERR', 'USED', 'WRTE', 'EQUIV', 'SAME', 'SUBY', 'GEN', 'GRIC', 'INST', 'CONT', 'EXPAGTCAR', 'EXPVECTOR', 'FOMITE', 'INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH', 'LOCE', 'STOR', 'MBR', 'PART', 'ACTM', 'SPEC', 'ALQT', 'ISLT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassRoot_patterns_, ))
validate_RoleClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.confidentialityCode is not None or self.playingOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Role', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Role') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Role', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Role'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ROL" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Role', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.playingOrganization is not None: self.playingOrganization.export(outfile, level, namespace_, name_='playingOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassRoot(self.classCode) # validate type RoleClassRoot
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'playingOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.playingOrganization = obj_ obj_.original_tagname_ = 'playingOrganization'
# end class POCP_MT050700UV_Role
[docs]class POCP_MT050700UV_SourceOf(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ART', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_SourceOf) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_SourceOf.subclass: return POCP_MT050700UV_SourceOf.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_SourceOf(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipType(self, value): # Validate type ActRelationshipType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACTIMM', 'ADJUNCT', 'APND', 'ARR', 'ART', 'AUTH', 'BLOCK', 'BSLN', 'CAUS', 'CHRG', 'CIND', 'COMP', 'COMPLY', 'CONCURRENT', 'COST', 'COVBY', 'CREDIT', 'CTRLV', 'DEBIT', 'DEP', 'DIAG', 'DOC', 'DRIV', 'DURING', 'EAE', 'EAEORECW', 'EAS', 'EASORECWS', 'EBE', 'EBEORECW', 'EBS', 'EBSORECWS', 'ECW', 'ECWS', 'EDU', 'ELNK', 'ENE', 'ENS', 'EVID', 'EXACBY', 'EXPL', 'FLFS', 'GEN', 'GEVL', 'GOAL', 'IMM', 'INDEPENDENT', 'INST', 'INTF', 'ITEMSLOC', 'LIMIT', 'MBR', 'META', 'MFST', 'MITGT', 'MOD', 'MTCH', 'MTREAT', 'NAME', 'OBJC', 'OBJF', 'OCCR', 'OPTN', 'OREF', 'OUTC', 'OVERLAP', 'PALLTREAT', 'PART', 'PASSIMM', 'PERT', 'PRCN', 'PREV', 'PRYLX', 'QUALF', 'RCHAL', 'RCVY', 'REFR', 'REFV', 'RELVBY', 'REV', 'RISK', 'RPLC', 'RSON', 'SAE', 'SAEORSCWE', 'SAS', 'SASEAE', 'SASECWE', 'SASORSCW', 'SASSBEEAS', 'SBE', 'SBEEAE', 'SBEORSCWE', 'SBS', 'SBSEAE', 'SBSEAS', 'SBSEASEBE', 'SBSEBE', 'SBSECWE', 'SBSORSCW', 'SCH', 'SCW', 'SCWE', 'SCWSEAE', 'SCWSEBE', 'SDU', 'SEQL', 'SNE', 'SNS', 'SPRT', 'SPRTBND', 'STEP', 'SUBJ', 'SUCC', 'SUMM', 'SYMP', 'TREAT', 'TRIG', 'UPDT', 'USE', 'VALUE', 'VRXCRPT', 'XCRPT', 'XFRM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipType_patterns_, ))
validate_ActRelationshipType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.SourceOf', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.SourceOf') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.SourceOf', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.SourceOf'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ART" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.SourceOf', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipType(self.typeCode) # validate type ActRelationshipType
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT050700UV_SourceOf
[docs]class POCP_MT050700UV_SourceOf2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ART', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_SourceOf2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_SourceOf2.subclass: return POCP_MT050700UV_SourceOf2.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_SourceOf2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipType(self, value): # Validate type ActRelationshipType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACTIMM', 'ADJUNCT', 'APND', 'ARR', 'ART', 'AUTH', 'BLOCK', 'BSLN', 'CAUS', 'CHRG', 'CIND', 'COMP', 'COMPLY', 'CONCURRENT', 'COST', 'COVBY', 'CREDIT', 'CTRLV', 'DEBIT', 'DEP', 'DIAG', 'DOC', 'DRIV', 'DURING', 'EAE', 'EAEORECW', 'EAS', 'EASORECWS', 'EBE', 'EBEORECW', 'EBS', 'EBSORECWS', 'ECW', 'ECWS', 'EDU', 'ELNK', 'ENE', 'ENS', 'EVID', 'EXACBY', 'EXPL', 'FLFS', 'GEN', 'GEVL', 'GOAL', 'IMM', 'INDEPENDENT', 'INST', 'INTF', 'ITEMSLOC', 'LIMIT', 'MBR', 'META', 'MFST', 'MITGT', 'MOD', 'MTCH', 'MTREAT', 'NAME', 'OBJC', 'OBJF', 'OCCR', 'OPTN', 'OREF', 'OUTC', 'OVERLAP', 'PALLTREAT', 'PART', 'PASSIMM', 'PERT', 'PRCN', 'PREV', 'PRYLX', 'QUALF', 'RCHAL', 'RCVY', 'REFR', 'REFV', 'RELVBY', 'REV', 'RISK', 'RPLC', 'RSON', 'SAE', 'SAEORSCWE', 'SAS', 'SASEAE', 'SASECWE', 'SASORSCW', 'SASSBEEAS', 'SBE', 'SBEEAE', 'SBEORSCWE', 'SBS', 'SBSEAE', 'SBSEAS', 'SBSEASEBE', 'SBSEBE', 'SBSECWE', 'SBSORSCW', 'SCH', 'SCW', 'SCWE', 'SCWSEAE', 'SCWSEBE', 'SDU', 'SEQL', 'SNE', 'SNS', 'SPRT', 'SPRTBND', 'STEP', 'SUBJ', 'SUCC', 'SUMM', 'SYMP', 'TREAT', 'TRIG', 'UPDT', 'USE', 'VALUE', 'VRXCRPT', 'XCRPT', 'XFRM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipType_patterns_, ))
validate_ActRelationshipType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.SourceOf2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.SourceOf2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.SourceOf2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.SourceOf2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ART" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.SourceOf2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipType(self.typeCode) # validate type ActRelationshipType
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT050700UV_SourceOf2
[docs]class POCP_MT050700UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Subject.subclass: return POCP_MT050700UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050700UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050700UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050700UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT050700UV_Subject
[docs]class POCP_MT050700UV_TerritorialAuthority(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, territory=None, governingAgency=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.territory = territory self.governingAgency = governingAgency
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_TerritorialAuthority) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_TerritorialAuthority.subclass: return POCP_MT050700UV_TerritorialAuthority.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_TerritorialAuthority(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_territory(self): return self.territory
[docs] def set_territory(self, territory): self.territory = territory
[docs] def get_governingAgency(self): return self.governingAgency
[docs] def set_governingAgency(self, governingAgency): self.governingAgency = governingAgency
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.territory is not None or self.governingAgency is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.TerritorialAuthority', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.TerritorialAuthority') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.TerritorialAuthority', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.TerritorialAuthority'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.TerritorialAuthority', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.territory is not None: self.territory.export(outfile, level, namespace_, name_='territory', pretty_print=pretty_print) if self.governingAgency is not None: self.governingAgency.export(outfile, level, namespace_, name_='governingAgency', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'territory': obj_ = POCP_MT050700UV_Territory.factory() obj_.build(child_) self.territory = obj_ obj_.original_tagname_ = 'territory' elif nodeName_ == 'governingAgency': obj_ = POCP_MT050700UV_Agency.factory() obj_.build(child_) self.governingAgency = obj_ obj_.original_tagname_ = 'governingAgency'
# end class POCP_MT050700UV_TerritorialAuthority
[docs]class POCP_MT050700UV_Territory(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='STATE', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT050700UV_Territory) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT050700UV_Territory.subclass: return POCP_MT050700UV_Territory.subclass(*args_, **kwargs_) else: return POCP_MT050700UV_Territory(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Territory', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT050700UV.Territory') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT050700UV.Territory', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT050700UV.Territory'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "STATE" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT050700UV.Territory', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.classCode = ' '.join(self.classCode.split()) self.validate_cs(self.classCode) # validate type cs value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT050700UV_Territory
[docs]class POCP_MT080200UV_Component(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, derivation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.derivation = derivation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_Component) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_Component.subclass: return POCP_MT080200UV_Component.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_Component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_derivation(self): return self.derivation
[docs] def set_derivation(self, derivation): self.derivation = derivation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.derivation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Component', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.Component') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.Component', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.Component'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Component', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.derivation is not None: self.derivation.export(outfile, level, namespace_, name_='derivation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'derivation': obj_ = POCP_MT080200UV_Derivation.factory() obj_.build(child_) self.derivation = obj_ obj_.original_tagname_ = 'derivation'
# end class POCP_MT080200UV_Component
[docs]class POCP_MT080200UV_Component2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, derivation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.derivation = derivation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_Component2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_Component2.subclass: return POCP_MT080200UV_Component2.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_Component2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_derivation(self): return self.derivation
[docs] def set_derivation(self, derivation): self.derivation = derivation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.derivation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Component2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.Component2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.Component2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.Component2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Component2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.derivation is not None: self.derivation.export(outfile, level, namespace_, name_='derivation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'derivation': obj_ = POCP_MT080200UV_Derivation.factory() obj_.build(child_) self.derivation = obj_ obj_.original_tagname_ = 'derivation'
# end class POCP_MT080200UV_Component2
[docs]class POCP_MT080200UV_Derivation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, effectiveTime=None, directTarget=None, component=None, componentOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.effectiveTime = effectiveTime if directTarget is None: self.directTarget = [] else: self.directTarget = directTarget if component is None: self.component = [] else: self.component = component if componentOf is None: self.componentOf = [] else: self.componentOf = componentOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_Derivation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_Derivation.subclass: return POCP_MT080200UV_Derivation.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_Derivation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_directTarget(self): return self.directTarget
[docs] def set_directTarget(self, directTarget): self.directTarget = directTarget
[docs] def add_directTarget(self, value): self.directTarget.append(value)
[docs] def insert_directTarget_at(self, index, value): self.directTarget.insert(index, value)
[docs] def replace_directTarget_at(self, index, value): self.directTarget[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_componentOf(self): return self.componentOf
[docs] def set_componentOf(self, componentOf): self.componentOf = componentOf
[docs] def add_componentOf(self, value): self.componentOf.append(value)
[docs] def insert_componentOf_at(self, index, value): self.componentOf.insert(index, value)
[docs] def replace_componentOf_at(self, index, value): self.componentOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.effectiveTime is not None or self.directTarget or self.component or self.componentOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Derivation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.Derivation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.Derivation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.Derivation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Derivation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for directTarget_ in self.directTarget: directTarget_.export(outfile, level, namespace_, name_='directTarget', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) for componentOf_ in self.componentOf: componentOf_.export(outfile, level, namespace_, name_='componentOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'directTarget': obj_ = POCP_MT080200UV_DirectTarget.factory() obj_.build(child_) self.directTarget.append(obj_) obj_.original_tagname_ = 'directTarget' elif nodeName_ == 'component': obj_ = POCP_MT080200UV_Component.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component' elif nodeName_ == 'componentOf': obj_ = POCP_MT080200UV_Component2.factory() obj_.build(child_) self.componentOf.append(obj_) obj_.original_tagname_ = 'componentOf'
# end class POCP_MT080200UV_Derivation
[docs]class POCP_MT080200UV_DirectTarget(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DIR', realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_DirectTarget) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_DirectTarget.subclass: return POCP_MT080200UV_DirectTarget.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_DirectTarget(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDirect(self, value): # Validate type ParticipationTargetDirect, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DIR', 'ALY', 'BBY', 'CAT', 'CSM', 'DEV', 'NRD', 'RDV', 'DON', 'EXPAGNT', 'EXPART', 'EXPTRGT', 'EXSRC', 'PRD', 'SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDirect' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDirect_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDirect_patterns_, ))
validate_ParticipationTargetDirect_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.DirectTarget', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.DirectTarget') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.DirectTarget', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.DirectTarget'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DIR" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.DirectTarget', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDirect(self.typeCode) # validate type ParticipationTargetDirect
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT080200UV_DirectTarget
[docs]class POCP_MT080200UV_Entity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ENT', determinerCode=None, realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_Entity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_Entity.subclass: return POCP_MT080200UV_Entity.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_Entity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassRoot(self, value): # Validate type EntityClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ENT', 'HCE', 'LIV', 'NLIV', 'ANM', 'MIC', 'PLNT', 'PSN', 'MAT', 'CHEM', 'FOOD', 'MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV', 'ORG', 'PUB', 'STATE', 'NAT', 'PLC', 'CITY', 'COUNTRY', 'COUNTY', 'PROVINCE', 'RGRP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassRoot_patterns_, ))
validate_EntityClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminer(self, value): # Validate type EntityDeterminer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GROUP', 'GROUPKIND', 'INSTANCE', 'KIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminer_patterns_, ))
validate_EntityDeterminer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Entity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.Entity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.Entity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.Entity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Entity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassRoot(self.classCode) # validate type EntityClassRoot value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminer(self.determinerCode) # validate type EntityDeterminer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT080200UV_Entity
[docs]class POCP_MT080200UV_OrganismStrain(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='NLIV', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, deceasedInd=None, strainText=None, asSpecializedKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.deceasedInd = deceasedInd self.strainText = strainText if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_OrganismStrain) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_OrganismStrain.subclass: return POCP_MT080200UV_OrganismStrain.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_OrganismStrain(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_deceasedInd(self): return self.deceasedInd
[docs] def set_deceasedInd(self, deceasedInd): self.deceasedInd = deceasedInd
[docs] def get_strainText(self): return self.strainText
[docs] def set_strainText(self, strainText): self.strainText = strainText
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassNonPersonLivingSubject(self, value): # Validate type EntityClassNonPersonLivingSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['NLIV', 'ANM', 'MIC', 'PLNT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassNonPersonLivingSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassNonPersonLivingSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassNonPersonLivingSubject_patterns_, ))
validate_EntityClassNonPersonLivingSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.deceasedInd is not None or self.strainText is not None or self.asSpecializedKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.OrganismStrain', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.OrganismStrain') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.OrganismStrain', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.OrganismStrain'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "NLIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.OrganismStrain', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.deceasedInd is not None: self.deceasedInd.export(outfile, level, namespace_, name_='deceasedInd', pretty_print=pretty_print) if self.strainText is not None: self.strainText.export(outfile, level, namespace_, name_='strainText', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassNonPersonLivingSubject(self.classCode) # validate type EntityClassNonPersonLivingSubject value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'deceasedInd': obj_ = BL.factory() obj_.build(child_) self.deceasedInd = obj_ obj_.original_tagname_ = 'deceasedInd' elif nodeName_ == 'strainText': obj_ = ED.factory() obj_.build(child_) self.strainText = obj_ obj_.original_tagname_ = 'strainText' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT080200UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind'
# end class POCP_MT080200UV_OrganismStrain
[docs]class POCP_MT080200UV_PresentSubstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, presentSubstance=None, presentSubstance2=None, environmentEntity=None, environmentOrganismStrain=None, subjectOf=None, productOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.presentSubstance = presentSubstance self.presentSubstance2 = presentSubstance2 self.environmentEntity = environmentEntity self.environmentOrganismStrain = environmentOrganismStrain if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf self.productOf = productOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_PresentSubstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_PresentSubstance.subclass: return POCP_MT080200UV_PresentSubstance.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_PresentSubstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_presentSubstance2(self): return self.presentSubstance2
[docs] def set_presentSubstance2(self, presentSubstance2): self.presentSubstance2 = presentSubstance2
[docs] def get_environmentEntity(self): return self.environmentEntity
[docs] def set_environmentEntity(self, environmentEntity): self.environmentEntity = environmentEntity
[docs] def get_environmentOrganismStrain(self): return self.environmentOrganismStrain
[docs] def set_environmentOrganismStrain(self, environmentOrganismStrain): self.environmentOrganismStrain = environmentOrganismStrain
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassSubstancePresence(self, value): # Validate type RoleClassSubstancePresence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT', 'INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH', 'LOCE', 'STOR', 'PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassSubstancePresence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassSubstancePresence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassSubstancePresence_patterns_, ))
validate_RoleClassSubstancePresence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.presentSubstance is not None or self.presentSubstance2 is not None or self.environmentEntity is not None or self.environmentOrganismStrain is not None or self.subjectOf or self.productOf is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.PresentSubstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.PresentSubstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.PresentSubstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.PresentSubstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.PresentSubstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print) if self.presentSubstance2 is not None: self.presentSubstance2.export(outfile, level, namespace_, name_='presentSubstance2', pretty_print=pretty_print) if self.environmentEntity is not None: self.environmentEntity.export(outfile, level, namespace_, name_='environmentEntity', pretty_print=pretty_print) if self.environmentOrganismStrain is not None: self.environmentOrganismStrain.export(outfile, level, namespace_, name_='environmentOrganismStrain', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) if self.productOf is not None: self.productOf.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassSubstancePresence(self.classCode) # validate type RoleClassSubstancePresence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT081100UV_Substance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance' elif nodeName_ == 'presentSubstance2': obj_ = POCP_MT082100UV_Substance.factory() obj_.build(child_) self.presentSubstance2 = obj_ obj_.original_tagname_ = 'presentSubstance2' elif nodeName_ == 'environmentEntity': obj_ = POCP_MT080200UV_Entity.factory() obj_.build(child_) self.environmentEntity = obj_ obj_.original_tagname_ = 'environmentEntity' elif nodeName_ == 'environmentOrganismStrain': obj_ = POCP_MT080200UV_OrganismStrain.factory() obj_.build(child_) self.environmentOrganismStrain = obj_ obj_.original_tagname_ = 'environmentOrganismStrain' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT080200UV_Product.factory() obj_.build(child_) self.productOf = obj_ obj_.original_tagname_ = 'productOf'
# end class POCP_MT080200UV_PresentSubstance
[docs]class POCP_MT080200UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, derivation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.derivation = derivation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_Product.subclass: return POCP_MT080200UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_derivation(self): return self.derivation
[docs] def set_derivation(self, derivation): self.derivation = derivation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.derivation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.derivation is not None: self.derivation.export(outfile, level, namespace_, name_='derivation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'derivation': obj_ = POCP_MT080200UV_Derivation.factory() obj_.build(child_) self.derivation = obj_ obj_.original_tagname_ = 'derivation'
# end class POCP_MT080200UV_Product
[docs]class POCP_MT080200UV_SpecializedKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='GEN', realmCode=None, typeId=None, templateId=None, generalizedSpecies=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.generalizedSpecies = generalizedSpecies if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_SpecializedKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_SpecializedKind.subclass: return POCP_MT080200UV_SpecializedKind.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_SpecializedKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_generalizedSpecies(self): return self.generalizedSpecies
[docs] def set_generalizedSpecies(self, generalizedSpecies): self.generalizedSpecies = generalizedSpecies
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIsSpeciesEntity(self, value): # Validate type RoleClassIsSpeciesEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN', 'GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIsSpeciesEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIsSpeciesEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIsSpeciesEntity_patterns_, ))
validate_RoleClassIsSpeciesEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.generalizedSpecies is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.SpecializedKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.SpecializedKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.SpecializedKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.SpecializedKind'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "GEN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.SpecializedKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.generalizedSpecies is not None: self.generalizedSpecies.export(outfile, level, namespace_, name_='generalizedSpecies', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIsSpeciesEntity(self.classCode) # validate type RoleClassIsSpeciesEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'generalizedSpecies': obj_ = POCP_MT080200UV_Species.factory() obj_.build(child_) self.generalizedSpecies = obj_ obj_.original_tagname_ = 'generalizedSpecies' elif nodeName_ == 'subjectOf': obj_ = POCP_MT080200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT080200UV_SpecializedKind
[docs]class POCP_MT080200UV_Species(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='LIV', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, code=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_Species) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_Species.subclass: return POCP_MT080200UV_Species.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_Species(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassLivingSubject(self, value): # Validate type EntityClassLivingSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['LIV', 'NLIV', 'ANM', 'MIC', 'PLNT', 'PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassLivingSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassLivingSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassLivingSubject_patterns_, ))
validate_EntityClassLivingSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Species', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.Species') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.Species', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.Species'): if self.classCode != "LIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Species', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassLivingSubject(self.classCode) # validate type EntityClassLivingSubject value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code'
# end class POCP_MT080200UV_Species
[docs]class POCP_MT080200UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT080200UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT080200UV_Subject.subclass: return POCP_MT080200UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT080200UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT080200UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT080200UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT080200UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT080200UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT080200UV_Subject
[docs]class POCP_MT081100UV_ActiveMoiety(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACTM', realmCode=None, typeId=None, templateId=None, quantity=None, activeMoiety=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.activeMoiety = activeMoiety if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT081100UV_ActiveMoiety) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT081100UV_ActiveMoiety.subclass: return POCP_MT081100UV_ActiveMoiety.subclass(*args_, **kwargs_) else: return POCP_MT081100UV_ActiveMoiety(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_activeMoiety(self): return self.activeMoiety
[docs] def set_activeMoiety(self, activeMoiety): self.activeMoiety = activeMoiety
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassActiveMoiety(self, value): # Validate type RoleClassActiveMoiety, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassActiveMoiety' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassActiveMoiety_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassActiveMoiety_patterns_, ))
validate_RoleClassActiveMoiety_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.activeMoiety is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT081100UV.ActiveMoiety', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT081100UV.ActiveMoiety') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT081100UV.ActiveMoiety', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT081100UV.ActiveMoiety'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACTM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT081100UV.ActiveMoiety', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.activeMoiety is not None: self.activeMoiety.export(outfile, level, namespace_, name_='activeMoiety', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassActiveMoiety(self.classCode) # validate type RoleClassActiveMoiety
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'activeMoiety': obj_ = POCP_MT081100UV_ActiveMoietyEntity.factory() obj_.build(child_) self.activeMoiety = obj_ obj_.original_tagname_ = 'activeMoiety' elif nodeName_ == 'subjectOf': obj_ = POCP_MT081100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT081100UV_ActiveMoiety
[docs]class POCP_MT081100UV_ActiveMoietyEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, asSpecializedKind=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT081100UV_ActiveMoietyEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT081100UV_ActiveMoietyEntity.subclass: return POCP_MT081100UV_ActiveMoietyEntity.subclass(*args_, **kwargs_) else: return POCP_MT081100UV_ActiveMoietyEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.asSpecializedKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT081100UV.ActiveMoietyEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT081100UV.ActiveMoietyEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT081100UV.ActiveMoietyEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT081100UV.ActiveMoietyEntity'): if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT081100UV.ActiveMoietyEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010300UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind'
# end class POCP_MT081100UV_ActiveMoietyEntity
[docs]class POCP_MT081100UV_EquivalentSubstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='EQUIV', realmCode=None, typeId=None, templateId=None, quantity=None, definingSubstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.definingSubstance = definingSubstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT081100UV_EquivalentSubstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT081100UV_EquivalentSubstance.subclass: return POCP_MT081100UV_EquivalentSubstance.subclass(*args_, **kwargs_) else: return POCP_MT081100UV_EquivalentSubstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_definingSubstance(self): return self.definingSubstance
[docs] def set_definingSubstance(self, definingSubstance): self.definingSubstance = definingSubstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassEquivalentEntity(self, value): # Validate type RoleClassEquivalentEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EQUIV', 'SAME', 'SUBY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassEquivalentEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassEquivalentEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassEquivalentEntity_patterns_, ))
validate_RoleClassEquivalentEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.definingSubstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT081100UV.EquivalentSubstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT081100UV.EquivalentSubstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT081100UV.EquivalentSubstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT081100UV.EquivalentSubstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "EQUIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT081100UV.EquivalentSubstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.definingSubstance is not None: self.definingSubstance.export(outfile, level, namespace_, name_='definingSubstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassEquivalentEntity(self.classCode) # validate type RoleClassEquivalentEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'definingSubstance': obj_ = POCP_MT081100UV_Substance.factory() obj_.build(child_) self.definingSubstance = obj_ obj_.original_tagname_ = 'definingSubstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT081100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT081100UV_EquivalentSubstance
[docs]class POCP_MT081100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', negationInd='false', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None, approval=None, policy=None, marketingAct=None, monitoringProgram=None, storage=None, observationGoal=None, substanceSpecification=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.negationInd = _cast(None, negationInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action self.approval = approval self.policy = policy self.marketingAct = marketingAct self.monitoringProgram = monitoringProgram self.storage = storage self.observationGoal = observationGoal self.substanceSpecification = substanceSpecification
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT081100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT081100UV_Subject.subclass: return POCP_MT081100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT081100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_marketingAct(self): return self.marketingAct
[docs] def set_marketingAct(self, marketingAct): self.marketingAct = marketingAct
[docs] def get_monitoringProgram(self): return self.monitoringProgram
[docs] def set_monitoringProgram(self, monitoringProgram): self.monitoringProgram = monitoringProgram
[docs] def get_storage(self): return self.storage
[docs] def set_storage(self, storage): self.storage = storage
[docs] def get_observationGoal(self): return self.observationGoal
[docs] def set_observationGoal(self, observationGoal): self.observationGoal = observationGoal
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_negationInd(self): return self.negationInd
[docs] def set_negationInd(self, negationInd): self.negationInd = negationInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None or self.approval is not None or self.policy is not None or self.marketingAct is not None or self.monitoringProgram is not None or self.storage is not None or self.observationGoal is not None or self.substanceSpecification is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT081100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT081100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT081100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT081100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.negationInd and 'negationInd' not in already_processed: already_processed.add('negationInd') outfile.write(' negationInd=%s' % (quote_attrib(self.negationInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT081100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.marketingAct is not None: self.marketingAct.export(outfile, level, namespace_, name_='marketingAct', pretty_print=pretty_print) if self.monitoringProgram is not None: self.monitoringProgram.export(outfile, level, namespace_, name_='monitoringProgram', pretty_print=pretty_print) if self.storage is not None: self.storage.export(outfile, level, namespace_, name_='storage', pretty_print=pretty_print) if self.observationGoal is not None: self.observationGoal.export(outfile, level, namespace_, name_='observationGoal', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject value = find_attr_value_('negationInd', node) if value is not None and 'negationInd' not in already_processed: already_processed.add('negationInd') if value in ('true', '1'): self.negationInd = True elif value in ('false', '0'): self.negationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.negationInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050100UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050100UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050100UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval' elif nodeName_ == 'policy': obj_ = POCP_MT050100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'marketingAct': obj_ = POCP_MT050100UV_MarketingAct.factory() obj_.build(child_) self.marketingAct = obj_ obj_.original_tagname_ = 'marketingAct' elif nodeName_ == 'monitoringProgram': obj_ = POCP_MT050100UV_MonitoringProgram.factory() obj_.build(child_) self.monitoringProgram = obj_ obj_.original_tagname_ = 'monitoringProgram' elif nodeName_ == 'storage': obj_ = POCP_MT050100UV_Storage.factory() obj_.build(child_) self.storage = obj_ obj_.original_tagname_ = 'storage' elif nodeName_ == 'observationGoal': obj_ = POCP_MT050100UV_ObservationGoal.factory() obj_.build(child_) self.observationGoal = obj_ obj_.original_tagname_ = 'observationGoal' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification'
# end class POCP_MT081100UV_Subject
[docs]class POCP_MT081100UV_Substance(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, asSpecializedKind=None, activeMoiety=None, asEquivalentSubstance=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind if activeMoiety is None: self.activeMoiety = [] else: self.activeMoiety = activeMoiety self.asEquivalentSubstance = asEquivalentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT081100UV_Substance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT081100UV_Substance.subclass: return POCP_MT081100UV_Substance.subclass(*args_, **kwargs_) else: return POCP_MT081100UV_Substance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_activeMoiety(self): return self.activeMoiety
[docs] def set_activeMoiety(self, activeMoiety): self.activeMoiety = activeMoiety
[docs] def add_activeMoiety(self, value): self.activeMoiety.append(value)
[docs] def insert_activeMoiety_at(self, index, value): self.activeMoiety.insert(index, value)
[docs] def replace_activeMoiety_at(self, index, value): self.activeMoiety[index] = value
[docs] def get_asEquivalentSubstance(self): return self.asEquivalentSubstance
[docs] def set_asEquivalentSubstance(self, asEquivalentSubstance): self.asEquivalentSubstance = asEquivalentSubstance
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassMaterial(self, value): # Validate type EntityClassMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MAT', 'CHEM', 'FOOD', 'MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassMaterial_patterns_, ))
validate_EntityClassMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.asSpecializedKind or self.activeMoiety or self.asEquivalentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT081100UV.Substance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT081100UV.Substance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT081100UV.Substance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT081100UV.Substance'): if self.classCode != "MAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT081100UV.Substance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) for activeMoiety_ in self.activeMoiety: activeMoiety_.export(outfile, level, namespace_, name_='activeMoiety', pretty_print=pretty_print) if self.asEquivalentSubstance is not None: self.asEquivalentSubstance.export(outfile, level, namespace_, name_='asEquivalentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassMaterial(self.classCode) # validate type EntityClassMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010300UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'activeMoiety': obj_ = POCP_MT081100UV_ActiveMoiety.factory() obj_.build(child_) self.activeMoiety.append(obj_) obj_.original_tagname_ = 'activeMoiety' elif nodeName_ == 'asEquivalentSubstance': obj_ = POCP_MT081100UV_EquivalentSubstance.factory() obj_.build(child_) self.asEquivalentSubstance = obj_ obj_.original_tagname_ = 'asEquivalentSubstance'
# end class POCP_MT081100UV_Substance
[docs]class POCP_MT082100UV_Bond(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='BOND', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, positionNumber=None, distalMoiety=None, subjectOf=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity if positionNumber is None: self.positionNumber = [] else: self.positionNumber = positionNumber self.distalMoiety = distalMoiety if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Bond) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Bond.subclass: return POCP_MT082100UV_Bond.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Bond(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_positionNumber(self): return self.positionNumber
[docs] def set_positionNumber(self, positionNumber): self.positionNumber = positionNumber
[docs] def add_positionNumber(self, value): self.positionNumber.append(value)
[docs] def insert_positionNumber_at(self, index, value): self.positionNumber.insert(index, value)
[docs] def replace_positionNumber_at(self, index, value): self.positionNumber[index] = value
[docs] def get_distalMoiety(self): return self.distalMoiety
[docs] def set_distalMoiety(self, distalMoiety): self.distalMoiety = distalMoiety
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassMolecularBond(self, value): # Validate type RoleClassMolecularBond, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['BOND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassMolecularBond' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassMolecularBond_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassMolecularBond_patterns_, ))
validate_RoleClassMolecularBond_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.positionNumber or self.distalMoiety is not None or self.subjectOf or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Bond', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Bond') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Bond', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Bond'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "BOND" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Bond', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) for positionNumber_ in self.positionNumber: positionNumber_.export(outfile, level, namespace_, name_='positionNumber', pretty_print=pretty_print) if self.distalMoiety is not None: self.distalMoiety.export(outfile, level, namespace_, name_='distalMoiety', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassMolecularBond(self.classCode) # validate type RoleClassMolecularBond
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'positionNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.positionNumber.append(obj_) obj_.original_tagname_ = 'positionNumber' elif nodeName_ == 'distalMoiety': obj_ = POCP_MT082100UV_Moiety1.factory() obj_.build(child_) self.distalMoiety = obj_ obj_.original_tagname_ = 'distalMoiety' elif nodeName_ == 'subjectOf': obj_ = POCP_MT082100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT082100UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT082100UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT082100UV_Bond
[docs]class POCP_MT082100UV_Component(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, splitCode=None, joinCode=None, derivationProcess=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.splitCode = splitCode self.joinCode = joinCode self.derivationProcess = derivationProcess
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Component) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Component.subclass: return POCP_MT082100UV_Component.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_splitCode(self): return self.splitCode
[docs] def set_splitCode(self, splitCode): self.splitCode = splitCode
[docs] def get_joinCode(self): return self.joinCode
[docs] def set_joinCode(self, joinCode): self.joinCode = joinCode
[docs] def get_derivationProcess(self): return self.derivationProcess
[docs] def set_derivationProcess(self, derivationProcess): self.derivationProcess = derivationProcess
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.splitCode is not None or self.joinCode is not None or self.derivationProcess is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Component', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Component') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Component', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Component'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Component', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.splitCode is not None: self.splitCode.export(outfile, level, namespace_, name_='splitCode', pretty_print=pretty_print) if self.joinCode is not None: self.joinCode.export(outfile, level, namespace_, name_='joinCode', pretty_print=pretty_print) if self.derivationProcess is not None: self.derivationProcess.export(outfile, level, namespace_, name_='derivationProcess', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'splitCode': obj_ = CS.factory() obj_.build(child_) self.splitCode = obj_ obj_.original_tagname_ = 'splitCode' elif nodeName_ == 'joinCode': obj_ = CS.factory() obj_.build(child_) self.joinCode = obj_ obj_.original_tagname_ = 'joinCode' elif nodeName_ == 'derivationProcess': obj_ = POCP_MT082100UV_DerivationProcess.factory() obj_.build(child_) self.derivationProcess = obj_ obj_.original_tagname_ = 'derivationProcess'
# end class POCP_MT082100UV_Component
[docs]class POCP_MT082100UV_ControlVariable(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CTRLV', realmCode=None, typeId=None, templateId=None, characteristic=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.characteristic = characteristic
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_ControlVariable) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_ControlVariable.subclass: return POCP_MT082100UV_ControlVariable.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_ControlVariable(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasControlVariable(self, value): # Validate type ActRelationshipHasControlVariable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CTRLV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasControlVariable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasControlVariable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasControlVariable_patterns_, ))
validate_ActRelationshipHasControlVariable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.characteristic is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.ControlVariable', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.ControlVariable') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.ControlVariable', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.ControlVariable'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CTRLV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.ControlVariable', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasControlVariable(self.typeCode) # validate type ActRelationshipHasControlVariable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'characteristic': obj_ = POCP_MT050500UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic'
# end class POCP_MT082100UV_ControlVariable
[docs]class POCP_MT082100UV_DerivationProcess(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, effectiveTime=None, interactor=None, generalization=None, controlVariable=None, component=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.effectiveTime = effectiveTime if interactor is None: self.interactor = [] else: self.interactor = interactor if generalization is None: self.generalization = [] else: self.generalization = generalization if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if component is None: self.component = [] else: self.component = component if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_DerivationProcess) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_DerivationProcess.subclass: return POCP_MT082100UV_DerivationProcess.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_DerivationProcess(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_generalization(self): return self.generalization
[docs] def set_generalization(self, generalization): self.generalization = generalization
[docs] def add_generalization(self, value): self.generalization.append(value)
[docs] def insert_generalization_at(self, index, value): self.generalization.insert(index, value)
[docs] def replace_generalization_at(self, index, value): self.generalization[index] = value
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.effectiveTime is not None or self.interactor or self.generalization or self.controlVariable or self.component or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.DerivationProcess', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.DerivationProcess') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.DerivationProcess', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.DerivationProcess'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.DerivationProcess', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for generalization_ in self.generalization: generalization_.export(outfile, level, namespace_, name_='generalization', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'interactor': obj_ = POCP_MT082100UV_Interactor2.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'generalization': obj_ = POCP_MT082100UV_Generalization1.factory() obj_.build(child_) self.generalization.append(obj_) obj_.original_tagname_ = 'generalization' elif nodeName_ == 'controlVariable': obj_ = POCP_MT082100UV_ControlVariable.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'component': obj_ = POCP_MT082100UV_Component.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component' elif nodeName_ == 'subjectOf': obj_ = POCP_MT082100UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT082100UV_DerivationProcess
[docs]class POCP_MT082100UV_EquivalentSubstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='EQUIV', realmCode=None, typeId=None, templateId=None, code=None, statusCode=None, effectiveTime=None, definingSubstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime self.definingSubstance = definingSubstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_EquivalentSubstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_EquivalentSubstance.subclass: return POCP_MT082100UV_EquivalentSubstance.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_EquivalentSubstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_definingSubstance(self): return self.definingSubstance
[docs] def set_definingSubstance(self, definingSubstance): self.definingSubstance = definingSubstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassEquivalentEntity(self, value): # Validate type RoleClassEquivalentEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EQUIV', 'SAME', 'SUBY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassEquivalentEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassEquivalentEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassEquivalentEntity_patterns_, ))
validate_RoleClassEquivalentEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.statusCode is not None or self.effectiveTime is not None or self.definingSubstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.EquivalentSubstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.EquivalentSubstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.EquivalentSubstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.EquivalentSubstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "EQUIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.EquivalentSubstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.definingSubstance is not None: self.definingSubstance.export(outfile, level, namespace_, name_='definingSubstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassEquivalentEntity(self.classCode) # validate type RoleClassEquivalentEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'definingSubstance': obj_ = POCP_MT082100UV_Substance.factory() obj_.build(child_) self.definingSubstance = obj_ obj_.original_tagname_ = 'definingSubstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT082100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT082100UV_EquivalentSubstance
[docs]class POCP_MT082100UV_Generalization1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='GEN', realmCode=None, typeId=None, templateId=None, derivationProcess=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.derivationProcess = derivationProcess
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Generalization1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Generalization1.subclass: return POCP_MT082100UV_Generalization1.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Generalization1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_derivationProcess(self): return self.derivationProcess
[docs] def set_derivationProcess(self, derivationProcess): self.derivationProcess = derivationProcess
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasGeneralization(self, value): # Validate type ActRelationshipHasGeneralization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasGeneralization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasGeneralization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasGeneralization_patterns_, ))
validate_ActRelationshipHasGeneralization_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.derivationProcess is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Generalization1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Generalization1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Generalization1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Generalization1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "GEN" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Generalization1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.derivationProcess is not None: self.derivationProcess.export(outfile, level, namespace_, name_='derivationProcess', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasGeneralization(self.typeCode) # validate type ActRelationshipHasGeneralization
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'derivationProcess': obj_ = POCP_MT082100UV_DerivationProcess.factory() obj_.build(child_) self.derivationProcess = obj_ obj_.original_tagname_ = 'derivationProcess'
# end class POCP_MT082100UV_Generalization1
[docs]class POCP_MT082100UV_Generalization2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='GEN', realmCode=None, typeId=None, templateId=None, interaction=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.interaction = interaction
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Generalization2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Generalization2.subclass: return POCP_MT082100UV_Generalization2.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Generalization2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_interaction(self): return self.interaction
[docs] def set_interaction(self, interaction): self.interaction = interaction
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasGeneralization(self, value): # Validate type ActRelationshipHasGeneralization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasGeneralization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasGeneralization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasGeneralization_patterns_, ))
validate_ActRelationshipHasGeneralization_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.interaction is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Generalization2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Generalization2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Generalization2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Generalization2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "GEN" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Generalization2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.interaction is not None: self.interaction.export(outfile, level, namespace_, name_='interaction', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasGeneralization(self.typeCode) # validate type ActRelationshipHasGeneralization
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'interaction': obj_ = POCP_MT082100UV_Interaction.factory() obj_.build(child_) self.interaction = obj_ obj_.original_tagname_ = 'interaction'
# end class POCP_MT082100UV_Generalization2
[docs]class POCP_MT082100UV_IdentifiedSubstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, id=None, code=None, statusCode=None, effectiveTime=None, confidentialityCode=None, identifiedSubstance=None, assigningTerritory=None, assigningOrganization=None, subjectOf=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.identifiedSubstance = identifiedSubstance self.assigningTerritory = assigningTerritory self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_IdentifiedSubstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_IdentifiedSubstance.subclass: return POCP_MT082100UV_IdentifiedSubstance.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_IdentifiedSubstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_assigningTerritory(self): return self.assigningTerritory
[docs] def set_assigningTerritory(self, assigningTerritory): self.assigningTerritory = assigningTerritory
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.statusCode is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.identifiedSubstance is not None or self.assigningTerritory is not None or self.assigningOrganization is not None or self.subjectOf or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.IdentifiedSubstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.IdentifiedSubstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.IdentifiedSubstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.IdentifiedSubstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.IdentifiedSubstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.assigningTerritory is not None: self.assigningTerritory.export(outfile, level, namespace_, name_='assigningTerritory', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT082100UV_Substance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'assigningTerritory': obj_ = POCP_MT082100UV_Territory.factory() obj_.build(child_) self.assigningTerritory = obj_ obj_.original_tagname_ = 'assigningTerritory' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT082100UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT082100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT082100UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT082100UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT082100UV_IdentifiedSubstance
[docs]class POCP_MT082100UV_Interaction(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, interactor=None, generalization=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if interactor is None: self.interactor = [] else: self.interactor = interactor if generalization is None: self.generalization = [] else: self.generalization = generalization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Interaction) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Interaction.subclass: return POCP_MT082100UV_Interaction.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Interaction(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_interactor(self): return self.interactor
[docs] def set_interactor(self, interactor): self.interactor = interactor
[docs] def add_interactor(self, value): self.interactor.append(value)
[docs] def insert_interactor_at(self, index, value): self.interactor.insert(index, value)
[docs] def replace_interactor_at(self, index, value): self.interactor[index] = value
[docs] def get_generalization(self): return self.generalization
[docs] def set_generalization(self, generalization): self.generalization = generalization
[docs] def add_generalization(self, value): self.generalization.append(value)
[docs] def insert_generalization_at(self, index, value): self.generalization.insert(index, value)
[docs] def replace_generalization_at(self, index, value): self.generalization[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.interactor or self.generalization or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interaction', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Interaction') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Interaction', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Interaction'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interaction', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for interactor_ in self.interactor: interactor_.export(outfile, level, namespace_, name_='interactor', pretty_print=pretty_print) for generalization_ in self.generalization: generalization_.export(outfile, level, namespace_, name_='generalization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'interactor': obj_ = POCP_MT082100UV_Interactor.factory() obj_.build(child_) self.interactor.append(obj_) obj_.original_tagname_ = 'interactor' elif nodeName_ == 'generalization': obj_ = POCP_MT082100UV_Generalization2.factory() obj_.build(child_) self.generalization.append(obj_) obj_.original_tagname_ = 'generalization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT082100UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT082100UV_Interaction
[docs]class POCP_MT082100UV_Interactor(GeneratedsSuper): subclass = None superclass = None def __init__(self, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, presentSubstance=None): self.original_tagname_ = None self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Interactor) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Interactor.subclass: return POCP_MT082100UV_Interactor.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Interactor(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interactor', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Interactor') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Interactor', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Interactor'): if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interactor', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT082100UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT082100UV_Interactor
[docs]class POCP_MT082100UV_Interactor2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, identifiedSubstance=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.identifiedSubstance = identifiedSubstance self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Interactor2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Interactor2.subclass: return POCP_MT082100UV_Interactor2.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Interactor2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_identifiedSubstance(self): return self.identifiedSubstance
[docs] def set_identifiedSubstance(self, identifiedSubstance): self.identifiedSubstance = identifiedSubstance
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.identifiedSubstance is not None or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interactor2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Interactor2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Interactor2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Interactor2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interactor2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.identifiedSubstance is not None: self.identifiedSubstance.export(outfile, level, namespace_, name_='identifiedSubstance', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'identifiedSubstance': obj_ = POCP_MT082100UV_IdentifiedSubstance.factory() obj_.build(child_) self.identifiedSubstance = obj_ obj_.original_tagname_ = 'identifiedSubstance' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT082100UV_Interactor2
[docs]class POCP_MT082100UV_Interactor3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, interaction=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.interaction = interaction
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Interactor3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Interactor3.subclass: return POCP_MT082100UV_Interactor3.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Interactor3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_interaction(self): return self.interaction
[docs] def set_interaction(self, interaction): self.interaction = interaction
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ReactionParticipant(self, value): # Validate type ReactionParticipant, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAT', 'CSM', 'PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ReactionParticipant' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ReactionParticipant_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ReactionParticipant_patterns_, ))
validate_ReactionParticipant_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.interaction is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interactor3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Interactor3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Interactor3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Interactor3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Interactor3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.interaction is not None: self.interaction.export(outfile, level, namespace_, name_='interaction', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ReactionParticipant(self.typeCode) # validate type ReactionParticipant
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'interaction': obj_ = POCP_MT082100UV_Interaction.factory() obj_.build(child_) self.interaction = obj_ obj_.original_tagname_ = 'interaction'
# end class POCP_MT082100UV_Interactor3
[docs]class POCP_MT082100UV_Moiety1(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, id=None, code=None, name=None, asSpecializedKind=None, bond=None, moiety=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code if name is None: self.name = [] else: self.name = name if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind if bond is None: self.bond = [] else: self.bond = bond if moiety is None: self.moiety = [] else: self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Moiety1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Moiety1.subclass: return POCP_MT082100UV_Moiety1.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Moiety1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_bond(self): return self.bond
[docs] def set_bond(self, bond): self.bond = bond
[docs] def add_bond(self, value): self.bond.append(value)
[docs] def insert_bond_at(self, index, value): self.bond.insert(index, value)
[docs] def replace_bond_at(self, index, value): self.bond[index] = value
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def add_moiety(self, value): self.moiety.append(value)
[docs] def insert_moiety_at(self, index, value): self.moiety.insert(index, value)
[docs] def replace_moiety_at(self, index, value): self.moiety[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.name or self.asSpecializedKind or self.bond or self.moiety ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Moiety1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Moiety1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Moiety1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Moiety1'): if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Moiety1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) for bond_ in self.bond: bond_.export(outfile, level, namespace_, name_='bond', pretty_print=pretty_print) for moiety_ in self.moiety: moiety_.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010300UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'bond': obj_ = POCP_MT082100UV_Bond.factory() obj_.build(child_) self.bond.append(obj_) obj_.original_tagname_ = 'bond' elif nodeName_ == 'moiety': obj_ = POCP_MT082100UV_Moiety2.factory() obj_.build(child_) self.moiety.append(obj_) obj_.original_tagname_ = 'moiety'
# end class POCP_MT082100UV_Moiety1
[docs]class POCP_MT082100UV_Moiety2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, positionNumber=None, partMoiety=None, subjectOf=None, productOf=None, interactsIn=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity if positionNumber is None: self.positionNumber = [] else: self.positionNumber = positionNumber self.partMoiety = partMoiety if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if interactsIn is None: self.interactsIn = [] else: self.interactsIn = interactsIn
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Moiety2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Moiety2.subclass: return POCP_MT082100UV_Moiety2.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Moiety2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_positionNumber(self): return self.positionNumber
[docs] def set_positionNumber(self, positionNumber): self.positionNumber = positionNumber
[docs] def add_positionNumber(self, value): self.positionNumber.append(value)
[docs] def insert_positionNumber_at(self, index, value): self.positionNumber.insert(index, value)
[docs] def replace_positionNumber_at(self, index, value): self.positionNumber[index] = value
[docs] def get_partMoiety(self): return self.partMoiety
[docs] def set_partMoiety(self, partMoiety): self.partMoiety = partMoiety
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_interactsIn(self): return self.interactsIn
[docs] def set_interactsIn(self, interactsIn): self.interactsIn = interactsIn
[docs] def add_interactsIn(self, value): self.interactsIn.append(value)
[docs] def insert_interactsIn_at(self, index, value): self.interactsIn.insert(index, value)
[docs] def replace_interactsIn_at(self, index, value): self.interactsIn[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.positionNumber or self.partMoiety is not None or self.subjectOf or self.productOf or self.interactsIn ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Moiety2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Moiety2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Moiety2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Moiety2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Moiety2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) for positionNumber_ in self.positionNumber: positionNumber_.export(outfile, level, namespace_, name_='positionNumber', pretty_print=pretty_print) if self.partMoiety is not None: self.partMoiety.export(outfile, level, namespace_, name_='partMoiety', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for interactsIn_ in self.interactsIn: interactsIn_.export(outfile, level, namespace_, name_='interactsIn', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'positionNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.positionNumber.append(obj_) obj_.original_tagname_ = 'positionNumber' elif nodeName_ == 'partMoiety': obj_ = POCP_MT082100UV_Moiety1.factory() obj_.build(child_) self.partMoiety = obj_ obj_.original_tagname_ = 'partMoiety' elif nodeName_ == 'subjectOf': obj_ = POCP_MT082100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT082100UV_Product.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'interactsIn': obj_ = POCP_MT082100UV_Interactor3.factory() obj_.build(child_) self.interactsIn.append(obj_) obj_.original_tagname_ = 'interactsIn'
# end class POCP_MT082100UV_Moiety2
[docs]class POCP_MT082100UV_NamedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, code=None, name=None, statusCode=None, effectiveTime=None, assigningTerritory=None, assigningOrganization=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.statusCode = statusCode self.effectiveTime = effectiveTime self.assigningTerritory = assigningTerritory self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_NamedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_NamedEntity.subclass: return POCP_MT082100UV_NamedEntity.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_NamedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_assigningTerritory(self): return self.assigningTerritory
[docs] def set_assigningTerritory(self, assigningTerritory): self.assigningTerritory = assigningTerritory
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.statusCode is not None or self.effectiveTime is not None or self.assigningTerritory is not None or self.assigningOrganization is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.NamedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.NamedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.NamedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.NamedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.NamedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.assigningTerritory is not None: self.assigningTerritory.export(outfile, level, namespace_, name_='assigningTerritory', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'assigningTerritory': obj_ = POCP_MT082100UV_Territory.factory() obj_.build(child_) self.assigningTerritory = obj_ obj_.original_tagname_ = 'assigningTerritory' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT082100UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT082100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT082100UV_NamedEntity
[docs]class POCP_MT082100UV_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, territorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.name = name if territorialAuthority is None: self.territorialAuthority = [] else: self.territorialAuthority = territorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Organization.subclass: return POCP_MT082100UV_Organization.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_territorialAuthority(self): return self.territorialAuthority
[docs] def set_territorialAuthority(self, territorialAuthority): self.territorialAuthority = territorialAuthority
[docs] def add_territorialAuthority(self, value): self.territorialAuthority.append(value)
[docs] def insert_territorialAuthority_at(self, index, value): self.territorialAuthority.insert(index, value)
[docs] def replace_territorialAuthority_at(self, index, value): self.territorialAuthority[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.name is not None or self.territorialAuthority ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Organization'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for territorialAuthority_ in self.territorialAuthority: territorialAuthority_.export(outfile, level, namespace_, name_='territorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'territorialAuthority': obj_ = POCP_MT082100UV_TerritorialAuthority.factory() obj_.build(child_) self.territorialAuthority.append(obj_) obj_.original_tagname_ = 'territorialAuthority'
# end class POCP_MT082100UV_Organization
[docs]class POCP_MT082100UV_Policy(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='POLICY', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, statusCode=None, effectiveTime=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.statusCode = statusCode self.effectiveTime = effectiveTime
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Policy) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Policy.subclass: return POCP_MT082100UV_Policy.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Policy(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_statusCode(self): return self.statusCode
[docs] def set_statusCode(self, statusCode): self.statusCode = statusCode
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassPolicy(self, value): # Validate type ActClassPolicy, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEADrugSchedule', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassPolicy' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassPolicy_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassPolicy_patterns_, ))
validate_ActClassPolicy_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.statusCode is not None or self.effectiveTime is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Policy', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Policy') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Policy', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Policy'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "POLICY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Policy', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.statusCode is not None: self.statusCode.export(outfile, level, namespace_, name_='statusCode', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassPolicy(self.classCode) # validate type ActClassPolicy value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'statusCode': obj_ = CS.factory() obj_.build(child_) self.statusCode = obj_ obj_.original_tagname_ = 'statusCode' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime'
# end class POCP_MT082100UV_Policy
[docs]class POCP_MT082100UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, functionCode=None, quantity=None, derivationProcess=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.functionCode = functionCode self.quantity = quantity self.derivationProcess = derivationProcess
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Product.subclass: return POCP_MT082100UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_functionCode(self): return self.functionCode
[docs] def set_functionCode(self, functionCode): self.functionCode = functionCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_derivationProcess(self): return self.derivationProcess
[docs] def set_derivationProcess(self, derivationProcess): self.derivationProcess = derivationProcess
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.functionCode is not None or self.quantity is not None or self.derivationProcess is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.functionCode is not None: self.functionCode.export(outfile, level, namespace_, name_='functionCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.derivationProcess is not None: self.derivationProcess.export(outfile, level, namespace_, name_='derivationProcess', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'functionCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.functionCode = obj_ obj_.original_tagname_ = 'functionCode' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'derivationProcess': obj_ = POCP_MT082100UV_DerivationProcess.factory() obj_.build(child_) self.derivationProcess = obj_ obj_.original_tagname_ = 'derivationProcess'
# end class POCP_MT082100UV_Product
[docs]class POCP_MT082100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, policy=None, substanceSpecification=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.policy = policy self.substanceSpecification = substanceSpecification self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Subject.subclass: return POCP_MT082100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.policy is not None or self.substanceSpecification is not None or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'policy': obj_ = POCP_MT082100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT082100UV_Subject
[docs]class POCP_MT082100UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, policy=None, substanceSpecification=None, document=None, characteristic=None, action=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.policy = policy self.substanceSpecification = substanceSpecification self.document = document self.characteristic = characteristic self.action = action
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Subject2.subclass: return POCP_MT082100UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.policy is not None or self.substanceSpecification is not None or self.document is not None or self.characteristic is not None or self.action is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'policy': obj_ = POCP_MT082100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification' elif nodeName_ == 'document': obj_ = POCP_MT050600UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050600UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050600UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action'
# end class POCP_MT082100UV_Subject2
[docs]class POCP_MT082100UV_Substance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, asNamedEntity=None, asEquivalentSubstance=None, asSpecializedKind=None, moiety=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if asEquivalentSubstance is None: self.asEquivalentSubstance = [] else: self.asEquivalentSubstance = asEquivalentSubstance if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind if moiety is None: self.moiety = [] else: self.moiety = moiety
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Substance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Substance.subclass: return POCP_MT082100UV_Substance.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Substance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_asEquivalentSubstance(self): return self.asEquivalentSubstance
[docs] def set_asEquivalentSubstance(self, asEquivalentSubstance): self.asEquivalentSubstance = asEquivalentSubstance
[docs] def add_asEquivalentSubstance(self, value): self.asEquivalentSubstance.append(value)
[docs] def insert_asEquivalentSubstance_at(self, index, value): self.asEquivalentSubstance.insert(index, value)
[docs] def replace_asEquivalentSubstance_at(self, index, value): self.asEquivalentSubstance[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_moiety(self): return self.moiety
[docs] def set_moiety(self, moiety): self.moiety = moiety
[docs] def add_moiety(self, value): self.moiety.append(value)
[docs] def insert_moiety_at(self, index, value): self.moiety.insert(index, value)
[docs] def replace_moiety_at(self, index, value): self.moiety[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.asNamedEntity or self.asEquivalentSubstance or self.asSpecializedKind or self.moiety ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Substance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Substance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Substance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Substance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Substance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for asEquivalentSubstance_ in self.asEquivalentSubstance: asEquivalentSubstance_.export(outfile, level, namespace_, name_='asEquivalentSubstance', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) for moiety_ in self.moiety: moiety_.export(outfile, level, namespace_, name_='moiety', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT082100UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'asEquivalentSubstance': obj_ = POCP_MT082100UV_EquivalentSubstance.factory() obj_.build(child_) self.asEquivalentSubstance.append(obj_) obj_.original_tagname_ = 'asEquivalentSubstance' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010300UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'moiety': obj_ = POCP_MT082100UV_Moiety2.factory() obj_.build(child_) self.moiety.append(obj_) obj_.original_tagname_ = 'moiety'
# end class POCP_MT082100UV_Substance
[docs]class POCP_MT082100UV_TerritorialAuthority(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, territory=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.territory = territory
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_TerritorialAuthority) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_TerritorialAuthority.subclass: return POCP_MT082100UV_TerritorialAuthority.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_TerritorialAuthority(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_territory(self): return self.territory
[docs] def set_territory(self, territory): self.territory = territory
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.territory is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.TerritorialAuthority') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.territory is not None: self.territory.export(outfile, level, namespace_, name_='territory', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'territory': obj_ = POCP_MT082100UV_Territory.factory() obj_.build(child_) self.territory = obj_ obj_.original_tagname_ = 'territory'
# end class POCP_MT082100UV_TerritorialAuthority
[docs]class POCP_MT082100UV_TerritorialAuthority1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='TERR', realmCode=None, typeId=None, templateId=None, governingOrganization=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.governingOrganization = governingOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_TerritorialAuthority1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_TerritorialAuthority1.subclass: return POCP_MT082100UV_TerritorialAuthority1.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_TerritorialAuthority1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_governingOrganization(self): return self.governingOrganization
[docs] def set_governingOrganization(self, governingOrganization): self.governingOrganization = governingOrganization
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassTerritoryOfAuthority(self, value): # Validate type RoleClassTerritoryOfAuthority, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TERR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassTerritoryOfAuthority' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassTerritoryOfAuthority_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassTerritoryOfAuthority_patterns_, ))
validate_RoleClassTerritoryOfAuthority_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.governingOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.TerritorialAuthority1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "TERR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.TerritorialAuthority1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.governingOrganization is not None: self.governingOrganization.export(outfile, level, namespace_, name_='governingOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassTerritoryOfAuthority(self.classCode) # validate type RoleClassTerritoryOfAuthority
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'governingOrganization': obj_ = POCP_MT082100UV_Organization.factory() obj_.build(child_) self.governingOrganization = obj_ obj_.original_tagname_ = 'governingOrganization'
# end class POCP_MT082100UV_TerritorialAuthority1
[docs]class POCP_MT082100UV_Territory(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='STATE', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, code=None, name=None, asTerritorialAuthority=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name if asTerritorialAuthority is None: self.asTerritorialAuthority = [] else: self.asTerritorialAuthority = asTerritorialAuthority
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT082100UV_Territory) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT082100UV_Territory.subclass: return POCP_MT082100UV_Territory.subclass(*args_, **kwargs_) else: return POCP_MT082100UV_Territory(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_asTerritorialAuthority(self): return self.asTerritorialAuthority
[docs] def set_asTerritorialAuthority(self, asTerritorialAuthority): self.asTerritorialAuthority = asTerritorialAuthority
[docs] def add_asTerritorialAuthority(self, value): self.asTerritorialAuthority.append(value)
[docs] def insert_asTerritorialAuthority_at(self, index, value): self.asTerritorialAuthority.insert(index, value)
[docs] def replace_asTerritorialAuthority_at(self, index, value): self.asTerritorialAuthority[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassState(self, value): # Validate type EntityClassState, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassState' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassState_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassState_patterns_, ))
validate_EntityClassState_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.asTerritorialAuthority ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Territory', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT082100UV.Territory') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT082100UV.Territory', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT082100UV.Territory'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "STATE" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT082100UV.Territory', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for asTerritorialAuthority_ in self.asTerritorialAuthority: asTerritorialAuthority_.export(outfile, level, namespace_, name_='asTerritorialAuthority', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassState(self.classCode) # validate type EntityClassState value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'asTerritorialAuthority': obj_ = POCP_MT082100UV_TerritorialAuthority1.factory() obj_.build(child_) self.asTerritorialAuthority.append(obj_) obj_.original_tagname_ = 'asTerritorialAuthority'
# end class POCP_MT082100UV_Territory
[docs]class POCP_MT010200UV_ActDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, primaryPerformer=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime if primaryPerformer is None: self.primaryPerformer = [] else: self.primaryPerformer = primaryPerformer self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_ActDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_ActDefinition.subclass: return POCP_MT010200UV_ActDefinition.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_ActDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_primaryPerformer(self): return self.primaryPerformer
[docs] def set_primaryPerformer(self, primaryPerformer): self.primaryPerformer = primaryPerformer
[docs] def add_primaryPerformer(self, value): self.primaryPerformer.append(value)
[docs] def insert_primaryPerformer_at(self, index, value): self.primaryPerformer.insert(index, value)
[docs] def replace_primaryPerformer_at(self, index, value): self.primaryPerformer[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.primaryPerformer or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ActDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.ActDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.ActDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.ActDefinition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ActDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for primaryPerformer_ in self.primaryPerformer: primaryPerformer_.export(outfile, level, namespace_, name_='primaryPerformer', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'primaryPerformer': obj_ = POCP_MT010200UV_PrimaryPerformer.factory() obj_.build(child_) self.primaryPerformer.append(obj_) obj_.original_tagname_ = 'primaryPerformer' elif nodeName_ == 'author': obj_ = POCP_MT010200UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010200UV_ActDefinition
[docs]class POCP_MT010200UV_AdministerableMaterial(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ADMM', realmCode=None, typeId=None, templateId=None, administrableProduct=None, subjectOf=None, consumedIn=None, productOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.administrableProduct = administrableProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_AdministerableMaterial) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_AdministerableMaterial.subclass: return POCP_MT010200UV_AdministerableMaterial.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_AdministerableMaterial(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_administrableProduct(self): return self.administrableProduct
[docs] def set_administrableProduct(self, administrableProduct): self.administrableProduct = administrableProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAdministerableMaterial(self, value): # Validate type RoleClassAdministerableMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADMM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAdministerableMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAdministerableMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAdministerableMaterial_patterns_, ))
validate_RoleClassAdministerableMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.administrableProduct is not None or self.subjectOf or self.consumedIn or self.productOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.AdministerableMaterial', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.AdministerableMaterial') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.AdministerableMaterial', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.AdministerableMaterial'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ADMM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.AdministerableMaterial', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.administrableProduct is not None: self.administrableProduct.export(outfile, level, namespace_, name_='administrableProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAdministerableMaterial(self.classCode) # validate type RoleClassAdministerableMaterial
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'administrableProduct': obj_ = POCP_MT010200UV_Product.factory() obj_.build(child_) self.administrableProduct = obj_ obj_.original_tagname_ = 'administrableProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010200UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010200UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf'
# end class POCP_MT010200UV_AdministerableMaterial
[docs]class POCP_MT010200UV_Author(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Author) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Author.subclass: return POCP_MT010200UV_Author.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Author(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Author', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Author') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Author', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Author'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Author', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT010200UV_Author
[docs]class POCP_MT010200UV_Consumable1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, substanceAdministration=None, substanceAdministration1=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.substanceAdministration = substanceAdministration self.substanceAdministration1 = substanceAdministration1
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Consumable1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Consumable1.subclass: return POCP_MT010200UV_Consumable1.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Consumable1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_substanceAdministration1(self): return self.substanceAdministration1
[docs] def set_substanceAdministration1(self, substanceAdministration1): self.substanceAdministration1 = substanceAdministration1
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.substanceAdministration is not None or self.substanceAdministration1 is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Consumable1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Consumable1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Consumable1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Consumable1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Consumable1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print) if self.substanceAdministration1 is not None: self.substanceAdministration1.export(outfile, level, namespace_, name_='substanceAdministration1', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT010200UV_SubstanceAdministration.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration' elif nodeName_ == 'substanceAdministration1': obj_ = POCP_MT060100UV_SubstanceAdministration1.factory() obj_.build(child_) self.substanceAdministration1 = obj_ obj_.original_tagname_ = 'substanceAdministration1'
# end class POCP_MT010200UV_Consumable1
[docs]class POCP_MT010200UV_Consumable2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, quantity=None, manufacturedProduct1=None, content1=None, content2=None, administerableMaterial=None, manufacturedProduct2=None, part=None, manufacturedProduct3=None, ingredient=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.manufacturedProduct1 = manufacturedProduct1 self.content1 = content1 self.content2 = content2 self.administerableMaterial = administerableMaterial self.manufacturedProduct2 = manufacturedProduct2 self.part = part self.manufacturedProduct3 = manufacturedProduct3 self.ingredient = ingredient
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Consumable2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Consumable2.subclass: return POCP_MT010200UV_Consumable2.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Consumable2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_manufacturedProduct1(self): return self.manufacturedProduct1
[docs] def set_manufacturedProduct1(self, manufacturedProduct1): self.manufacturedProduct1 = manufacturedProduct1
[docs] def get_content1(self): return self.content1
[docs] def set_content1(self, content1): self.content1 = content1
[docs] def get_content2(self): return self.content2
[docs] def set_content2(self, content2): self.content2 = content2
[docs] def get_administerableMaterial(self): return self.administerableMaterial
[docs] def set_administerableMaterial(self, administerableMaterial): self.administerableMaterial = administerableMaterial
[docs] def get_manufacturedProduct2(self): return self.manufacturedProduct2
[docs] def set_manufacturedProduct2(self, manufacturedProduct2): self.manufacturedProduct2 = manufacturedProduct2
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def get_manufacturedProduct3(self): return self.manufacturedProduct3
[docs] def set_manufacturedProduct3(self, manufacturedProduct3): self.manufacturedProduct3 = manufacturedProduct3
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.manufacturedProduct1 is not None or self.content1 is not None or self.content2 is not None or self.administerableMaterial is not None or self.manufacturedProduct2 is not None or self.part is not None or self.manufacturedProduct3 is not None or self.ingredient is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Consumable2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Consumable2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Consumable2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Consumable2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Consumable2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.manufacturedProduct1 is not None: self.manufacturedProduct1.export(outfile, level, namespace_, name_='manufacturedProduct1', pretty_print=pretty_print) if self.content1 is not None: self.content1.export(outfile, level, namespace_, name_='content1', pretty_print=pretty_print) if self.content2 is not None: self.content2.export(outfile, level, namespace_, name_='content2', pretty_print=pretty_print) if self.administerableMaterial is not None: self.administerableMaterial.export(outfile, level, namespace_, name_='administerableMaterial', pretty_print=pretty_print) if self.manufacturedProduct2 is not None: self.manufacturedProduct2.export(outfile, level, namespace_, name_='manufacturedProduct2', pretty_print=pretty_print) if self.part is not None: self.part.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) if self.manufacturedProduct3 is not None: self.manufacturedProduct3.export(outfile, level, namespace_, name_='manufacturedProduct3', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'manufacturedProduct1': obj_ = POCP_MT010200UV_ManufacturedProduct2.factory() obj_.build(child_) self.manufacturedProduct1 = obj_ obj_.original_tagname_ = 'manufacturedProduct1' elif nodeName_ == 'content1': obj_ = POCP_MT010200UV_Content1.factory() obj_.build(child_) self.content1 = obj_ obj_.original_tagname_ = 'content1' elif nodeName_ == 'content2': obj_ = POCP_MT010200UV_Content.factory() obj_.build(child_) self.content2 = obj_ obj_.original_tagname_ = 'content2' elif nodeName_ == 'administerableMaterial': obj_ = POCP_MT010200UV_AdministerableMaterial.factory() obj_.build(child_) self.administerableMaterial = obj_ obj_.original_tagname_ = 'administerableMaterial' elif nodeName_ == 'manufacturedProduct2': obj_ = POCP_MT010200UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct2 = obj_ obj_.original_tagname_ = 'manufacturedProduct2' elif nodeName_ == 'part': obj_ = POCP_MT010200UV_Part.factory() obj_.build(child_) self.part = obj_ obj_.original_tagname_ = 'part' elif nodeName_ == 'manufacturedProduct3': obj_ = POCP_MT010200UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct3 = obj_ obj_.original_tagname_ = 'manufacturedProduct3' elif nodeName_ == 'ingredient': obj_ = POCP_MT010200UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient'
# end class POCP_MT010200UV_Consumable2
[docs]class POCP_MT010200UV_Content(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, containerPackagedProduct=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.containerPackagedProduct = containerPackagedProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Content) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Content.subclass: return POCP_MT010200UV_Content.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Content(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_containerPackagedProduct(self): return self.containerPackagedProduct
[docs] def set_containerPackagedProduct(self, containerPackagedProduct): self.containerPackagedProduct = containerPackagedProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.containerPackagedProduct is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Content', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Content') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Content', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Content'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Content', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.containerPackagedProduct is not None: self.containerPackagedProduct.export(outfile, level, namespace_, name_='containerPackagedProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'containerPackagedProduct': obj_ = POCP_MT010200UV_PackagedProduct.factory() obj_.build(child_) self.containerPackagedProduct = obj_ obj_.original_tagname_ = 'containerPackagedProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010200UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010200UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010200UV_Content
[docs]class POCP_MT010200UV_Content1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, containerPackagedProduct=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.containerPackagedProduct = containerPackagedProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Content1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Content1.subclass: return POCP_MT010200UV_Content1.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Content1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_containerPackagedProduct(self): return self.containerPackagedProduct
[docs] def set_containerPackagedProduct(self, containerPackagedProduct): self.containerPackagedProduct = containerPackagedProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.containerPackagedProduct is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Content1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Content1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Content1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Content1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Content1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.containerPackagedProduct is not None: self.containerPackagedProduct.export(outfile, level, namespace_, name_='containerPackagedProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'containerPackagedProduct': obj_ = POCP_MT010200UV_PackagedProduct.factory() obj_.build(child_) self.containerPackagedProduct = obj_ obj_.original_tagname_ = 'containerPackagedProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010200UV_Product2.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010200UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010200UV_Content1
[docs]class POCP_MT010200UV_Device(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DEV', realmCode=None, typeId=None, templateId=None, observation=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observation = observation self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Device) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Device.subclass: return POCP_MT010200UV_Device.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Device(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observation is not None or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Device', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Device') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Device', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Device'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DEV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Device', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observation': obj_ = POCP_MT070100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation' elif nodeName_ == 'actDefinition': obj_ = POCP_MT070200UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT010200UV_Device
[docs]class POCP_MT010200UV_EntityWithGeneric(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='GRIC', realmCode=None, typeId=None, templateId=None, genericMedicine=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.genericMedicine = genericMedicine
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_EntityWithGeneric) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_EntityWithGeneric.subclass: return POCP_MT010200UV_EntityWithGeneric.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_EntityWithGeneric(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_genericMedicine(self): return self.genericMedicine
[docs] def set_genericMedicine(self, genericMedicine): self.genericMedicine = genericMedicine
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassHasGeneric(self, value): # Validate type RoleClassHasGeneric, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassHasGeneric' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassHasGeneric_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassHasGeneric_patterns_, ))
validate_RoleClassHasGeneric_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.genericMedicine is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.EntityWithGeneric', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.EntityWithGeneric') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.EntityWithGeneric', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.EntityWithGeneric'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "GRIC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.EntityWithGeneric', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.genericMedicine is not None: self.genericMedicine.export(outfile, level, namespace_, name_='genericMedicine', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassHasGeneric(self.classCode) # validate type RoleClassHasGeneric
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'genericMedicine': obj_ = POCP_MT010200UV_GenericMedicine.factory() obj_.build(child_) self.genericMedicine = obj_ obj_.original_tagname_ = 'genericMedicine'
# end class POCP_MT010200UV_EntityWithGeneric
[docs]class POCP_MT010200UV_EquivalentEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='EQUIV', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, definingMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity self.definingMaterialKind = definingMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_EquivalentEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_EquivalentEntity.subclass: return POCP_MT010200UV_EquivalentEntity.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_EquivalentEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_definingMaterialKind(self): return self.definingMaterialKind
[docs] def set_definingMaterialKind(self, definingMaterialKind): self.definingMaterialKind = definingMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassEquivalentEntity(self, value): # Validate type RoleClassEquivalentEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EQUIV', 'SAME', 'SUBY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassEquivalentEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassEquivalentEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassEquivalentEntity_patterns_, ))
validate_RoleClassEquivalentEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.definingMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.EquivalentEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.EquivalentEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.EquivalentEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.EquivalentEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "EQUIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.EquivalentEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.definingMaterialKind is not None: self.definingMaterialKind.export(outfile, level, namespace_, name_='definingMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassEquivalentEntity(self.classCode) # validate type RoleClassEquivalentEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'definingMaterialKind': obj_ = POCP_MT010200UV_MaterialKind.factory() obj_.build(child_) self.definingMaterialKind = obj_ obj_.original_tagname_ = 'definingMaterialKind'
# end class POCP_MT010200UV_EquivalentEntity
[docs]class POCP_MT010200UV_GenericMedicine(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_GenericMedicine) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_GenericMedicine.subclass: return POCP_MT010200UV_GenericMedicine.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_GenericMedicine(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.GenericMedicine', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.GenericMedicine') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.GenericMedicine', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.GenericMedicine'): if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.GenericMedicine', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010200UV_GenericMedicine
[docs]class POCP_MT010200UV_IdentifiedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, id=None, code=None, effectiveTime=None, assigningOrganization=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.effectiveTime = effectiveTime self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_IdentifiedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_IdentifiedEntity.subclass: return POCP_MT010200UV_IdentifiedEntity.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_IdentifiedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.effectiveTime is not None or self.assigningOrganization is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.IdentifiedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.IdentifiedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.IdentifiedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.IdentifiedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.IdentifiedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT010200UV_IdentifiedEntity
[docs]class POCP_MT010200UV_IndirectTarget(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='IND', realmCode=None, typeId=None, templateId=None, valuedItem=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.valuedItem = valuedItem
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_IndirectTarget) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_IndirectTarget.subclass: return POCP_MT010200UV_IndirectTarget.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_IndirectTarget(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_valuedItem(self): return self.valuedItem
[docs] def set_valuedItem(self, valuedItem): self.valuedItem = valuedItem
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationIndirectTarget(self, value): # Validate type ParticipationIndirectTarget, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IND', 'BEN', 'CAGNT', 'COV', 'GUAR', 'HLD', 'RCT', 'RCV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationIndirectTarget' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationIndirectTarget_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationIndirectTarget_patterns_, ))
validate_ParticipationIndirectTarget_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.valuedItem is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.IndirectTarget', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.IndirectTarget') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.IndirectTarget', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.IndirectTarget'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "IND" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.IndirectTarget', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.valuedItem is not None: self.valuedItem.export(outfile, level, namespace_, name_='valuedItem', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationIndirectTarget(self.typeCode) # validate type ParticipationIndirectTarget
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'valuedItem': obj_ = COCT_MT440001UV09_ValuedItem.factory() obj_.build(child_) self.valuedItem = obj_ obj_.original_tagname_ = 'valuedItem'
# end class POCP_MT010200UV_IndirectTarget
[docs]class POCP_MT010200UV_Ingredient(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='INGR', realmCode=None, typeId=None, templateId=None, id=None, effectiveTime=None, confidentialityCode=None, quantity=None, ingredientSubstance=None, subjectOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.quantity = quantity self.ingredientSubstance = ingredientSubstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Ingredient) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Ingredient.subclass: return POCP_MT010200UV_Ingredient.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Ingredient(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_ingredientSubstance(self): return self.ingredientSubstance
[docs] def set_ingredientSubstance(self, ingredientSubstance): self.ingredientSubstance = ingredientSubstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIngredientEntity(self, value): # Validate type RoleClassIngredientEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIngredientEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIngredientEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIngredientEntity_patterns_, ))
validate_RoleClassIngredientEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.quantity is not None or self.ingredientSubstance is not None or self.subjectOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Ingredient', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Ingredient') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Ingredient', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Ingredient'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "INGR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Ingredient', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.ingredientSubstance is not None: self.ingredientSubstance.export(outfile, level, namespace_, name_='ingredientSubstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIngredientEntity(self.classCode) # validate type RoleClassIngredientEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'ingredientSubstance': obj_ = POCP_MT081100UV_Substance.factory() obj_.build(child_) self.ingredientSubstance = obj_ obj_.original_tagname_ = 'ingredientSubstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010200UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010200UV_Ingredient
[docs]class POCP_MT010200UV_ManufacturedProduct(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturedProduct=None, manufacturerOrganization=None, subjectOf=None, deviceOf=None, consumedIn=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturedProduct = manufacturedProduct self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if deviceOf is None: self.deviceOf = [] else: self.deviceOf = deviceOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_ManufacturedProduct) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_ManufacturedProduct.subclass: return POCP_MT010200UV_ManufacturedProduct.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_ManufacturedProduct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_deviceOf(self): return self.deviceOf
[docs] def set_deviceOf(self, deviceOf): self.deviceOf = deviceOf
[docs] def add_deviceOf(self, value): self.deviceOf.append(value)
[docs] def insert_deviceOf_at(self, index, value): self.deviceOf.insert(index, value)
[docs] def replace_deviceOf_at(self, index, value): self.deviceOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturedProduct is not None or self.manufacturerOrganization is not None or self.subjectOf or self.deviceOf or self.consumedIn or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.ManufacturedProduct') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for deviceOf_ in self.deviceOf: deviceOf_.export(outfile, level, namespace_, name_='deviceOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010200UV_Product.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'deviceOf': obj_ = POCP_MT010200UV_Device.factory() obj_.build(child_) self.deviceOf.append(obj_) obj_.original_tagname_ = 'deviceOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010200UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010200UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010200UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010200UV_ManufacturedProduct
[docs]class POCP_MT010200UV_ManufacturedProduct2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturerOrganization=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_ManufacturedProduct2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_ManufacturedProduct2.subclass: return POCP_MT010200UV_ManufacturedProduct2.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_ManufacturedProduct2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturerOrganization is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.ManufacturedProduct2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010200UV_Product2.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010200UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010200UV_ManufacturedProduct2
[docs]class POCP_MT010200UV_ManufacturedProduct3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturerOrganization=None, subjectOf=None, consumedIn=None, productOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_ManufacturedProduct3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_ManufacturedProduct3.subclass: return POCP_MT010200UV_ManufacturedProduct3.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_ManufacturedProduct3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturerOrganization is not None or self.subjectOf or self.consumedIn or self.productOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.ManufacturedProduct3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.ManufacturedProduct3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010200UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010200UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf'
# end class POCP_MT010200UV_ManufacturedProduct3
[docs]class POCP_MT010200UV_MaterialKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_MaterialKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_MaterialKind.subclass: return POCP_MT010200UV_MaterialKind.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_MaterialKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassMaterial(self, value): # Validate type EntityClassMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MAT', 'CHEM', 'FOOD', 'MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassMaterial_patterns_, ))
validate_EntityClassMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.MaterialKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.MaterialKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.MaterialKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.MaterialKind'): if self.classCode != "MAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.MaterialKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassMaterial(self.classCode) # validate type EntityClassMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010200UV_MaterialKind
[docs]class POCP_MT010200UV_PackagedProduct(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='CONT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, formCode=None, capacityQuantity=None, capTypeCode=None, asIdentifiedEntity=None, asManufacturedProduct=None, asContent=None, asSpecializedKind=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc self.formCode = formCode self.capacityQuantity = capacityQuantity self.capTypeCode = capTypeCode if asIdentifiedEntity is None: self.asIdentifiedEntity = [] else: self.asIdentifiedEntity = asIdentifiedEntity if asManufacturedProduct is None: self.asManufacturedProduct = [] else: self.asManufacturedProduct = asManufacturedProduct if asContent is None: self.asContent = [] else: self.asContent = asContent if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_PackagedProduct) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_PackagedProduct.subclass: return POCP_MT010200UV_PackagedProduct.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_PackagedProduct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_capacityQuantity(self): return self.capacityQuantity
[docs] def set_capacityQuantity(self, capacityQuantity): self.capacityQuantity = capacityQuantity
[docs] def get_capTypeCode(self): return self.capTypeCode
[docs] def set_capTypeCode(self, capTypeCode): self.capTypeCode = capTypeCode
[docs] def get_asIdentifiedEntity(self): return self.asIdentifiedEntity
[docs] def set_asIdentifiedEntity(self, asIdentifiedEntity): self.asIdentifiedEntity = asIdentifiedEntity
[docs] def add_asIdentifiedEntity(self, value): self.asIdentifiedEntity.append(value)
[docs] def insert_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity.insert(index, value)
[docs] def replace_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity[index] = value
[docs] def get_asManufacturedProduct(self): return self.asManufacturedProduct
[docs] def set_asManufacturedProduct(self, asManufacturedProduct): self.asManufacturedProduct = asManufacturedProduct
[docs] def add_asManufacturedProduct(self, value): self.asManufacturedProduct.append(value)
[docs] def insert_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct.insert(index, value)
[docs] def replace_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def add_asContent(self, value): self.asContent.append(value)
[docs] def insert_asContent_at(self, index, value): self.asContent.insert(index, value)
[docs] def replace_asContent_at(self, index, value): self.asContent[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassContainer(self, value): # Validate type EntityClassContainer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT', 'HOLD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassContainer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassContainer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassContainer_patterns_, ))
validate_EntityClassContainer_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.formCode is not None or self.capacityQuantity is not None or self.capTypeCode is not None or self.asIdentifiedEntity or self.asManufacturedProduct or self.asContent or self.asSpecializedKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PackagedProduct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.PackagedProduct') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.PackagedProduct', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.PackagedProduct'): if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PackagedProduct', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.capacityQuantity is not None: self.capacityQuantity.export(outfile, level, namespace_, name_='capacityQuantity', pretty_print=pretty_print) if self.capTypeCode is not None: self.capTypeCode.export(outfile, level, namespace_, name_='capTypeCode', pretty_print=pretty_print) for asIdentifiedEntity_ in self.asIdentifiedEntity: asIdentifiedEntity_.export(outfile, level, namespace_, name_='asIdentifiedEntity', pretty_print=pretty_print) for asManufacturedProduct_ in self.asManufacturedProduct: asManufacturedProduct_.export(outfile, level, namespace_, name_='asManufacturedProduct', pretty_print=pretty_print) for asContent_ in self.asContent: asContent_.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassContainer(self.classCode) # validate type EntityClassContainer value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'capacityQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.capacityQuantity = obj_ obj_.original_tagname_ = 'capacityQuantity' elif nodeName_ == 'capTypeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.capTypeCode = obj_ obj_.original_tagname_ = 'capTypeCode' elif nodeName_ == 'asIdentifiedEntity': obj_ = POCP_MT010200UV_IdentifiedEntity.factory() obj_.build(child_) self.asIdentifiedEntity.append(obj_) obj_.original_tagname_ = 'asIdentifiedEntity' elif nodeName_ == 'asManufacturedProduct': obj_ = POCP_MT010200UV_ManufacturedProduct2.factory() obj_.build(child_) self.asManufacturedProduct.append(obj_) obj_.original_tagname_ = 'asManufacturedProduct' elif nodeName_ == 'asContent': obj_ = POCP_MT010200UV_Content1.factory() obj_.build(child_) self.asContent.append(obj_) obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010200UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind'
# end class POCP_MT010200UV_PackagedProduct
[docs]class POCP_MT010200UV_Part(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, id=None, code=None, quantity=None, partProduct=None, subjectOf=None, deviceOf=None, consumedIn=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.quantity = quantity self.partProduct = partProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if deviceOf is None: self.deviceOf = [] else: self.deviceOf = deviceOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Part) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Part.subclass: return POCP_MT010200UV_Part.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Part(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_partProduct(self): return self.partProduct
[docs] def set_partProduct(self, partProduct): self.partProduct = partProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_deviceOf(self): return self.deviceOf
[docs] def set_deviceOf(self, deviceOf): self.deviceOf = deviceOf
[docs] def add_deviceOf(self, value): self.deviceOf.append(value)
[docs] def insert_deviceOf_at(self, index, value): self.deviceOf.insert(index, value)
[docs] def replace_deviceOf_at(self, index, value): self.deviceOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.quantity is not None or self.partProduct is not None or self.subjectOf or self.deviceOf or self.consumedIn or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Part', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Part') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Part', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Part'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Part', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.partProduct is not None: self.partProduct.export(outfile, level, namespace_, name_='partProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for deviceOf_ in self.deviceOf: deviceOf_.export(outfile, level, namespace_, name_='deviceOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'partProduct': obj_ = POCP_MT010200UV_Product.factory() obj_.build(child_) self.partProduct = obj_ obj_.original_tagname_ = 'partProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'deviceOf': obj_ = POCP_MT010200UV_Device.factory() obj_.build(child_) self.deviceOf.append(obj_) obj_.original_tagname_ = 'deviceOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010200UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010200UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010200UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010200UV_Part
[docs]class POCP_MT010200UV_PartOfAssembly(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, code=None, wholeProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.wholeProduct = wholeProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_PartOfAssembly) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_PartOfAssembly.subclass: return POCP_MT010200UV_PartOfAssembly.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_PartOfAssembly(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_wholeProduct(self): return self.wholeProduct
[docs] def set_wholeProduct(self, wholeProduct): self.wholeProduct = wholeProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.wholeProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PartOfAssembly', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.PartOfAssembly') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.PartOfAssembly', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.PartOfAssembly'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PartOfAssembly', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.wholeProduct is not None: self.wholeProduct.export(outfile, level, namespace_, name_='wholeProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'wholeProduct': obj_ = POCP_MT010200UV_Product.factory() obj_.build(child_) self.wholeProduct = obj_ obj_.original_tagname_ = 'wholeProduct'
# end class POCP_MT010200UV_PartOfAssembly
[docs]class POCP_MT010200UV_PotentialSupply(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SPLY', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, title=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.title = title self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_PotentialSupply) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_PotentialSupply.subclass: return POCP_MT010200UV_PotentialSupply.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_PotentialSupply(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSupply(self, value): # Validate type ActClassSupply, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SPLY', 'DIET'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSupply' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSupply_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSupply_patterns_, ))
validate_ActClassSupply_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.title is not None or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PotentialSupply', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.PotentialSupply') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.PotentialSupply', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.PotentialSupply'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SPLY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PotentialSupply', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSupply(self.classCode) # validate type ActClassSupply value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'title': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'author': obj_ = POCP_MT010200UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010200UV_PotentialSupply
[docs]class POCP_MT010200UV_PrimaryPerformer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PPRF', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_PrimaryPerformer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_PrimaryPerformer.subclass: return POCP_MT010200UV_PrimaryPerformer.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_PrimaryPerformer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPrimaryPerformer(self, value): # Validate type ParticipationPrimaryPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPrimaryPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPrimaryPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPrimaryPerformer_patterns_, ))
validate_ParticipationPrimaryPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PrimaryPerformer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.PrimaryPerformer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.PrimaryPerformer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.PrimaryPerformer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PPRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.PrimaryPerformer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPrimaryPerformer(self.typeCode) # validate type ParticipationPrimaryPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT010200UV_PrimaryPerformer
[docs]class POCP_MT010200UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, riskCode=None, handlingCode=None, formCode=None, expirationTime=None, asIdentifiedEntity=None, asNamedEntity=None, asManufacturedProduct=None, asSpecializedKind=None, asEntityWithGeneric=None, asEquivalentEntity=None, ingredient=None, asContent=None, asPartOfAssembly=None, part=None, instanceOfKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc if riskCode is None: self.riskCode = [] else: self.riskCode = riskCode if handlingCode is None: self.handlingCode = [] else: self.handlingCode = handlingCode self.formCode = formCode self.expirationTime = expirationTime if asIdentifiedEntity is None: self.asIdentifiedEntity = [] else: self.asIdentifiedEntity = asIdentifiedEntity if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if asManufacturedProduct is None: self.asManufacturedProduct = [] else: self.asManufacturedProduct = asManufacturedProduct if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind self.asEntityWithGeneric = asEntityWithGeneric if asEquivalentEntity is None: self.asEquivalentEntity = [] else: self.asEquivalentEntity = asEquivalentEntity if ingredient is None: self.ingredient = [] else: self.ingredient = ingredient if asContent is None: self.asContent = [] else: self.asContent = asContent if asPartOfAssembly is None: self.asPartOfAssembly = [] else: self.asPartOfAssembly = asPartOfAssembly if part is None: self.part = [] else: self.part = part if instanceOfKind is None: self.instanceOfKind = [] else: self.instanceOfKind = instanceOfKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Product.subclass: return POCP_MT010200UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_riskCode(self): return self.riskCode
[docs] def set_riskCode(self, riskCode): self.riskCode = riskCode
[docs] def add_riskCode(self, value): self.riskCode.append(value)
[docs] def insert_riskCode_at(self, index, value): self.riskCode.insert(index, value)
[docs] def replace_riskCode_at(self, index, value): self.riskCode[index] = value
[docs] def get_handlingCode(self): return self.handlingCode
[docs] def set_handlingCode(self, handlingCode): self.handlingCode = handlingCode
[docs] def add_handlingCode(self, value): self.handlingCode.append(value)
[docs] def insert_handlingCode_at(self, index, value): self.handlingCode.insert(index, value)
[docs] def replace_handlingCode_at(self, index, value): self.handlingCode[index] = value
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_expirationTime(self): return self.expirationTime
[docs] def set_expirationTime(self, expirationTime): self.expirationTime = expirationTime
[docs] def get_asIdentifiedEntity(self): return self.asIdentifiedEntity
[docs] def set_asIdentifiedEntity(self, asIdentifiedEntity): self.asIdentifiedEntity = asIdentifiedEntity
[docs] def add_asIdentifiedEntity(self, value): self.asIdentifiedEntity.append(value)
[docs] def insert_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity.insert(index, value)
[docs] def replace_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity[index] = value
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_asManufacturedProduct(self): return self.asManufacturedProduct
[docs] def set_asManufacturedProduct(self, asManufacturedProduct): self.asManufacturedProduct = asManufacturedProduct
[docs] def add_asManufacturedProduct(self, value): self.asManufacturedProduct.append(value)
[docs] def insert_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct.insert(index, value)
[docs] def replace_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_asEntityWithGeneric(self): return self.asEntityWithGeneric
[docs] def set_asEntityWithGeneric(self, asEntityWithGeneric): self.asEntityWithGeneric = asEntityWithGeneric
[docs] def get_asEquivalentEntity(self): return self.asEquivalentEntity
[docs] def set_asEquivalentEntity(self, asEquivalentEntity): self.asEquivalentEntity = asEquivalentEntity
[docs] def add_asEquivalentEntity(self, value): self.asEquivalentEntity.append(value)
[docs] def insert_asEquivalentEntity_at(self, index, value): self.asEquivalentEntity.insert(index, value)
[docs] def replace_asEquivalentEntity_at(self, index, value): self.asEquivalentEntity[index] = value
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def add_ingredient(self, value): self.ingredient.append(value)
[docs] def insert_ingredient_at(self, index, value): self.ingredient.insert(index, value)
[docs] def replace_ingredient_at(self, index, value): self.ingredient[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def add_asContent(self, value): self.asContent.append(value)
[docs] def insert_asContent_at(self, index, value): self.asContent.insert(index, value)
[docs] def replace_asContent_at(self, index, value): self.asContent[index] = value
[docs] def get_asPartOfAssembly(self): return self.asPartOfAssembly
[docs] def set_asPartOfAssembly(self, asPartOfAssembly): self.asPartOfAssembly = asPartOfAssembly
[docs] def add_asPartOfAssembly(self, value): self.asPartOfAssembly.append(value)
[docs] def insert_asPartOfAssembly_at(self, index, value): self.asPartOfAssembly.insert(index, value)
[docs] def replace_asPartOfAssembly_at(self, index, value): self.asPartOfAssembly[index] = value
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_instanceOfKind(self): return self.instanceOfKind
[docs] def set_instanceOfKind(self, instanceOfKind): self.instanceOfKind = instanceOfKind
[docs] def add_instanceOfKind(self, value): self.instanceOfKind.append(value)
[docs] def insert_instanceOfKind_at(self, index, value): self.instanceOfKind.insert(index, value)
[docs] def replace_instanceOfKind_at(self, index, value): self.instanceOfKind[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.riskCode or self.handlingCode or self.formCode is not None or self.expirationTime is not None or self.asIdentifiedEntity or self.asNamedEntity or self.asManufacturedProduct or self.asSpecializedKind or self.asEntityWithGeneric is not None or self.asEquivalentEntity or self.ingredient or self.asContent or self.asPartOfAssembly or self.part or self.instanceOfKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) for riskCode_ in self.riskCode: riskCode_.export(outfile, level, namespace_, name_='riskCode', pretty_print=pretty_print) for handlingCode_ in self.handlingCode: handlingCode_.export(outfile, level, namespace_, name_='handlingCode', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.expirationTime is not None: self.expirationTime.export(outfile, level, namespace_, name_='expirationTime', pretty_print=pretty_print) for asIdentifiedEntity_ in self.asIdentifiedEntity: asIdentifiedEntity_.export(outfile, level, namespace_, name_='asIdentifiedEntity', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for asManufacturedProduct_ in self.asManufacturedProduct: asManufacturedProduct_.export(outfile, level, namespace_, name_='asManufacturedProduct', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) if self.asEntityWithGeneric is not None: self.asEntityWithGeneric.export(outfile, level, namespace_, name_='asEntityWithGeneric', pretty_print=pretty_print) for asEquivalentEntity_ in self.asEquivalentEntity: asEquivalentEntity_.export(outfile, level, namespace_, name_='asEquivalentEntity', pretty_print=pretty_print) for ingredient_ in self.ingredient: ingredient_.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) for asContent_ in self.asContent: asContent_.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) for asPartOfAssembly_ in self.asPartOfAssembly: asPartOfAssembly_.export(outfile, level, namespace_, name_='asPartOfAssembly', pretty_print=pretty_print) for part_ in self.part: part_.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) for instanceOfKind_ in self.instanceOfKind: instanceOfKind_.export(outfile, level, namespace_, name_='instanceOfKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'riskCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.riskCode.append(obj_) obj_.original_tagname_ = 'riskCode' elif nodeName_ == 'handlingCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.handlingCode.append(obj_) obj_.original_tagname_ = 'handlingCode' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'expirationTime': obj_ = IVL_TS.factory() obj_.build(child_) self.expirationTime = obj_ obj_.original_tagname_ = 'expirationTime' elif nodeName_ == 'asIdentifiedEntity': obj_ = POCP_MT010200UV_IdentifiedEntity.factory() obj_.build(child_) self.asIdentifiedEntity.append(obj_) obj_.original_tagname_ = 'asIdentifiedEntity' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT000100UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'asManufacturedProduct': obj_ = POCP_MT010200UV_ManufacturedProduct3.factory() obj_.build(child_) self.asManufacturedProduct.append(obj_) obj_.original_tagname_ = 'asManufacturedProduct' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010200UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'asEntityWithGeneric': obj_ = POCP_MT010200UV_EntityWithGeneric.factory() obj_.build(child_) self.asEntityWithGeneric = obj_ obj_.original_tagname_ = 'asEntityWithGeneric' elif nodeName_ == 'asEquivalentEntity': obj_ = POCP_MT010200UV_EquivalentEntity.factory() obj_.build(child_) self.asEquivalentEntity.append(obj_) obj_.original_tagname_ = 'asEquivalentEntity' elif nodeName_ == 'ingredient': obj_ = POCP_MT010200UV_Ingredient.factory() obj_.build(child_) self.ingredient.append(obj_) obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'asContent': obj_ = POCP_MT010200UV_Content.factory() obj_.build(child_) self.asContent.append(obj_) obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asPartOfAssembly': obj_ = POCP_MT010200UV_PartOfAssembly.factory() obj_.build(child_) self.asPartOfAssembly.append(obj_) obj_.original_tagname_ = 'asPartOfAssembly' elif nodeName_ == 'part': obj_ = POCP_MT010200UV_Part.factory() obj_.build(child_) self.part.append(obj_) obj_.original_tagname_ = 'part' elif nodeName_ == 'instanceOfKind': obj_ = POCP_MT020100UV_InstanceOfKind1.factory() obj_.build(child_) self.instanceOfKind.append(obj_) obj_.original_tagname_ = 'instanceOfKind'
# end class POCP_MT010200UV_Product
[docs]class POCP_MT010200UV_Product2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, potentialSupply=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.potentialSupply = potentialSupply
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Product2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Product2.subclass: return POCP_MT010200UV_Product2.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Product2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_potentialSupply(self): return self.potentialSupply
[docs] def set_potentialSupply(self, potentialSupply): self.potentialSupply = potentialSupply
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.potentialSupply is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Product2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Product2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Product2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Product2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Product2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.potentialSupply is not None: self.potentialSupply.export(outfile, level, namespace_, name_='potentialSupply', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'potentialSupply': obj_ = POCP_MT010200UV_PotentialSupply.factory() obj_.build(child_) self.potentialSupply = obj_ obj_.original_tagname_ = 'potentialSupply'
# end class POCP_MT010200UV_Product2
[docs]class POCP_MT010200UV_Product3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, potentialSupply=None, reconstitution=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.potentialSupply = potentialSupply self.reconstitution = reconstitution self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Product3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Product3.subclass: return POCP_MT010200UV_Product3.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Product3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_potentialSupply(self): return self.potentialSupply
[docs] def set_potentialSupply(self, potentialSupply): self.potentialSupply = potentialSupply
[docs] def get_reconstitution(self): return self.reconstitution
[docs] def set_reconstitution(self, reconstitution): self.reconstitution = reconstitution
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.potentialSupply is not None or self.reconstitution is not None or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Product3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Product3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Product3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Product3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Product3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.potentialSupply is not None: self.potentialSupply.export(outfile, level, namespace_, name_='potentialSupply', pretty_print=pretty_print) if self.reconstitution is not None: self.reconstitution.export(outfile, level, namespace_, name_='reconstitution', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'potentialSupply': obj_ = POCP_MT010200UV_PotentialSupply.factory() obj_.build(child_) self.potentialSupply = obj_ obj_.original_tagname_ = 'potentialSupply' elif nodeName_ == 'reconstitution': obj_ = POCP_MT010200UV_Reconstitution.factory() obj_.build(child_) self.reconstitution = obj_ obj_.original_tagname_ = 'reconstitution' elif nodeName_ == 'actDefinition': obj_ = POCP_MT010200UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT010200UV_Product3
[docs]class POCP_MT010200UV_Reconstitution(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, consumable=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if consumable is None: self.consumable = [] else: self.consumable = consumable self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Reconstitution) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Reconstitution.subclass: return POCP_MT010200UV_Reconstitution.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Reconstitution(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_consumable(self): return self.consumable
[docs] def set_consumable(self, consumable): self.consumable = consumable
[docs] def add_consumable(self, value): self.consumable.append(value)
[docs] def insert_consumable_at(self, index, value): self.consumable.insert(index, value)
[docs] def replace_consumable_at(self, index, value): self.consumable[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.consumable or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Reconstitution', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Reconstitution') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Reconstitution', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Reconstitution'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Reconstitution', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for consumable_ in self.consumable: consumable_.export(outfile, level, namespace_, name_='consumable', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'consumable': obj_ = POCP_MT010200UV_Consumable2.factory() obj_.build(child_) self.consumable.append(obj_) obj_.original_tagname_ = 'consumable' elif nodeName_ == 'author': obj_ = POCP_MT010200UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010200UV_Reconstitution
[docs]class POCP_MT010200UV_SpecializedKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='GEN', realmCode=None, typeId=None, templateId=None, code=None, generalizedMaterialKind=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.generalizedMaterialKind = generalizedMaterialKind if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_SpecializedKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_SpecializedKind.subclass: return POCP_MT010200UV_SpecializedKind.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_SpecializedKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_generalizedMaterialKind(self): return self.generalizedMaterialKind
[docs] def set_generalizedMaterialKind(self, generalizedMaterialKind): self.generalizedMaterialKind = generalizedMaterialKind
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIsSpeciesEntity(self, value): # Validate type RoleClassIsSpeciesEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN', 'GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIsSpeciesEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIsSpeciesEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIsSpeciesEntity_patterns_, ))
validate_RoleClassIsSpeciesEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.generalizedMaterialKind is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.SpecializedKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.SpecializedKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.SpecializedKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.SpecializedKind'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "GEN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.SpecializedKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.generalizedMaterialKind is not None: self.generalizedMaterialKind.export(outfile, level, namespace_, name_='generalizedMaterialKind', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIsSpeciesEntity(self.classCode) # validate type RoleClassIsSpeciesEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'generalizedMaterialKind': obj_ = POCP_MT010200UV_MaterialKind.factory() obj_.build(child_) self.generalizedMaterialKind = obj_ obj_.original_tagname_ = 'generalizedMaterialKind' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT010200UV_SpecializedKind
[docs]class POCP_MT010200UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', negationInd='false', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None, approval=None, policy=None, marketingAct=None, monitoringProgram=None, storage=None, observationGoal=None, substanceSpecification=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.negationInd = _cast(None, negationInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action self.approval = approval self.policy = policy self.marketingAct = marketingAct self.monitoringProgram = monitoringProgram self.storage = storage self.observationGoal = observationGoal self.substanceSpecification = substanceSpecification
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_Subject.subclass: return POCP_MT010200UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_marketingAct(self): return self.marketingAct
[docs] def set_marketingAct(self, marketingAct): self.marketingAct = marketingAct
[docs] def get_monitoringProgram(self): return self.monitoringProgram
[docs] def set_monitoringProgram(self, monitoringProgram): self.monitoringProgram = monitoringProgram
[docs] def get_storage(self): return self.storage
[docs] def set_storage(self, storage): self.storage = storage
[docs] def get_observationGoal(self): return self.observationGoal
[docs] def set_observationGoal(self, observationGoal): self.observationGoal = observationGoal
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_negationInd(self): return self.negationInd
[docs] def set_negationInd(self, negationInd): self.negationInd = negationInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None or self.approval is not None or self.policy is not None or self.marketingAct is not None or self.monitoringProgram is not None or self.storage is not None or self.observationGoal is not None or self.substanceSpecification is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.negationInd and 'negationInd' not in already_processed: already_processed.add('negationInd') outfile.write(' negationInd=%s' % (quote_attrib(self.negationInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.marketingAct is not None: self.marketingAct.export(outfile, level, namespace_, name_='marketingAct', pretty_print=pretty_print) if self.monitoringProgram is not None: self.monitoringProgram.export(outfile, level, namespace_, name_='monitoringProgram', pretty_print=pretty_print) if self.storage is not None: self.storage.export(outfile, level, namespace_, name_='storage', pretty_print=pretty_print) if self.observationGoal is not None: self.observationGoal.export(outfile, level, namespace_, name_='observationGoal', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject value = find_attr_value_('negationInd', node) if value is not None and 'negationInd' not in already_processed: already_processed.add('negationInd') if value in ('true', '1'): self.negationInd = True elif value in ('false', '0'): self.negationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.negationInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050100UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050100UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050100UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval' elif nodeName_ == 'policy': obj_ = POCP_MT050100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'marketingAct': obj_ = POCP_MT050100UV_MarketingAct.factory() obj_.build(child_) self.marketingAct = obj_ obj_.original_tagname_ = 'marketingAct' elif nodeName_ == 'monitoringProgram': obj_ = POCP_MT050100UV_MonitoringProgram.factory() obj_.build(child_) self.monitoringProgram = obj_ obj_.original_tagname_ = 'monitoringProgram' elif nodeName_ == 'storage': obj_ = POCP_MT050100UV_Storage.factory() obj_.build(child_) self.storage = obj_ obj_.original_tagname_ = 'storage' elif nodeName_ == 'observationGoal': obj_ = POCP_MT050100UV_ObservationGoal.factory() obj_.build(child_) self.observationGoal = obj_ obj_.original_tagname_ = 'observationGoal' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification'
# end class POCP_MT010200UV_Subject
[docs]class POCP_MT010200UV_SubstanceAdministration(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SBADM', moodCode='DEF', realmCode=None, typeId=None, templateId=None, routeCode=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.routeCode = routeCode
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010200UV_SubstanceAdministration) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010200UV_SubstanceAdministration.subclass: return POCP_MT010200UV_SubstanceAdministration.subclass(*args_, **kwargs_) else: return POCP_MT010200UV_SubstanceAdministration(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_routeCode(self): return self.routeCode
[docs] def set_routeCode(self, routeCode): self.routeCode = routeCode
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSubstanceAdministration(self, value): # Validate type ActClassSubstanceAdministration, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBADM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSubstanceAdministration' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSubstanceAdministration_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSubstanceAdministration_patterns_, ))
validate_ActClassSubstanceAdministration_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.routeCode is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010200UV.SubstanceAdministration', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010200UV.SubstanceAdministration') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010200UV.SubstanceAdministration', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010200UV.SubstanceAdministration'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SBADM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010200UV.SubstanceAdministration', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.routeCode is not None: self.routeCode.export(outfile, level, namespace_, name_='routeCode', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSubstanceAdministration(self.classCode) # validate type ActClassSubstanceAdministration value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'routeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.routeCode = obj_ obj_.original_tagname_ = 'routeCode'
# end class POCP_MT010200UV_SubstanceAdministration
[docs]class COCT_MT440001UV09_ValuedItem(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, moodCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, effectiveTime=None, unitQuantity=None, unitPriceAmt=None, netAmt=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.effectiveTime = effectiveTime self.unitQuantity = unitQuantity self.unitPriceAmt = unitPriceAmt self.netAmt = netAmt
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT440001UV09_ValuedItem) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT440001UV09_ValuedItem.subclass: return COCT_MT440001UV09_ValuedItem.subclass(*args_, **kwargs_) else: return COCT_MT440001UV09_ValuedItem(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_unitQuantity(self): return self.unitQuantity
[docs] def set_unitQuantity(self, unitQuantity): self.unitQuantity = unitQuantity
[docs] def get_unitPriceAmt(self): return self.unitPriceAmt
[docs] def set_unitPriceAmt(self, unitPriceAmt): self.unitPriceAmt = unitPriceAmt
[docs] def get_netAmt(self): return self.netAmt
[docs] def set_netAmt(self, netAmt): self.netAmt = netAmt
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassInvoiceElement(self, value): # Validate type ActClassInvoiceElement, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INVE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassInvoiceElement' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassInvoiceElement_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassInvoiceElement_patterns_, ))
validate_ActClassInvoiceElement_patterns_ = [['^[^\\s]+$']]
[docs] def validate_x_ActMoodDefEvn(self, value): # Validate type x_ActMoodDefEvn, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF', 'EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on x_ActMoodDefEvn' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_x_ActMoodDefEvn_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_x_ActMoodDefEvn_patterns_, ))
validate_x_ActMoodDefEvn_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.effectiveTime is not None or self.unitQuantity is not None or self.unitPriceAmt is not None or self.netAmt is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT440001UV09.ValuedItem', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT440001UV09.ValuedItem') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT440001UV09.ValuedItem', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT440001UV09.ValuedItem'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT440001UV09.ValuedItem', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.unitQuantity is not None: self.unitQuantity.export(outfile, level, namespace_, name_='unitQuantity', pretty_print=pretty_print) if self.unitPriceAmt is not None: self.unitPriceAmt.export(outfile, level, namespace_, name_='unitPriceAmt', pretty_print=pretty_print) if self.netAmt is not None: self.netAmt.export(outfile, level, namespace_, name_='netAmt', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassInvoiceElement(self.classCode) # validate type ActClassInvoiceElement value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_x_ActMoodDefEvn(self.moodCode) # validate type x_ActMoodDefEvn
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'unitQuantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.unitQuantity = obj_ obj_.original_tagname_ = 'unitQuantity' elif nodeName_ == 'unitPriceAmt': obj_ = RTO_MO_PQ.factory() obj_.build(child_) self.unitPriceAmt = obj_ obj_.original_tagname_ = 'unitPriceAmt' elif nodeName_ == 'netAmt': class_obj_ = self.get_class_obj_(child_, MO) obj_ = class_obj_.factory() obj_.build(child_) self.netAmt = obj_ obj_.original_tagname_ = 'netAmt'
# end class COCT_MT440001UV09_ValuedItem
[docs]class POCP_MT060100UV_ActCriterion(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='EVN.CRT', actionNegationInd=None, isCriterionInd=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.actionNegationInd = _cast(None, actionNegationInd) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_ActCriterion) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_ActCriterion.subclass: return POCP_MT060100UV_ActCriterion.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_ActCriterion(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_actionNegationInd(self): return self.actionNegationInd
[docs] def set_actionNegationInd(self, actionNegationInd): self.actionNegationInd = actionNegationInd
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ActCriterion', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.ActCriterion') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.ActCriterion', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.ActCriterion'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.actionNegationInd is not None and 'actionNegationInd' not in already_processed: already_processed.add('actionNegationInd') outfile.write(' actionNegationInd=%s' % (quote_attrib(self.actionNegationInd), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ActCriterion', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('actionNegationInd', node) if value is not None and 'actionNegationInd' not in already_processed: already_processed.add('actionNegationInd') if value in ('true', '1'): self.actionNegationInd = True elif value in ('false', '0'): self.actionNegationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.actionNegationInd) # validate type bl value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text'
# end class POCP_MT060100UV_ActCriterion
[docs]class POCP_MT060100UV_AdministrableMaterial(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ADMM', realmCode=None, typeId=None, templateId=None, administrableMaterialKind=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.administrableMaterialKind = administrableMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_AdministrableMaterial) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_AdministrableMaterial.subclass: return POCP_MT060100UV_AdministrableMaterial.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_AdministrableMaterial(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_administrableMaterialKind(self): return self.administrableMaterialKind
[docs] def set_administrableMaterialKind(self, administrableMaterialKind): self.administrableMaterialKind = administrableMaterialKind
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassAdministerableMaterial(self, value): # Validate type RoleClassAdministerableMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADMM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAdministerableMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAdministerableMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAdministerableMaterial_patterns_, ))
validate_RoleClassAdministerableMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.administrableMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.AdministrableMaterial', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.AdministrableMaterial') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.AdministrableMaterial', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.AdministrableMaterial'): if self.classCode != "ADMM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.AdministrableMaterial', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.administrableMaterialKind is not None: self.administrableMaterialKind.export(outfile, level, namespace_, name_='administrableMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAdministerableMaterial(self.classCode) # validate type RoleClassAdministerableMaterial
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'administrableMaterialKind': obj_ = POCP_MT010400UV_MaterialKind.factory() obj_.build(child_) self.administrableMaterialKind = obj_ obj_.original_tagname_ = 'administrableMaterialKind'
# end class POCP_MT060100UV_AdministrableMaterial
[docs]class POCP_MT060100UV_Analyte(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ALY', realmCode=None, typeId=None, templateId=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Analyte) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Analyte.subclass: return POCP_MT060100UV_Analyte.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Analyte(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAnalyte(self, value): # Validate type ParticipationAnalyte, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAnalyte' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAnalyte_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAnalyte_patterns_, ))
validate_ParticipationAnalyte_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Analyte', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Analyte') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Analyte', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Analyte'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ALY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Analyte', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAnalyte(self.typeCode) # validate type ParticipationAnalyte
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT060100UV_Analyte
[docs]class POCP_MT060100UV_CauseOf(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CAUS', realmCode=None, typeId=None, templateId=None, consequenceObservation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.consequenceObservation = consequenceObservation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_CauseOf) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_CauseOf.subclass: return POCP_MT060100UV_CauseOf.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_CauseOf(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_consequenceObservation(self): return self.consequenceObservation
[docs] def set_consequenceObservation(self, consequenceObservation): self.consequenceObservation = consequenceObservation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipIsEtiologyFor(self, value): # Validate type ActRelationshipIsEtiologyFor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CAUS'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipIsEtiologyFor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipIsEtiologyFor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipIsEtiologyFor_patterns_, ))
validate_ActRelationshipIsEtiologyFor_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.consequenceObservation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.CauseOf', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.CauseOf') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.CauseOf', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.CauseOf'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CAUS" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.CauseOf', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.consequenceObservation is not None: self.consequenceObservation.export(outfile, level, namespace_, name_='consequenceObservation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipIsEtiologyFor(self.typeCode) # validate type ActRelationshipIsEtiologyFor
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'consequenceObservation': obj_ = POCP_MT060100UV_ConsequenceObservation.factory() obj_.build(child_) self.consequenceObservation = obj_ obj_.original_tagname_ = 'consequenceObservation'
# end class POCP_MT060100UV_CauseOf
[docs]class POCP_MT060100UV_Component(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, observationCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observationCriterion = observationCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Component) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Component.subclass: return POCP_MT060100UV_Component.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observationCriterion(self): return self.observationCriterion
[docs] def set_observationCriterion(self, observationCriterion): self.observationCriterion = observationCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observationCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Component') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Component', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Component'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observationCriterion is not None: self.observationCriterion.export(outfile, level, namespace_, name_='observationCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observationCriterion': obj_ = POCP_MT060100UV_ObservationCriterion.factory() obj_.build(child_) self.observationCriterion = obj_ obj_.original_tagname_ = 'observationCriterion'
# end class POCP_MT060100UV_Component
[docs]class POCP_MT060100UV_Component1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, priorityNumber=None, pauseQuantity=None, splitCode=None, joinCode=None, seperatableInd=None, protocol=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.priorityNumber = priorityNumber self.pauseQuantity = pauseQuantity self.splitCode = splitCode self.joinCode = joinCode self.seperatableInd = seperatableInd self.protocol = protocol
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Component1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Component1.subclass: return POCP_MT060100UV_Component1.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Component1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_priorityNumber(self): return self.priorityNumber
[docs] def set_priorityNumber(self, priorityNumber): self.priorityNumber = priorityNumber
[docs] def get_pauseQuantity(self): return self.pauseQuantity
[docs] def set_pauseQuantity(self, pauseQuantity): self.pauseQuantity = pauseQuantity
[docs] def get_splitCode(self): return self.splitCode
[docs] def set_splitCode(self, splitCode): self.splitCode = splitCode
[docs] def get_joinCode(self): return self.joinCode
[docs] def set_joinCode(self, joinCode): self.joinCode = joinCode
[docs] def get_seperatableInd(self): return self.seperatableInd
[docs] def set_seperatableInd(self, seperatableInd): self.seperatableInd = seperatableInd
[docs] def get_protocol(self): return self.protocol
[docs] def set_protocol(self, protocol): self.protocol = protocol
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.priorityNumber is not None or self.pauseQuantity is not None or self.splitCode is not None or self.joinCode is not None or self.seperatableInd is not None or self.protocol is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Component1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Component1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Component1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.priorityNumber is not None: self.priorityNumber.export(outfile, level, namespace_, name_='priorityNumber', pretty_print=pretty_print) if self.pauseQuantity is not None: self.pauseQuantity.export(outfile, level, namespace_, name_='pauseQuantity', pretty_print=pretty_print) if self.splitCode is not None: self.splitCode.export(outfile, level, namespace_, name_='splitCode', pretty_print=pretty_print) if self.joinCode is not None: self.joinCode.export(outfile, level, namespace_, name_='joinCode', pretty_print=pretty_print) if self.seperatableInd is not None: self.seperatableInd.export(outfile, level, namespace_, name_='seperatableInd', pretty_print=pretty_print) if self.protocol is not None: self.protocol.export(outfile, level, namespace_, name_='protocol', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'priorityNumber': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.priorityNumber = obj_ obj_.original_tagname_ = 'priorityNumber' elif nodeName_ == 'pauseQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.pauseQuantity = obj_ obj_.original_tagname_ = 'pauseQuantity' elif nodeName_ == 'splitCode': obj_ = CS.factory() obj_.build(child_) self.splitCode = obj_ obj_.original_tagname_ = 'splitCode' elif nodeName_ == 'joinCode': obj_ = CS.factory() obj_.build(child_) self.joinCode = obj_ obj_.original_tagname_ = 'joinCode' elif nodeName_ == 'seperatableInd': obj_ = BL.factory() obj_.build(child_) self.seperatableInd = obj_ obj_.original_tagname_ = 'seperatableInd' elif nodeName_ == 'protocol': obj_ = POCP_MT060100UV_Protocol.factory() obj_.build(child_) self.protocol = obj_ obj_.original_tagname_ = 'protocol'
# end class POCP_MT060100UV_Component1
[docs]class POCP_MT060100UV_Component2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, priorityNumber=None, pauseQuantity=None, splitCode=None, joinCode=None, seperatableInd=None, protocol=None, requirement=None, monitoringObservation=None, substanceAdministration=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.priorityNumber = priorityNumber self.pauseQuantity = pauseQuantity self.splitCode = splitCode self.joinCode = joinCode self.seperatableInd = seperatableInd self.protocol = protocol self.requirement = requirement self.monitoringObservation = monitoringObservation self.substanceAdministration = substanceAdministration
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Component2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Component2.subclass: return POCP_MT060100UV_Component2.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Component2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_priorityNumber(self): return self.priorityNumber
[docs] def set_priorityNumber(self, priorityNumber): self.priorityNumber = priorityNumber
[docs] def get_pauseQuantity(self): return self.pauseQuantity
[docs] def set_pauseQuantity(self, pauseQuantity): self.pauseQuantity = pauseQuantity
[docs] def get_splitCode(self): return self.splitCode
[docs] def set_splitCode(self, splitCode): self.splitCode = splitCode
[docs] def get_joinCode(self): return self.joinCode
[docs] def set_joinCode(self, joinCode): self.joinCode = joinCode
[docs] def get_seperatableInd(self): return self.seperatableInd
[docs] def set_seperatableInd(self, seperatableInd): self.seperatableInd = seperatableInd
[docs] def get_protocol(self): return self.protocol
[docs] def set_protocol(self, protocol): self.protocol = protocol
[docs] def get_requirement(self): return self.requirement
[docs] def set_requirement(self, requirement): self.requirement = requirement
[docs] def get_monitoringObservation(self): return self.monitoringObservation
[docs] def set_monitoringObservation(self, monitoringObservation): self.monitoringObservation = monitoringObservation
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.priorityNumber is not None or self.pauseQuantity is not None or self.splitCode is not None or self.joinCode is not None or self.seperatableInd is not None or self.protocol is not None or self.requirement is not None or self.monitoringObservation is not None or self.substanceAdministration is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Component2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Component2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Component2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.priorityNumber is not None: self.priorityNumber.export(outfile, level, namespace_, name_='priorityNumber', pretty_print=pretty_print) if self.pauseQuantity is not None: self.pauseQuantity.export(outfile, level, namespace_, name_='pauseQuantity', pretty_print=pretty_print) if self.splitCode is not None: self.splitCode.export(outfile, level, namespace_, name_='splitCode', pretty_print=pretty_print) if self.joinCode is not None: self.joinCode.export(outfile, level, namespace_, name_='joinCode', pretty_print=pretty_print) if self.seperatableInd is not None: self.seperatableInd.export(outfile, level, namespace_, name_='seperatableInd', pretty_print=pretty_print) if self.protocol is not None: self.protocol.export(outfile, level, namespace_, name_='protocol', pretty_print=pretty_print) if self.requirement is not None: self.requirement.export(outfile, level, namespace_, name_='requirement', pretty_print=pretty_print) if self.monitoringObservation is not None: self.monitoringObservation.export(outfile, level, namespace_, name_='monitoringObservation', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'priorityNumber': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.priorityNumber = obj_ obj_.original_tagname_ = 'priorityNumber' elif nodeName_ == 'pauseQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.pauseQuantity = obj_ obj_.original_tagname_ = 'pauseQuantity' elif nodeName_ == 'splitCode': obj_ = CS.factory() obj_.build(child_) self.splitCode = obj_ obj_.original_tagname_ = 'splitCode' elif nodeName_ == 'joinCode': obj_ = CS.factory() obj_.build(child_) self.joinCode = obj_ obj_.original_tagname_ = 'joinCode' elif nodeName_ == 'seperatableInd': obj_ = BL.factory() obj_.build(child_) self.seperatableInd = obj_ obj_.original_tagname_ = 'seperatableInd' elif nodeName_ == 'protocol': obj_ = POCP_MT060100UV_Protocol.factory() obj_.build(child_) self.protocol = obj_ obj_.original_tagname_ = 'protocol' elif nodeName_ == 'requirement': obj_ = POCP_MT060100UV_Requirement.factory() obj_.build(child_) self.requirement = obj_ obj_.original_tagname_ = 'requirement' elif nodeName_ == 'monitoringObservation': obj_ = POCP_MT060100UV_MonitoringObservation.factory() obj_.build(child_) self.monitoringObservation = obj_ obj_.original_tagname_ = 'monitoringObservation' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT060100UV_SubstanceAdministration1.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration'
# end class POCP_MT060100UV_Component2
[docs]class POCP_MT060100UV_Component3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, substanceAdministration=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.substanceAdministration = substanceAdministration
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Component3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Component3.subclass: return POCP_MT060100UV_Component3.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Component3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.substanceAdministration is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Component3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Component3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Component3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT060100UV_SubstanceAdministration2.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration'
# end class POCP_MT060100UV_Component3
[docs]class POCP_MT060100UV_Component4(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, priorityNumber=None, pauseQuantity=None, splitCode=None, joinCode=None, seperatableInd=None, protocol=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.priorityNumber = priorityNumber self.pauseQuantity = pauseQuantity self.splitCode = splitCode self.joinCode = joinCode self.seperatableInd = seperatableInd self.protocol = protocol
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Component4) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Component4.subclass: return POCP_MT060100UV_Component4.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Component4(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_priorityNumber(self): return self.priorityNumber
[docs] def set_priorityNumber(self, priorityNumber): self.priorityNumber = priorityNumber
[docs] def get_pauseQuantity(self): return self.pauseQuantity
[docs] def set_pauseQuantity(self, pauseQuantity): self.pauseQuantity = pauseQuantity
[docs] def get_splitCode(self): return self.splitCode
[docs] def set_splitCode(self, splitCode): self.splitCode = splitCode
[docs] def get_joinCode(self): return self.joinCode
[docs] def set_joinCode(self, joinCode): self.joinCode = joinCode
[docs] def get_seperatableInd(self): return self.seperatableInd
[docs] def set_seperatableInd(self, seperatableInd): self.seperatableInd = seperatableInd
[docs] def get_protocol(self): return self.protocol
[docs] def set_protocol(self, protocol): self.protocol = protocol
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.priorityNumber is not None or self.pauseQuantity is not None or self.splitCode is not None or self.joinCode is not None or self.seperatableInd is not None or self.protocol is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component4', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Component4') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Component4', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Component4'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Component4', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.priorityNumber is not None: self.priorityNumber.export(outfile, level, namespace_, name_='priorityNumber', pretty_print=pretty_print) if self.pauseQuantity is not None: self.pauseQuantity.export(outfile, level, namespace_, name_='pauseQuantity', pretty_print=pretty_print) if self.splitCode is not None: self.splitCode.export(outfile, level, namespace_, name_='splitCode', pretty_print=pretty_print) if self.joinCode is not None: self.joinCode.export(outfile, level, namespace_, name_='joinCode', pretty_print=pretty_print) if self.seperatableInd is not None: self.seperatableInd.export(outfile, level, namespace_, name_='seperatableInd', pretty_print=pretty_print) if self.protocol is not None: self.protocol.export(outfile, level, namespace_, name_='protocol', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'priorityNumber': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.priorityNumber = obj_ obj_.original_tagname_ = 'priorityNumber' elif nodeName_ == 'pauseQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.pauseQuantity = obj_ obj_.original_tagname_ = 'pauseQuantity' elif nodeName_ == 'splitCode': obj_ = CS.factory() obj_.build(child_) self.splitCode = obj_ obj_.original_tagname_ = 'splitCode' elif nodeName_ == 'joinCode': obj_ = CS.factory() obj_.build(child_) self.joinCode = obj_ obj_.original_tagname_ = 'joinCode' elif nodeName_ == 'seperatableInd': obj_ = BL.factory() obj_.build(child_) self.seperatableInd = obj_ obj_.original_tagname_ = 'seperatableInd' elif nodeName_ == 'protocol': obj_ = POCP_MT060100UV_Protocol.factory() obj_.build(child_) self.protocol = obj_ obj_.original_tagname_ = 'protocol'
# end class POCP_MT060100UV_Component4
[docs]class POCP_MT060100UV_ConsequenceObservation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN.CRT', isCriterionInd=None, realmCode=None, typeId=None, templateId=None, code=None, text=None, value=None, causeOf=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.value = value if causeOf is None: self.causeOf = [] else: self.causeOf = causeOf if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_ConsequenceObservation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_ConsequenceObservation.subclass: return POCP_MT060100UV_ConsequenceObservation.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_ConsequenceObservation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_causeOf(self): return self.causeOf
[docs] def set_causeOf(self, causeOf): self.causeOf = causeOf
[docs] def add_causeOf(self, value): self.causeOf.append(value)
[docs] def insert_causeOf_at(self, index, value): self.causeOf.insert(index, value)
[docs] def replace_causeOf_at(self, index, value): self.causeOf[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.value is not None or self.causeOf or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ConsequenceObservation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.ConsequenceObservation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.ConsequenceObservation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.ConsequenceObservation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ConsequenceObservation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for causeOf_ in self.causeOf: causeOf_.export(outfile, level, namespace_, name_='causeOf', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'causeOf': obj_ = POCP_MT060100UV_CauseOf.factory() obj_.build(child_) self.causeOf.append(obj_) obj_.original_tagname_ = 'causeOf' elif nodeName_ == 'subjectOf': obj_ = POCP_MT060100UV_Subject3.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT060100UV_ConsequenceObservation
[docs]class POCP_MT060100UV_Consumable1(GeneratedsSuper): subclass = None superclass = None def __init__(self, typeCode='CSM', realmCode=None, typeId=None, templateId=None, administrableMaterial=None): self.original_tagname_ = None self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.administrableMaterial = administrableMaterial
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Consumable1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Consumable1.subclass: return POCP_MT060100UV_Consumable1.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Consumable1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_administrableMaterial(self): return self.administrableMaterial
[docs] def set_administrableMaterial(self, administrableMaterial): self.administrableMaterial = administrableMaterial
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.administrableMaterial is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Consumable1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Consumable1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Consumable1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Consumable1'): if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Consumable1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.administrableMaterial is not None: self.administrableMaterial.export(outfile, level, namespace_, name_='administrableMaterial', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'administrableMaterial': obj_ = POCP_MT060100UV_AdministrableMaterial.factory() obj_.build(child_) self.administrableMaterial = obj_ obj_.original_tagname_ = 'administrableMaterial'
# end class POCP_MT060100UV_Consumable1
[docs]class POCP_MT060100UV_Consumable2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, manufacturedProduct21=None, content11=None, content1=None, administerableMaterial=None, manufacturedProduct3=None, part=None, manufacturedProduct=None, ingredient=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct21 = manufacturedProduct21 self.content11 = content11 self.content1 = content1 self.administerableMaterial = administerableMaterial self.manufacturedProduct3 = manufacturedProduct3 self.part = part self.manufacturedProduct = manufacturedProduct self.ingredient = ingredient
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Consumable2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Consumable2.subclass: return POCP_MT060100UV_Consumable2.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Consumable2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct21(self): return self.manufacturedProduct21
[docs] def set_manufacturedProduct21(self, manufacturedProduct21): self.manufacturedProduct21 = manufacturedProduct21
[docs] def get_content11(self): return self.content11
[docs] def set_content11(self, content11): self.content11 = content11
[docs] def get_content1(self): return self.content1
[docs] def set_content1(self, content1): self.content1 = content1
[docs] def get_administerableMaterial(self): return self.administerableMaterial
[docs] def set_administerableMaterial(self, administerableMaterial): self.administerableMaterial = administerableMaterial
[docs] def get_manufacturedProduct3(self): return self.manufacturedProduct3
[docs] def set_manufacturedProduct3(self, manufacturedProduct3): self.manufacturedProduct3 = manufacturedProduct3
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct21 is not None or self.content11 is not None or self.content1 is not None or self.administerableMaterial is not None or self.manufacturedProduct3 is not None or self.part is not None or self.manufacturedProduct is not None or self.ingredient is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Consumable2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Consumable2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Consumable2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Consumable2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Consumable2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct21 is not None: self.manufacturedProduct21.export(outfile, level, namespace_, name_='manufacturedProduct21', pretty_print=pretty_print) if self.content11 is not None: self.content11.export(outfile, level, namespace_, name_='content11', pretty_print=pretty_print) if self.content1 is not None: self.content1.export(outfile, level, namespace_, name_='content1', pretty_print=pretty_print) if self.administerableMaterial is not None: self.administerableMaterial.export(outfile, level, namespace_, name_='administerableMaterial', pretty_print=pretty_print) if self.manufacturedProduct3 is not None: self.manufacturedProduct3.export(outfile, level, namespace_, name_='manufacturedProduct3', pretty_print=pretty_print) if self.part is not None: self.part.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct21': obj_ = POCP_MT010600UV_ManufacturedProduct2.factory() obj_.build(child_) self.manufacturedProduct21 = obj_ obj_.original_tagname_ = 'manufacturedProduct21' elif nodeName_ == 'content11': obj_ = POCP_MT010600UV_Content1.factory() obj_.build(child_) self.content11 = obj_ obj_.original_tagname_ = 'content11' elif nodeName_ == 'content1': obj_ = POCP_MT010600UV_Content.factory() obj_.build(child_) self.content1 = obj_ obj_.original_tagname_ = 'content1' elif nodeName_ == 'administerableMaterial': obj_ = POCP_MT010600UV_AdministerableMaterial.factory() obj_.build(child_) self.administerableMaterial = obj_ obj_.original_tagname_ = 'administerableMaterial' elif nodeName_ == 'manufacturedProduct3': obj_ = POCP_MT010600UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct3 = obj_ obj_.original_tagname_ = 'manufacturedProduct3' elif nodeName_ == 'part': obj_ = POCP_MT010600UV_Part.factory() obj_.build(child_) self.part = obj_ obj_.original_tagname_ = 'part' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010600UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct' elif nodeName_ == 'ingredient': obj_ = POCP_MT010600UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient'
# end class POCP_MT060100UV_Consumable2
[docs]class POCP_MT060100UV_DerivedFrom(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DRIV', realmCode=None, typeId=None, templateId=None, localVariableName=None, subsetCode=None, observationDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.localVariableName = localVariableName self.subsetCode = subsetCode self.observationDefinition = observationDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_DerivedFrom) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_DerivedFrom.subclass: return POCP_MT060100UV_DerivedFrom.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_DerivedFrom(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_localVariableName(self): return self.localVariableName
[docs] def set_localVariableName(self, localVariableName): self.localVariableName = localVariableName
[docs] def get_subsetCode(self): return self.subsetCode
[docs] def set_subsetCode(self, subsetCode): self.subsetCode = subsetCode
[docs] def get_observationDefinition(self): return self.observationDefinition
[docs] def set_observationDefinition(self, observationDefinition): self.observationDefinition = observationDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipIsDerivedFrom(self, value): # Validate type ActRelationshipIsDerivedFrom, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DRIV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipIsDerivedFrom' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipIsDerivedFrom_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipIsDerivedFrom_patterns_, ))
validate_ActRelationshipIsDerivedFrom_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.localVariableName is not None or self.subsetCode is not None or self.observationDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.DerivedFrom', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.DerivedFrom') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.DerivedFrom', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.DerivedFrom'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DRIV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.DerivedFrom', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.localVariableName is not None: self.localVariableName.export(outfile, level, namespace_, name_='localVariableName', pretty_print=pretty_print) if self.subsetCode is not None: self.subsetCode.export(outfile, level, namespace_, name_='subsetCode', pretty_print=pretty_print) if self.observationDefinition is not None: self.observationDefinition.export(outfile, level, namespace_, name_='observationDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipIsDerivedFrom(self.typeCode) # validate type ActRelationshipIsDerivedFrom
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'localVariableName': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.localVariableName = obj_ obj_.original_tagname_ = 'localVariableName' elif nodeName_ == 'subsetCode': obj_ = CS.factory() obj_.build(child_) self.subsetCode = obj_ obj_.original_tagname_ = 'subsetCode' elif nodeName_ == 'observationDefinition': obj_ = POCP_MT060100UV_ObservationDefinition.factory() obj_.build(child_) self.observationDefinition = obj_ obj_.original_tagname_ = 'observationDefinition'
# end class POCP_MT060100UV_DerivedFrom
[docs]class POCP_MT060100UV_Device(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DEV', realmCode=None, typeId=None, templateId=None, manufacturedProduct21=None, content11=None, content1=None, administerableMaterial=None, manufacturedProduct3=None, part=None, manufacturedProduct=None, ingredient=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct21 = manufacturedProduct21 self.content11 = content11 self.content1 = content1 self.administerableMaterial = administerableMaterial self.manufacturedProduct3 = manufacturedProduct3 self.part = part self.manufacturedProduct = manufacturedProduct self.ingredient = ingredient
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Device) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Device.subclass: return POCP_MT060100UV_Device.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Device(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct21(self): return self.manufacturedProduct21
[docs] def set_manufacturedProduct21(self, manufacturedProduct21): self.manufacturedProduct21 = manufacturedProduct21
[docs] def get_content11(self): return self.content11
[docs] def set_content11(self, content11): self.content11 = content11
[docs] def get_content1(self): return self.content1
[docs] def set_content1(self, content1): self.content1 = content1
[docs] def get_administerableMaterial(self): return self.administerableMaterial
[docs] def set_administerableMaterial(self, administerableMaterial): self.administerableMaterial = administerableMaterial
[docs] def get_manufacturedProduct3(self): return self.manufacturedProduct3
[docs] def set_manufacturedProduct3(self, manufacturedProduct3): self.manufacturedProduct3 = manufacturedProduct3
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct21 is not None or self.content11 is not None or self.content1 is not None or self.administerableMaterial is not None or self.manufacturedProduct3 is not None or self.part is not None or self.manufacturedProduct is not None or self.ingredient is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Device', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Device') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Device', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Device'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DEV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Device', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct21 is not None: self.manufacturedProduct21.export(outfile, level, namespace_, name_='manufacturedProduct21', pretty_print=pretty_print) if self.content11 is not None: self.content11.export(outfile, level, namespace_, name_='content11', pretty_print=pretty_print) if self.content1 is not None: self.content1.export(outfile, level, namespace_, name_='content1', pretty_print=pretty_print) if self.administerableMaterial is not None: self.administerableMaterial.export(outfile, level, namespace_, name_='administerableMaterial', pretty_print=pretty_print) if self.manufacturedProduct3 is not None: self.manufacturedProduct3.export(outfile, level, namespace_, name_='manufacturedProduct3', pretty_print=pretty_print) if self.part is not None: self.part.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct21': obj_ = POCP_MT010600UV_ManufacturedProduct2.factory() obj_.build(child_) self.manufacturedProduct21 = obj_ obj_.original_tagname_ = 'manufacturedProduct21' elif nodeName_ == 'content11': obj_ = POCP_MT010600UV_Content1.factory() obj_.build(child_) self.content11 = obj_ obj_.original_tagname_ = 'content11' elif nodeName_ == 'content1': obj_ = POCP_MT010600UV_Content.factory() obj_.build(child_) self.content1 = obj_ obj_.original_tagname_ = 'content1' elif nodeName_ == 'administerableMaterial': obj_ = POCP_MT010600UV_AdministerableMaterial.factory() obj_.build(child_) self.administerableMaterial = obj_ obj_.original_tagname_ = 'administerableMaterial' elif nodeName_ == 'manufacturedProduct3': obj_ = POCP_MT010600UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct3 = obj_ obj_.original_tagname_ = 'manufacturedProduct3' elif nodeName_ == 'part': obj_ = POCP_MT010600UV_Part.factory() obj_.build(child_) self.part = obj_ obj_.original_tagname_ = 'part' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010600UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct' elif nodeName_ == 'ingredient': obj_ = POCP_MT010600UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient'
# end class POCP_MT060100UV_Device
[docs]class POCP_MT060100UV_DocumentReference(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DOC', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, setId=None, versionNumber=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.setId = setId self.versionNumber = versionNumber
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_DocumentReference) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_DocumentReference.subclass: return POCP_MT060100UV_DocumentReference.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_DocumentReference(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_setId(self): return self.setId
[docs] def set_setId(self, setId): self.setId = setId
[docs] def get_versionNumber(self): return self.versionNumber
[docs] def set_versionNumber(self, versionNumber): self.versionNumber = versionNumber
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDocument(self, value): # Validate type ActClassDocument, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DOC', 'DOCCLIN', 'CDALVLONE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDocument' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDocument_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDocument_patterns_, ))
validate_ActClassDocument_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.setId is not None or self.versionNumber is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.DocumentReference', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.DocumentReference') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.DocumentReference', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.DocumentReference'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.DocumentReference', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.setId is not None: self.setId.export(outfile, level, namespace_, name_='setId', pretty_print=pretty_print) if self.versionNumber is not None: self.versionNumber.export(outfile, level, namespace_, name_='versionNumber', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDocument(self.classCode) # validate type ActClassDocument value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'setId': obj_ = II.factory() obj_.build(child_) self.setId = obj_ obj_.original_tagname_ = 'setId' elif nodeName_ == 'versionNumber': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.versionNumber = obj_ obj_.original_tagname_ = 'versionNumber'
# end class POCP_MT060100UV_DocumentReference
[docs]class POCP_MT060100UV_Effect(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Effect) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Effect.subclass: return POCP_MT060100UV_Effect.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Effect(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Effect', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Effect') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Effect', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Effect'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Effect', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code'
# end class POCP_MT060100UV_Effect
[docs]class POCP_MT060100UV_Frequency(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, value=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.value = value
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Frequency) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Frequency.subclass: return POCP_MT060100UV_Frequency.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Frequency(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.value is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Frequency', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Frequency') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Frequency', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Frequency'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Frequency', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value'
# end class POCP_MT060100UV_Frequency
[docs]class POCP_MT060100UV_Goal(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, effect=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.effect = effect
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Goal) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Goal.subclass: return POCP_MT060100UV_Goal.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Goal(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_effect(self): return self.effect
[docs] def set_effect(self, effect): self.effect = effect
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_cs(self, value): # Validate type cs, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_cs_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_cs_patterns_, ))
validate_cs_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.effect is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Goal', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Goal') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Goal', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Goal'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Goal', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.effect is not None: self.effect.export(outfile, level, namespace_, name_='effect', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.typeCode = ' '.join(self.typeCode.split()) self.validate_cs(self.typeCode) # validate type cs
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'effect': obj_ = POCP_MT060100UV_Effect.factory() obj_.build(child_) self.effect = obj_ obj_.original_tagname_ = 'effect'
# end class POCP_MT060100UV_Goal
[docs]class POCP_MT060100UV_IndicationObservationCriterion(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN.CRT', isCriterionInd=None, realmCode=None, typeId=None, templateId=None, code=None, value=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.value = value if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_IndicationObservationCriterion) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_IndicationObservationCriterion.subclass: return POCP_MT060100UV_IndicationObservationCriterion.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_IndicationObservationCriterion(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.value is not None or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.IndicationObservationCriterion', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.IndicationObservationCriterion') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.IndicationObservationCriterion', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.IndicationObservationCriterion'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.IndicationObservationCriterion', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'component': obj_ = POCP_MT060100UV_Component.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT060100UV_IndicationObservationCriterion
[docs]class POCP_MT060100UV_Issue(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ALRT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, risk=None, subject=None, mitigatedBy=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text if risk is None: self.risk = [] else: self.risk = risk if subject is None: self.subject = [] else: self.subject = subject if mitigatedBy is None: self.mitigatedBy = [] else: self.mitigatedBy = mitigatedBy
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Issue) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Issue.subclass: return POCP_MT060100UV_Issue.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Issue(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_risk(self): return self.risk
[docs] def set_risk(self, risk): self.risk = risk
[docs] def add_risk(self, value): self.risk.append(value)
[docs] def insert_risk_at(self, index, value): self.risk.insert(index, value)
[docs] def replace_risk_at(self, index, value): self.risk[index] = value
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def add_subject(self, value): self.subject.append(value)
[docs] def insert_subject_at(self, index, value): self.subject.insert(index, value)
[docs] def replace_subject_at(self, index, value): self.subject[index] = value
[docs] def get_mitigatedBy(self): return self.mitigatedBy
[docs] def set_mitigatedBy(self, mitigatedBy): self.mitigatedBy = mitigatedBy
[docs] def add_mitigatedBy(self, value): self.mitigatedBy.append(value)
[docs] def insert_mitigatedBy_at(self, index, value): self.mitigatedBy.insert(index, value)
[docs] def replace_mitigatedBy_at(self, index, value): self.mitigatedBy[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassDetectedIssue(self, value): # Validate type ActClassDetectedIssue, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassDetectedIssue' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassDetectedIssue_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassDetectedIssue_patterns_, ))
validate_ActClassDetectedIssue_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.risk or self.subject or self.mitigatedBy ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Issue', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Issue') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Issue', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Issue'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ALRT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Issue', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) for risk_ in self.risk: risk_.export(outfile, level, namespace_, name_='risk', pretty_print=pretty_print) for subject_ in self.subject: subject_.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) for mitigatedBy_ in self.mitigatedBy: mitigatedBy_.export(outfile, level, namespace_, name_='mitigatedBy', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassDetectedIssue(self.classCode) # validate type ActClassDetectedIssue value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'risk': obj_ = POCP_MT060100UV_Risk.factory() obj_.build(child_) self.risk.append(obj_) obj_.original_tagname_ = 'risk' elif nodeName_ == 'subject': obj_ = POCP_MT060100UV_Subject1.factory() obj_.build(child_) self.subject.append(obj_) obj_.original_tagname_ = 'subject' elif nodeName_ == 'mitigatedBy': obj_ = POCP_MT060100UV_Mitigates.factory() obj_.build(child_) self.mitigatedBy.append(obj_) obj_.original_tagname_ = 'mitigatedBy'
# end class POCP_MT060100UV_Issue
[docs]class POCP_MT060100UV_MaintenanceGoal(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='OBJC', realmCode=None, typeId=None, templateId=None, observationCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observationCriterion = observationCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_MaintenanceGoal) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_MaintenanceGoal.subclass: return POCP_MT060100UV_MaintenanceGoal.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_MaintenanceGoal(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observationCriterion(self): return self.observationCriterion
[docs] def set_observationCriterion(self, observationCriterion): self.observationCriterion = observationCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasContinuingObjective(self, value): # Validate type ActRelationshipHasContinuingObjective, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBJC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasContinuingObjective' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasContinuingObjective_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasContinuingObjective_patterns_, ))
validate_ActRelationshipHasContinuingObjective_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observationCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.MaintenanceGoal', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.MaintenanceGoal') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.MaintenanceGoal', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.MaintenanceGoal'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "OBJC" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.MaintenanceGoal', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observationCriterion is not None: self.observationCriterion.export(outfile, level, namespace_, name_='observationCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasContinuingObjective(self.typeCode) # validate type ActRelationshipHasContinuingObjective
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observationCriterion': obj_ = POCP_MT060100UV_ObservationCriterion.factory() obj_.build(child_) self.observationCriterion = obj_ obj_.original_tagname_ = 'observationCriterion'
# end class POCP_MT060100UV_MaintenanceGoal
[docs]class POCP_MT060100UV_Mitigates(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='MITGT', realmCode=None, typeId=None, templateId=None, protocol=None, requirement=None, monitoringObservation=None, substanceAdministration=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.protocol = protocol self.requirement = requirement self.monitoringObservation = monitoringObservation self.substanceAdministration = substanceAdministration
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Mitigates) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Mitigates.subclass: return POCP_MT060100UV_Mitigates.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Mitigates(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_protocol(self): return self.protocol
[docs] def set_protocol(self, protocol): self.protocol = protocol
[docs] def get_requirement(self): return self.requirement
[docs] def set_requirement(self, requirement): self.requirement = requirement
[docs] def get_monitoringObservation(self): return self.monitoringObservation
[docs] def set_monitoringObservation(self, monitoringObservation): self.monitoringObservation = monitoringObservation
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipMitigates(self, value): # Validate type ActRelationshipMitigates, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MITGT', 'RCVY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipMitigates' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipMitigates_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipMitigates_patterns_, ))
validate_ActRelationshipMitigates_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.protocol is not None or self.requirement is not None or self.monitoringObservation is not None or self.substanceAdministration is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Mitigates', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Mitigates') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Mitigates', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Mitigates'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "MITGT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Mitigates', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.protocol is not None: self.protocol.export(outfile, level, namespace_, name_='protocol', pretty_print=pretty_print) if self.requirement is not None: self.requirement.export(outfile, level, namespace_, name_='requirement', pretty_print=pretty_print) if self.monitoringObservation is not None: self.monitoringObservation.export(outfile, level, namespace_, name_='monitoringObservation', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipMitigates(self.typeCode) # validate type ActRelationshipMitigates
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'protocol': obj_ = POCP_MT060100UV_Protocol.factory() obj_.build(child_) self.protocol = obj_ obj_.original_tagname_ = 'protocol' elif nodeName_ == 'requirement': obj_ = POCP_MT060100UV_Requirement.factory() obj_.build(child_) self.requirement = obj_ obj_.original_tagname_ = 'requirement' elif nodeName_ == 'monitoringObservation': obj_ = POCP_MT060100UV_MonitoringObservation.factory() obj_.build(child_) self.monitoringObservation = obj_ obj_.original_tagname_ = 'monitoringObservation' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT060100UV_SubstanceAdministration1.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration'
# end class POCP_MT060100UV_Mitigates
[docs]class POCP_MT060100UV_MonitoringObservation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, effectiveTime=None, participation=None, reason=None, precondition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.effectiveTime = effectiveTime if participation is None: self.participation = [] else: self.participation = participation if reason is None: self.reason = [] else: self.reason = reason if precondition is None: self.precondition = [] else: self.precondition = precondition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_MonitoringObservation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_MonitoringObservation.subclass: return POCP_MT060100UV_MonitoringObservation.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_MonitoringObservation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_participation(self): return self.participation
[docs] def set_participation(self, participation): self.participation = participation
[docs] def add_participation(self, value): self.participation.append(value)
[docs] def insert_participation_at(self, index, value): self.participation.insert(index, value)
[docs] def replace_participation_at(self, index, value): self.participation[index] = value
[docs] def get_reason(self): return self.reason
[docs] def set_reason(self, reason): self.reason = reason
[docs] def add_reason(self, value): self.reason.append(value)
[docs] def insert_reason_at(self, index, value): self.reason.insert(index, value)
[docs] def replace_reason_at(self, index, value): self.reason[index] = value
[docs] def get_precondition(self): return self.precondition
[docs] def set_precondition(self, precondition): self.precondition = precondition
[docs] def add_precondition(self, value): self.precondition.append(value)
[docs] def insert_precondition_at(self, index, value): self.precondition.insert(index, value)
[docs] def replace_precondition_at(self, index, value): self.precondition[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.effectiveTime is not None or self.participation or self.reason or self.precondition ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.MonitoringObservation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.MonitoringObservation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.MonitoringObservation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.MonitoringObservation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.MonitoringObservation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for participation_ in self.participation: participation_.export(outfile, level, namespace_, name_='participation', pretty_print=pretty_print) for reason_ in self.reason: reason_.export(outfile, level, namespace_, name_='reason', pretty_print=pretty_print) for precondition_ in self.precondition: precondition_.export(outfile, level, namespace_, name_='precondition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'participation': obj_ = POCP_MT060100UV_Participant.factory() obj_.build(child_) self.participation.append(obj_) obj_.original_tagname_ = 'participation' elif nodeName_ == 'reason': obj_ = POCP_MT060100UV_Reason.factory() obj_.build(child_) self.reason.append(obj_) obj_.original_tagname_ = 'reason' elif nodeName_ == 'precondition': obj_ = POCP_MT060100UV_Precondition.factory() obj_.build(child_) self.precondition.append(obj_) obj_.original_tagname_ = 'precondition'
# end class POCP_MT060100UV_MonitoringObservation
[docs]class POCP_MT060100UV_ObservationCriterion(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN.CRT', isCriterionInd=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, value=None, valueNegationInd=None, analyte=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.value = value self.valueNegationInd = valueNegationInd if analyte is None: self.analyte = [] else: self.analyte = analyte
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_ObservationCriterion) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_ObservationCriterion.subclass: return POCP_MT060100UV_ObservationCriterion.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_ObservationCriterion(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_valueNegationInd(self): return self.valueNegationInd
[docs] def set_valueNegationInd(self, valueNegationInd): self.valueNegationInd = valueNegationInd
[docs] def get_analyte(self): return self.analyte
[docs] def set_analyte(self, analyte): self.analyte = analyte
[docs] def add_analyte(self, value): self.analyte.append(value)
[docs] def insert_analyte_at(self, index, value): self.analyte.insert(index, value)
[docs] def replace_analyte_at(self, index, value): self.analyte[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.value is not None or self.valueNegationInd is not None or self.analyte ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ObservationCriterion', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.ObservationCriterion') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.ObservationCriterion', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.ObservationCriterion'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ObservationCriterion', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.valueNegationInd is not None: self.valueNegationInd.export(outfile, level, namespace_, name_='valueNegationInd', pretty_print=pretty_print) for analyte_ in self.analyte: analyte_.export(outfile, level, namespace_, name_='analyte', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'valueNegationInd': obj_ = BL.factory() obj_.build(child_) self.valueNegationInd = obj_ obj_.original_tagname_ = 'valueNegationInd' elif nodeName_ == 'analyte': obj_ = POCP_MT060100UV_Analyte.factory() obj_.build(child_) self.analyte.append(obj_) obj_.original_tagname_ = 'analyte'
# end class POCP_MT060100UV_ObservationCriterion
[docs]class POCP_MT060100UV_ObservationDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_ObservationDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_ObservationDefinition.subclass: return POCP_MT060100UV_ObservationDefinition.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_ObservationDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ObservationDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.ObservationDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.ObservationDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.ObservationDefinition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ObservationDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code'
# end class POCP_MT060100UV_ObservationDefinition
[docs]class POCP_MT060100UV_Participant(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PART', realmCode=None, typeId=None, templateId=None, stakeholder=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.stakeholder = stakeholder
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Participant) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Participant.subclass: return POCP_MT060100UV_Participant.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Participant(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_stakeholder(self): return self.stakeholder
[docs] def set_stakeholder(self, stakeholder): self.stakeholder = stakeholder
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationParticipation(self, value): # Validate type ParticipationParticipation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ADM', 'ATND', 'CALLBCK', 'CON', 'DIS', 'ESC', 'REF', 'AUT', 'INF', 'TRANS', 'ENT', 'WIT', 'CST', 'DIR', 'ALY', 'BBY', 'CAT', 'CSM', 'DEV', 'NRD', 'RDV', 'DON', 'EXPAGNT', 'EXPART', 'EXPTRGT', 'EXSRC', 'PRD', 'SBJ', 'SPC', 'IND', 'BEN', 'CAGNT', 'COV', 'GUAR', 'HLD', 'RCT', 'RCV', 'IRCP', 'NOT', 'PRCP', 'REFB', 'REFT', 'TRC', 'LOC', 'DST', 'ELOC', 'ORG', 'RML', 'VIA', 'PRF', 'DIST', 'PPRF', 'SPRF', 'RESP', 'VRF', 'AUTHEN', 'LA'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationParticipation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationParticipation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationParticipation_patterns_, ))
validate_ParticipationParticipation_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.stakeholder is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Participant', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Participant') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Participant', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Participant'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PART" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Participant', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.stakeholder is not None: self.stakeholder.export(outfile, level, namespace_, name_='stakeholder', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationParticipation(self.typeCode) # validate type ParticipationParticipation
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'stakeholder': obj_ = POCP_MT060100UV_Stakeholder.factory() obj_.build(child_) self.stakeholder = obj_ obj_.original_tagname_ = 'stakeholder'
# end class POCP_MT060100UV_Participant
[docs]class POCP_MT060100UV_Precondition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRCN', realmCode=None, typeId=None, templateId=None, priorityNumber=None, pauseQuantity=None, checkpointCode=None, observationCriterion=None, actCriterion=None, substanceAdministrationCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.priorityNumber = priorityNumber self.pauseQuantity = pauseQuantity self.checkpointCode = checkpointCode self.observationCriterion = observationCriterion self.actCriterion = actCriterion self.substanceAdministrationCriterion = substanceAdministrationCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Precondition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Precondition.subclass: return POCP_MT060100UV_Precondition.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Precondition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_priorityNumber(self): return self.priorityNumber
[docs] def set_priorityNumber(self, priorityNumber): self.priorityNumber = priorityNumber
[docs] def get_pauseQuantity(self): return self.pauseQuantity
[docs] def set_pauseQuantity(self, pauseQuantity): self.pauseQuantity = pauseQuantity
[docs] def get_checkpointCode(self): return self.checkpointCode
[docs] def set_checkpointCode(self, checkpointCode): self.checkpointCode = checkpointCode
[docs] def get_observationCriterion(self): return self.observationCriterion
[docs] def set_observationCriterion(self, observationCriterion): self.observationCriterion = observationCriterion
[docs] def get_actCriterion(self): return self.actCriterion
[docs] def set_actCriterion(self, actCriterion): self.actCriterion = actCriterion
[docs] def get_substanceAdministrationCriterion(self): return self.substanceAdministrationCriterion
[docs] def set_substanceAdministrationCriterion(self, substanceAdministrationCriterion): self.substanceAdministrationCriterion = substanceAdministrationCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasPre_condition(self, value): # Validate type ActRelationshipHasPre-condition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRCN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasPre-condition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasPre_condition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasPre_condition_patterns_, ))
validate_ActRelationshipHasPre_condition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.priorityNumber is not None or self.pauseQuantity is not None or self.checkpointCode is not None or self.observationCriterion is not None or self.actCriterion is not None or self.substanceAdministrationCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Precondition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Precondition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Precondition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Precondition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRCN" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Precondition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.priorityNumber is not None: self.priorityNumber.export(outfile, level, namespace_, name_='priorityNumber', pretty_print=pretty_print) if self.pauseQuantity is not None: self.pauseQuantity.export(outfile, level, namespace_, name_='pauseQuantity', pretty_print=pretty_print) if self.checkpointCode is not None: self.checkpointCode.export(outfile, level, namespace_, name_='checkpointCode', pretty_print=pretty_print) if self.observationCriterion is not None: self.observationCriterion.export(outfile, level, namespace_, name_='observationCriterion', pretty_print=pretty_print) if self.actCriterion is not None: self.actCriterion.export(outfile, level, namespace_, name_='actCriterion', pretty_print=pretty_print) if self.substanceAdministrationCriterion is not None: self.substanceAdministrationCriterion.export(outfile, level, namespace_, name_='substanceAdministrationCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasPre_condition(self.typeCode) # validate type ActRelationshipHasPre-condition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'priorityNumber': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.priorityNumber = obj_ obj_.original_tagname_ = 'priorityNumber' elif nodeName_ == 'pauseQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.pauseQuantity = obj_ obj_.original_tagname_ = 'pauseQuantity' elif nodeName_ == 'checkpointCode': obj_ = CS.factory() obj_.build(child_) self.checkpointCode = obj_ obj_.original_tagname_ = 'checkpointCode' elif nodeName_ == 'observationCriterion': obj_ = POCP_MT060100UV_ObservationCriterion.factory() obj_.build(child_) self.observationCriterion = obj_ obj_.original_tagname_ = 'observationCriterion' elif nodeName_ == 'actCriterion': obj_ = POCP_MT060100UV_ActCriterion.factory() obj_.build(child_) self.actCriterion = obj_ obj_.original_tagname_ = 'actCriterion' elif nodeName_ == 'substanceAdministrationCriterion': obj_ = POCP_MT060100UV_SubstanceAdministrationCriterion.factory() obj_.build(child_) self.substanceAdministrationCriterion = obj_ obj_.original_tagname_ = 'substanceAdministrationCriterion'
# end class POCP_MT060100UV_Precondition
[docs]class POCP_MT060100UV_ProcedureCriterion(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='EVN.CRT', isCriterionInd=None, realmCode=None, typeId=None, templateId=None, code=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_ProcedureCriterion) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_ProcedureCriterion.subclass: return POCP_MT060100UV_ProcedureCriterion.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_ProcedureCriterion(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ProcedureCriterion', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.ProcedureCriterion') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.ProcedureCriterion', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.ProcedureCriterion'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.ProcedureCriterion', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'component': obj_ = POCP_MT060100UV_Component.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT060100UV_ProcedureCriterion
[docs]class POCP_MT060100UV_Protocol(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, participation=None, maintenanceGoal=None, reason=None, precondition=None, component=None, componentOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code if participation is None: self.participation = [] else: self.participation = participation if maintenanceGoal is None: self.maintenanceGoal = [] else: self.maintenanceGoal = maintenanceGoal if reason is None: self.reason = [] else: self.reason = reason if precondition is None: self.precondition = [] else: self.precondition = precondition if component is None: self.component = [] else: self.component = component self.componentOf = componentOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Protocol) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Protocol.subclass: return POCP_MT060100UV_Protocol.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Protocol(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_participation(self): return self.participation
[docs] def set_participation(self, participation): self.participation = participation
[docs] def add_participation(self, value): self.participation.append(value)
[docs] def insert_participation_at(self, index, value): self.participation.insert(index, value)
[docs] def replace_participation_at(self, index, value): self.participation[index] = value
[docs] def get_maintenanceGoal(self): return self.maintenanceGoal
[docs] def set_maintenanceGoal(self, maintenanceGoal): self.maintenanceGoal = maintenanceGoal
[docs] def add_maintenanceGoal(self, value): self.maintenanceGoal.append(value)
[docs] def insert_maintenanceGoal_at(self, index, value): self.maintenanceGoal.insert(index, value)
[docs] def replace_maintenanceGoal_at(self, index, value): self.maintenanceGoal[index] = value
[docs] def get_reason(self): return self.reason
[docs] def set_reason(self, reason): self.reason = reason
[docs] def add_reason(self, value): self.reason.append(value)
[docs] def insert_reason_at(self, index, value): self.reason.insert(index, value)
[docs] def replace_reason_at(self, index, value): self.reason[index] = value
[docs] def get_precondition(self): return self.precondition
[docs] def set_precondition(self, precondition): self.precondition = precondition
[docs] def add_precondition(self, value): self.precondition.append(value)
[docs] def insert_precondition_at(self, index, value): self.precondition.insert(index, value)
[docs] def replace_precondition_at(self, index, value): self.precondition[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_componentOf(self): return self.componentOf
[docs] def set_componentOf(self, componentOf): self.componentOf = componentOf
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.participation or self.maintenanceGoal or self.reason or self.precondition or self.component or self.componentOf is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Protocol', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Protocol') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Protocol', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Protocol'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Protocol', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for participation_ in self.participation: participation_.export(outfile, level, namespace_, name_='participation', pretty_print=pretty_print) for maintenanceGoal_ in self.maintenanceGoal: maintenanceGoal_.export(outfile, level, namespace_, name_='maintenanceGoal', pretty_print=pretty_print) for reason_ in self.reason: reason_.export(outfile, level, namespace_, name_='reason', pretty_print=pretty_print) for precondition_ in self.precondition: precondition_.export(outfile, level, namespace_, name_='precondition', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) if self.componentOf is not None: self.componentOf.export(outfile, level, namespace_, name_='componentOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'participation': obj_ = POCP_MT060100UV_Participant.factory() obj_.build(child_) self.participation.append(obj_) obj_.original_tagname_ = 'participation' elif nodeName_ == 'maintenanceGoal': obj_ = POCP_MT060100UV_MaintenanceGoal.factory() obj_.build(child_) self.maintenanceGoal.append(obj_) obj_.original_tagname_ = 'maintenanceGoal' elif nodeName_ == 'reason': obj_ = POCP_MT060100UV_Reason.factory() obj_.build(child_) self.reason.append(obj_) obj_.original_tagname_ = 'reason' elif nodeName_ == 'precondition': obj_ = POCP_MT060100UV_Precondition.factory() obj_.build(child_) self.precondition.append(obj_) obj_.original_tagname_ = 'precondition' elif nodeName_ == 'component': obj_ = POCP_MT060100UV_Component2.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component' elif nodeName_ == 'componentOf': obj_ = POCP_MT060100UV_Component4.factory() obj_.build(child_) self.componentOf = obj_ obj_.original_tagname_ = 'componentOf'
# end class POCP_MT060100UV_Protocol
[docs]class POCP_MT060100UV_Reason(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='RSON', negationInd='false', realmCode=None, typeId=None, templateId=None, indicationObservationCriterion=None, procedureCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.negationInd = _cast(None, negationInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.indicationObservationCriterion = indicationObservationCriterion self.procedureCriterion = procedureCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Reason) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Reason.subclass: return POCP_MT060100UV_Reason.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Reason(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_indicationObservationCriterion(self): return self.indicationObservationCriterion
[docs] def set_indicationObservationCriterion(self, indicationObservationCriterion): self.indicationObservationCriterion = indicationObservationCriterion
[docs] def get_procedureCriterion(self): return self.procedureCriterion
[docs] def set_procedureCriterion(self, procedureCriterion): self.procedureCriterion = procedureCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_negationInd(self): return self.negationInd
[docs] def set_negationInd(self, negationInd): self.negationInd = negationInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipReason(self, value): # Validate type ActRelationshipReason, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['RSON', 'BLOCK', 'DIAG', 'IMM', 'ACTIMM', 'PASSIMM', 'MITGT', 'RCVY', 'PRYLX', 'TREAT', 'ADJUNCT', 'MTREAT', 'PALLTREAT', 'SYMP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipReason' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipReason_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipReason_patterns_, ))
validate_ActRelationshipReason_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.indicationObservationCriterion is not None or self.procedureCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Reason', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Reason') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Reason', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Reason'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "RSON" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.negationInd and 'negationInd' not in already_processed: already_processed.add('negationInd') outfile.write(' negationInd=%s' % (quote_attrib(self.negationInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Reason', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.indicationObservationCriterion is not None: self.indicationObservationCriterion.export(outfile, level, namespace_, name_='indicationObservationCriterion', pretty_print=pretty_print) if self.procedureCriterion is not None: self.procedureCriterion.export(outfile, level, namespace_, name_='procedureCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipReason(self.typeCode) # validate type ActRelationshipReason value = find_attr_value_('negationInd', node) if value is not None and 'negationInd' not in already_processed: already_processed.add('negationInd') if value in ('true', '1'): self.negationInd = True elif value in ('false', '0'): self.negationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.negationInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'indicationObservationCriterion': obj_ = POCP_MT060100UV_IndicationObservationCriterion.factory() obj_.build(child_) self.indicationObservationCriterion = obj_ obj_.original_tagname_ = 'indicationObservationCriterion' elif nodeName_ == 'procedureCriterion': obj_ = POCP_MT060100UV_ProcedureCriterion.factory() obj_.build(child_) self.procedureCriterion = obj_ obj_.original_tagname_ = 'procedureCriterion'
# end class POCP_MT060100UV_Reason
[docs]class POCP_MT060100UV_Requirement(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, effectiveTime=None, participation=None, reason=None, precondition=None, subject=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.effectiveTime = effectiveTime if participation is None: self.participation = [] else: self.participation = participation if reason is None: self.reason = [] else: self.reason = reason if precondition is None: self.precondition = [] else: self.precondition = precondition if subject is None: self.subject = [] else: self.subject = subject
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Requirement) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Requirement.subclass: return POCP_MT060100UV_Requirement.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Requirement(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_participation(self): return self.participation
[docs] def set_participation(self, participation): self.participation = participation
[docs] def add_participation(self, value): self.participation.append(value)
[docs] def insert_participation_at(self, index, value): self.participation.insert(index, value)
[docs] def replace_participation_at(self, index, value): self.participation[index] = value
[docs] def get_reason(self): return self.reason
[docs] def set_reason(self, reason): self.reason = reason
[docs] def add_reason(self, value): self.reason.append(value)
[docs] def insert_reason_at(self, index, value): self.reason.insert(index, value)
[docs] def replace_reason_at(self, index, value): self.reason[index] = value
[docs] def get_precondition(self): return self.precondition
[docs] def set_precondition(self, precondition): self.precondition = precondition
[docs] def add_precondition(self, value): self.precondition.append(value)
[docs] def insert_precondition_at(self, index, value): self.precondition.insert(index, value)
[docs] def replace_precondition_at(self, index, value): self.precondition[index] = value
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def add_subject(self, value): self.subject.append(value)
[docs] def insert_subject_at(self, index, value): self.subject.insert(index, value)
[docs] def replace_subject_at(self, index, value): self.subject[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.effectiveTime is not None or self.participation or self.reason or self.precondition or self.subject ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Requirement', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Requirement') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Requirement', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Requirement'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Requirement', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for participation_ in self.participation: participation_.export(outfile, level, namespace_, name_='participation', pretty_print=pretty_print) for reason_ in self.reason: reason_.export(outfile, level, namespace_, name_='reason', pretty_print=pretty_print) for precondition_ in self.precondition: precondition_.export(outfile, level, namespace_, name_='precondition', pretty_print=pretty_print) for subject_ in self.subject: subject_.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'participation': obj_ = POCP_MT060100UV_Participant.factory() obj_.build(child_) self.participation.append(obj_) obj_.original_tagname_ = 'participation' elif nodeName_ == 'reason': obj_ = POCP_MT060100UV_Reason.factory() obj_.build(child_) self.reason.append(obj_) obj_.original_tagname_ = 'reason' elif nodeName_ == 'precondition': obj_ = POCP_MT060100UV_Precondition.factory() obj_.build(child_) self.precondition.append(obj_) obj_.original_tagname_ = 'precondition' elif nodeName_ == 'subject': obj_ = POCP_MT060100UV_Subject.factory() obj_.build(child_) self.subject.append(obj_) obj_.original_tagname_ = 'subject'
# end class POCP_MT060100UV_Requirement
[docs]class POCP_MT060100UV_Risk(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='RISK', realmCode=None, typeId=None, templateId=None, consequenceObservation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.consequenceObservation = consequenceObservation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Risk) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Risk.subclass: return POCP_MT060100UV_Risk.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Risk(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_consequenceObservation(self): return self.consequenceObservation
[docs] def set_consequenceObservation(self, consequenceObservation): self.consequenceObservation = consequenceObservation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasRisk(self, value): # Validate type ActRelationshipHasRisk, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['RISK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasRisk' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasRisk_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasRisk_patterns_, ))
validate_ActRelationshipHasRisk_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.consequenceObservation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Risk', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Risk') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Risk', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Risk'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "RISK" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Risk', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.consequenceObservation is not None: self.consequenceObservation.export(outfile, level, namespace_, name_='consequenceObservation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasRisk(self.typeCode) # validate type ActRelationshipHasRisk
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'consequenceObservation': obj_ = POCP_MT060100UV_ConsequenceObservation.factory() obj_.build(child_) self.consequenceObservation = obj_ obj_.original_tagname_ = 'consequenceObservation'
# end class POCP_MT060100UV_Risk
[docs]class POCP_MT060100UV_Severity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, code=None, value=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.value = value
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Severity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Severity.subclass: return POCP_MT060100UV_Severity.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Severity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.value is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Severity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Severity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Severity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Severity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Severity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.value = obj_ obj_.original_tagname_ = 'value'
# end class POCP_MT060100UV_Severity
[docs]class POCP_MT060100UV_Stakeholder(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ROL', realmCode=None, typeId=None, templateId=None, code=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Stakeholder) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Stakeholder.subclass: return POCP_MT060100UV_Stakeholder.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Stakeholder(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassRoot(self, value): # Validate type RoleClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ROL', 'AFFL', 'AGNT', 'ASSIGNED', 'COMPAR', 'SGNOFF', 'CON', 'ECON', 'NOK', 'GUARD', 'CIT', 'COVPTY', 'CLAIM', 'NAMED', 'DEPEN', 'INDIV', 'SUBSCR', 'PROG', 'CRINV', 'CRSPNSR', 'EMP', 'MIL', 'GUAR', 'INVSBJ', 'CASEBJ', 'RESBJ', 'LIC', 'NOT', 'PROV', 'PAT', 'PAYEE', 'PAYOR', 'POLHOLD', 'QUAL', 'SPNSR', 'STD', 'UNDWRT', 'CAREGIVER', 'PRS', 'ACCESS', 'ADJY', 'CONC', 'BOND', 'CONY', 'ADMM', 'BIRTHPL', 'DEATHPLC', 'DST', 'RET', 'EXLOC', 'SDLOC', 'DSDLOC', 'ISDLOC', 'EXPR', 'HLD', 'HLTHCHRT', 'IDENT', 'MANU', 'THER', 'MNT', 'OWN', 'RGPR', 'TERR', 'USED', 'WRTE', 'EQUIV', 'SAME', 'SUBY', 'GEN', 'GRIC', 'INST', 'CONT', 'EXPAGTCAR', 'EXPVECTOR', 'FOMITE', 'INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH', 'LOCE', 'STOR', 'MBR', 'PART', 'ACTM', 'SPEC', 'ALQT', 'ISLT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassRoot_patterns_, ))
validate_RoleClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Stakeholder', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Stakeholder') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Stakeholder', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Stakeholder'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ROL" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Stakeholder', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassRoot(self.classCode) # validate type RoleClassRoot
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code'
# end class POCP_MT060100UV_Stakeholder
[docs]class POCP_MT060100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, documentReference=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.documentReference = documentReference
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Subject.subclass: return POCP_MT060100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_documentReference(self): return self.documentReference
[docs] def set_documentReference(self, documentReference): self.documentReference = documentReference
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.documentReference is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.documentReference is not None: self.documentReference.export(outfile, level, namespace_, name_='documentReference', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'documentReference': obj_ = POCP_MT060100UV_DocumentReference.factory() obj_.build(child_) self.documentReference = obj_ obj_.original_tagname_ = 'documentReference'
# end class POCP_MT060100UV_Subject
[docs]class POCP_MT060100UV_Subject1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, observationCriterion=None, actCriterion=None, substanceAdministrationCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observationCriterion = observationCriterion self.actCriterion = actCriterion self.substanceAdministrationCriterion = substanceAdministrationCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Subject1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Subject1.subclass: return POCP_MT060100UV_Subject1.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Subject1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observationCriterion(self): return self.observationCriterion
[docs] def set_observationCriterion(self, observationCriterion): self.observationCriterion = observationCriterion
[docs] def get_actCriterion(self): return self.actCriterion
[docs] def set_actCriterion(self, actCriterion): self.actCriterion = actCriterion
[docs] def get_substanceAdministrationCriterion(self): return self.substanceAdministrationCriterion
[docs] def set_substanceAdministrationCriterion(self, substanceAdministrationCriterion): self.substanceAdministrationCriterion = substanceAdministrationCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observationCriterion is not None or self.actCriterion is not None or self.substanceAdministrationCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Subject1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Subject1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Subject1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observationCriterion is not None: self.observationCriterion.export(outfile, level, namespace_, name_='observationCriterion', pretty_print=pretty_print) if self.actCriterion is not None: self.actCriterion.export(outfile, level, namespace_, name_='actCriterion', pretty_print=pretty_print) if self.substanceAdministrationCriterion is not None: self.substanceAdministrationCriterion.export(outfile, level, namespace_, name_='substanceAdministrationCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observationCriterion': obj_ = POCP_MT060100UV_ObservationCriterion.factory() obj_.build(child_) self.observationCriterion = obj_ obj_.original_tagname_ = 'observationCriterion' elif nodeName_ == 'actCriterion': obj_ = POCP_MT060100UV_ActCriterion.factory() obj_.build(child_) self.actCriterion = obj_ obj_.original_tagname_ = 'actCriterion' elif nodeName_ == 'substanceAdministrationCriterion': obj_ = POCP_MT060100UV_SubstanceAdministrationCriterion.factory() obj_.build(child_) self.substanceAdministrationCriterion = obj_ obj_.original_tagname_ = 'substanceAdministrationCriterion'
# end class POCP_MT060100UV_Subject1
[docs]class POCP_MT060100UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, characteristic=None, approval=None, issue=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.characteristic = characteristic self.approval = approval self.issue = issue
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Subject2.subclass: return POCP_MT060100UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_issue(self): return self.issue
[docs] def set_issue(self, issue): self.issue = issue
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.characteristic is not None or self.approval is not None or self.issue is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print) if self.issue is not None: self.issue.export(outfile, level, namespace_, name_='issue', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'characteristic': obj_ = POCP_MT050500UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval' elif nodeName_ == 'issue': obj_ = POCP_MT060100UV_Issue.factory() obj_.build(child_) self.issue = obj_ obj_.original_tagname_ = 'issue'
# end class POCP_MT060100UV_Subject2
[docs]class POCP_MT060100UV_Subject3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, severity=None, frequency=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.severity = severity self.frequency = frequency
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Subject3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Subject3.subclass: return POCP_MT060100UV_Subject3.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Subject3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_severity(self): return self.severity
[docs] def set_severity(self, severity): self.severity = severity
[docs] def get_frequency(self): return self.frequency
[docs] def set_frequency(self, frequency): self.frequency = frequency
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.severity is not None or self.frequency is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Subject3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Subject3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Subject3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.severity is not None: self.severity.export(outfile, level, namespace_, name_='severity', pretty_print=pretty_print) if self.frequency is not None: self.frequency.export(outfile, level, namespace_, name_='frequency', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'severity': obj_ = POCP_MT060100UV_Severity.factory() obj_.build(child_) self.severity = obj_ obj_.original_tagname_ = 'severity' elif nodeName_ == 'frequency': obj_ = POCP_MT060100UV_Frequency.factory() obj_.build(child_) self.frequency = obj_ obj_.original_tagname_ = 'frequency'
# end class POCP_MT060100UV_Subject3
[docs]class POCP_MT060100UV_Subject4(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_Subject4) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_Subject4.subclass: return POCP_MT060100UV_Subject4.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_Subject4(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject4', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.Subject4') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.Subject4', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.Subject4'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.Subject4', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT060100UV_Subject4
[docs]class POCP_MT060100UV_SubstanceAdministration1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SBADM', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, text=None, effectiveTime=None, methodCode=None, approachSiteCode=None, targetSiteCode=None, routeCode=None, doseQuantity=None, maxDoseQuantity=None, consumable=None, device=None, subject=None, reason=None, precondition=None, goal=None, maintenanceGoal=None, component=None, componentOf=None, subjectOf=None, derivedFrom=None, participation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.text = text self.effectiveTime = effectiveTime if methodCode is None: self.methodCode = [] else: self.methodCode = methodCode if approachSiteCode is None: self.approachSiteCode = [] else: self.approachSiteCode = approachSiteCode if targetSiteCode is None: self.targetSiteCode = [] else: self.targetSiteCode = targetSiteCode self.routeCode = routeCode self.doseQuantity = doseQuantity if maxDoseQuantity is None: self.maxDoseQuantity = [] else: self.maxDoseQuantity = maxDoseQuantity self.consumable = consumable self.device = device if subject is None: self.subject = [] else: self.subject = subject self.reason = reason if precondition is None: self.precondition = [] else: self.precondition = precondition if goal is None: self.goal = [] else: self.goal = goal if maintenanceGoal is None: self.maintenanceGoal = [] else: self.maintenanceGoal = maintenanceGoal if component is None: self.component = [] else: self.component = component self.componentOf = componentOf if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if derivedFrom is None: self.derivedFrom = [] else: self.derivedFrom = derivedFrom if participation is None: self.participation = [] else: self.participation = participation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_SubstanceAdministration1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_SubstanceAdministration1.subclass: return POCP_MT060100UV_SubstanceAdministration1.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_SubstanceAdministration1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def add_methodCode(self, value): self.methodCode.append(value)
[docs] def insert_methodCode_at(self, index, value): self.methodCode.insert(index, value)
[docs] def replace_methodCode_at(self, index, value): self.methodCode[index] = value
[docs] def get_approachSiteCode(self): return self.approachSiteCode
[docs] def set_approachSiteCode(self, approachSiteCode): self.approachSiteCode = approachSiteCode
[docs] def add_approachSiteCode(self, value): self.approachSiteCode.append(value)
[docs] def insert_approachSiteCode_at(self, index, value): self.approachSiteCode.insert(index, value)
[docs] def replace_approachSiteCode_at(self, index, value): self.approachSiteCode[index] = value
[docs] def get_targetSiteCode(self): return self.targetSiteCode
[docs] def set_targetSiteCode(self, targetSiteCode): self.targetSiteCode = targetSiteCode
[docs] def add_targetSiteCode(self, value): self.targetSiteCode.append(value)
[docs] def insert_targetSiteCode_at(self, index, value): self.targetSiteCode.insert(index, value)
[docs] def replace_targetSiteCode_at(self, index, value): self.targetSiteCode[index] = value
[docs] def get_routeCode(self): return self.routeCode
[docs] def set_routeCode(self, routeCode): self.routeCode = routeCode
[docs] def get_doseQuantity(self): return self.doseQuantity
[docs] def set_doseQuantity(self, doseQuantity): self.doseQuantity = doseQuantity
[docs] def get_maxDoseQuantity(self): return self.maxDoseQuantity
[docs] def set_maxDoseQuantity(self, maxDoseQuantity): self.maxDoseQuantity = maxDoseQuantity
[docs] def add_maxDoseQuantity(self, value): self.maxDoseQuantity.append(value)
[docs] def insert_maxDoseQuantity_at(self, index, value): self.maxDoseQuantity.insert(index, value)
[docs] def replace_maxDoseQuantity_at(self, index, value): self.maxDoseQuantity[index] = value
[docs] def get_consumable(self): return self.consumable
[docs] def set_consumable(self, consumable): self.consumable = consumable
[docs] def get_device(self): return self.device
[docs] def set_device(self, device): self.device = device
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def add_subject(self, value): self.subject.append(value)
[docs] def insert_subject_at(self, index, value): self.subject.insert(index, value)
[docs] def replace_subject_at(self, index, value): self.subject[index] = value
[docs] def get_reason(self): return self.reason
[docs] def set_reason(self, reason): self.reason = reason
[docs] def get_precondition(self): return self.precondition
[docs] def set_precondition(self, precondition): self.precondition = precondition
[docs] def add_precondition(self, value): self.precondition.append(value)
[docs] def insert_precondition_at(self, index, value): self.precondition.insert(index, value)
[docs] def replace_precondition_at(self, index, value): self.precondition[index] = value
[docs] def get_goal(self): return self.goal
[docs] def set_goal(self, goal): self.goal = goal
[docs] def add_goal(self, value): self.goal.append(value)
[docs] def insert_goal_at(self, index, value): self.goal.insert(index, value)
[docs] def replace_goal_at(self, index, value): self.goal[index] = value
[docs] def get_maintenanceGoal(self): return self.maintenanceGoal
[docs] def set_maintenanceGoal(self, maintenanceGoal): self.maintenanceGoal = maintenanceGoal
[docs] def add_maintenanceGoal(self, value): self.maintenanceGoal.append(value)
[docs] def insert_maintenanceGoal_at(self, index, value): self.maintenanceGoal.insert(index, value)
[docs] def replace_maintenanceGoal_at(self, index, value): self.maintenanceGoal[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_componentOf(self): return self.componentOf
[docs] def set_componentOf(self, componentOf): self.componentOf = componentOf
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_derivedFrom(self): return self.derivedFrom
[docs] def set_derivedFrom(self, derivedFrom): self.derivedFrom = derivedFrom
[docs] def add_derivedFrom(self, value): self.derivedFrom.append(value)
[docs] def insert_derivedFrom_at(self, index, value): self.derivedFrom.insert(index, value)
[docs] def replace_derivedFrom_at(self, index, value): self.derivedFrom[index] = value
[docs] def get_participation(self): return self.participation
[docs] def set_participation(self, participation): self.participation = participation
[docs] def add_participation(self, value): self.participation.append(value)
[docs] def insert_participation_at(self, index, value): self.participation.insert(index, value)
[docs] def replace_participation_at(self, index, value): self.participation[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSubstanceAdministration(self, value): # Validate type ActClassSubstanceAdministration, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBADM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSubstanceAdministration' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSubstanceAdministration_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSubstanceAdministration_patterns_, ))
validate_ActClassSubstanceAdministration_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.text is not None or self.effectiveTime is not None or self.methodCode or self.approachSiteCode or self.targetSiteCode or self.routeCode is not None or self.doseQuantity is not None or self.maxDoseQuantity or self.consumable is not None or self.device is not None or self.subject or self.reason is not None or self.precondition or self.goal or self.maintenanceGoal or self.component or self.componentOf is not None or self.subjectOf or self.derivedFrom or self.participation ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.SubstanceAdministration1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SBADM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for methodCode_ in self.methodCode: methodCode_.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) for approachSiteCode_ in self.approachSiteCode: approachSiteCode_.export(outfile, level, namespace_, name_='approachSiteCode', pretty_print=pretty_print) for targetSiteCode_ in self.targetSiteCode: targetSiteCode_.export(outfile, level, namespace_, name_='targetSiteCode', pretty_print=pretty_print) if self.routeCode is not None: self.routeCode.export(outfile, level, namespace_, name_='routeCode', pretty_print=pretty_print) if self.doseQuantity is not None: self.doseQuantity.export(outfile, level, namespace_, name_='doseQuantity', pretty_print=pretty_print) for maxDoseQuantity_ in self.maxDoseQuantity: maxDoseQuantity_.export(outfile, level, namespace_, name_='maxDoseQuantity', pretty_print=pretty_print) if self.consumable is not None: self.consumable.export(outfile, level, namespace_, name_='consumable', pretty_print=pretty_print) if self.device is not None: self.device.export(outfile, level, namespace_, name_='device', pretty_print=pretty_print) for subject_ in self.subject: subject_.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) if self.reason is not None: self.reason.export(outfile, level, namespace_, name_='reason', pretty_print=pretty_print) for precondition_ in self.precondition: precondition_.export(outfile, level, namespace_, name_='precondition', pretty_print=pretty_print) for goal_ in self.goal: goal_.export(outfile, level, namespace_, name_='goal', pretty_print=pretty_print) for maintenanceGoal_ in self.maintenanceGoal: maintenanceGoal_.export(outfile, level, namespace_, name_='maintenanceGoal', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print) if self.componentOf is not None: self.componentOf.export(outfile, level, namespace_, name_='componentOf', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for derivedFrom_ in self.derivedFrom: derivedFrom_.export(outfile, level, namespace_, name_='derivedFrom', pretty_print=pretty_print) for participation_ in self.participation: participation_.export(outfile, level, namespace_, name_='participation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSubstanceAdministration(self.classCode) # validate type ActClassSubstanceAdministration value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode.append(obj_) obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'approachSiteCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.approachSiteCode.append(obj_) obj_.original_tagname_ = 'approachSiteCode' elif nodeName_ == 'targetSiteCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.targetSiteCode.append(obj_) obj_.original_tagname_ = 'targetSiteCode' elif nodeName_ == 'routeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.routeCode = obj_ obj_.original_tagname_ = 'routeCode' elif nodeName_ == 'doseQuantity': obj_ = URG_PQ.factory() obj_.build(child_) self.doseQuantity = obj_ obj_.original_tagname_ = 'doseQuantity' elif nodeName_ == 'maxDoseQuantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.maxDoseQuantity.append(obj_) obj_.original_tagname_ = 'maxDoseQuantity' elif nodeName_ == 'consumable': obj_ = POCP_MT060100UV_Consumable2.factory() obj_.build(child_) self.consumable = obj_ obj_.original_tagname_ = 'consumable' elif nodeName_ == 'device': obj_ = POCP_MT060100UV_Device.factory() obj_.build(child_) self.device = obj_ obj_.original_tagname_ = 'device' elif nodeName_ == 'subject': obj_ = POCP_MT060100UV_Subject4.factory() obj_.build(child_) self.subject.append(obj_) obj_.original_tagname_ = 'subject' elif nodeName_ == 'reason': obj_ = POCP_MT060100UV_Reason.factory() obj_.build(child_) self.reason = obj_ obj_.original_tagname_ = 'reason' elif nodeName_ == 'precondition': obj_ = POCP_MT060100UV_Precondition.factory() obj_.build(child_) self.precondition.append(obj_) obj_.original_tagname_ = 'precondition' elif nodeName_ == 'goal': obj_ = POCP_MT060100UV_Goal.factory() obj_.build(child_) self.goal.append(obj_) obj_.original_tagname_ = 'goal' elif nodeName_ == 'maintenanceGoal': obj_ = POCP_MT060100UV_MaintenanceGoal.factory() obj_.build(child_) self.maintenanceGoal.append(obj_) obj_.original_tagname_ = 'maintenanceGoal' elif nodeName_ == 'component': obj_ = POCP_MT060100UV_Component3.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component' elif nodeName_ == 'componentOf': obj_ = POCP_MT060100UV_Component1.factory() obj_.build(child_) self.componentOf = obj_ obj_.original_tagname_ = 'componentOf' elif nodeName_ == 'subjectOf': obj_ = POCP_MT060100UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'derivedFrom': obj_ = POCP_MT060100UV_DerivedFrom.factory() obj_.build(child_) self.derivedFrom.append(obj_) obj_.original_tagname_ = 'derivedFrom' elif nodeName_ == 'participation': obj_ = POCP_MT060100UV_Participant.factory() obj_.build(child_) self.participation.append(obj_) obj_.original_tagname_ = 'participation'
# end class POCP_MT060100UV_SubstanceAdministration1
[docs]class POCP_MT060100UV_SubstanceAdministration2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SBADM', moodCode='DEF', realmCode=None, typeId=None, templateId=None, effectiveTime=None, repeatNumber=None, doseQuantity=None, rateQuantity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.effectiveTime = effectiveTime self.repeatNumber = repeatNumber self.doseQuantity = doseQuantity self.rateQuantity = rateQuantity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_SubstanceAdministration2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_SubstanceAdministration2.subclass: return POCP_MT060100UV_SubstanceAdministration2.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_SubstanceAdministration2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_repeatNumber(self): return self.repeatNumber
[docs] def set_repeatNumber(self, repeatNumber): self.repeatNumber = repeatNumber
[docs] def get_doseQuantity(self): return self.doseQuantity
[docs] def set_doseQuantity(self, doseQuantity): self.doseQuantity = doseQuantity
[docs] def get_rateQuantity(self): return self.rateQuantity
[docs] def set_rateQuantity(self, rateQuantity): self.rateQuantity = rateQuantity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSubstanceAdministration(self, value): # Validate type ActClassSubstanceAdministration, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBADM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSubstanceAdministration' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSubstanceAdministration_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSubstanceAdministration_patterns_, ))
validate_ActClassSubstanceAdministration_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.effectiveTime is not None or self.repeatNumber is not None or self.doseQuantity is not None or self.rateQuantity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.SubstanceAdministration2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SBADM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.SubstanceAdministration2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.repeatNumber is not None: self.repeatNumber.export(outfile, level, namespace_, name_='repeatNumber', pretty_print=pretty_print) if self.doseQuantity is not None: self.doseQuantity.export(outfile, level, namespace_, name_='doseQuantity', pretty_print=pretty_print) if self.rateQuantity is not None: self.rateQuantity.export(outfile, level, namespace_, name_='rateQuantity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSubstanceAdministration(self.classCode) # validate type ActClassSubstanceAdministration value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'repeatNumber': obj_ = IVL_INT.factory() obj_.build(child_) self.repeatNumber = obj_ obj_.original_tagname_ = 'repeatNumber' elif nodeName_ == 'doseQuantity': obj_ = URG_PQ.factory() obj_.build(child_) self.doseQuantity = obj_ obj_.original_tagname_ = 'doseQuantity' elif nodeName_ == 'rateQuantity': obj_ = URG_PQ.factory() obj_.build(child_) self.rateQuantity = obj_ obj_.original_tagname_ = 'rateQuantity'
# end class POCP_MT060100UV_SubstanceAdministration2
[docs]class POCP_MT060100UV_SubstanceAdministrationCriterion(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SBADM', moodCode='EVN.CRT', actionNegationInd='false', isCriterionInd=None, realmCode=None, typeId=None, templateId=None, id=None, routeCode=None, consumable=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.actionNegationInd = _cast(None, actionNegationInd) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.routeCode = routeCode self.consumable = consumable
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT060100UV_SubstanceAdministrationCriterion) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT060100UV_SubstanceAdministrationCriterion.subclass: return POCP_MT060100UV_SubstanceAdministrationCriterion.subclass(*args_, **kwargs_) else: return POCP_MT060100UV_SubstanceAdministrationCriterion(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_routeCode(self): return self.routeCode
[docs] def set_routeCode(self, routeCode): self.routeCode = routeCode
[docs] def get_consumable(self): return self.consumable
[docs] def set_consumable(self, consumable): self.consumable = consumable
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_actionNegationInd(self): return self.actionNegationInd
[docs] def set_actionNegationInd(self, actionNegationInd): self.actionNegationInd = actionNegationInd
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSubstanceAdministration(self, value): # Validate type ActClassSubstanceAdministration, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBADM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSubstanceAdministration' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSubstanceAdministration_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSubstanceAdministration_patterns_, ))
validate_ActClassSubstanceAdministration_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.routeCode is not None or self.consumable is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT060100UV.SubstanceAdministrationCriterion', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT060100UV.SubstanceAdministrationCriterion') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT060100UV.SubstanceAdministrationCriterion', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT060100UV.SubstanceAdministrationCriterion'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SBADM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.actionNegationInd and 'actionNegationInd' not in already_processed: already_processed.add('actionNegationInd') outfile.write(' actionNegationInd=%s' % (quote_attrib(self.actionNegationInd), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT060100UV.SubstanceAdministrationCriterion', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.routeCode is not None: self.routeCode.export(outfile, level, namespace_, name_='routeCode', pretty_print=pretty_print) if self.consumable is not None: self.consumable.export(outfile, level, namespace_, name_='consumable', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSubstanceAdministration(self.classCode) # validate type ActClassSubstanceAdministration value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('actionNegationInd', node) if value is not None and 'actionNegationInd' not in already_processed: already_processed.add('actionNegationInd') if value in ('true', '1'): self.actionNegationInd = True elif value in ('false', '0'): self.actionNegationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.actionNegationInd) # validate type bl value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'routeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.routeCode = obj_ obj_.original_tagname_ = 'routeCode' elif nodeName_ == 'consumable': obj_ = POCP_MT060100UV_Consumable1.factory() obj_.build(child_) self.consumable = obj_ obj_.original_tagname_ = 'consumable'
# end class POCP_MT060100UV_SubstanceAdministrationCriterion
[docs]class POCP_MT010600UV_ActDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, primaryPerformer=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime if primaryPerformer is None: self.primaryPerformer = [] else: self.primaryPerformer = primaryPerformer self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_ActDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_ActDefinition.subclass: return POCP_MT010600UV_ActDefinition.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_ActDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_primaryPerformer(self): return self.primaryPerformer
[docs] def set_primaryPerformer(self, primaryPerformer): self.primaryPerformer = primaryPerformer
[docs] def add_primaryPerformer(self, value): self.primaryPerformer.append(value)
[docs] def insert_primaryPerformer_at(self, index, value): self.primaryPerformer.insert(index, value)
[docs] def replace_primaryPerformer_at(self, index, value): self.primaryPerformer[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.primaryPerformer or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ActDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.ActDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.ActDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.ActDefinition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ActDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for primaryPerformer_ in self.primaryPerformer: primaryPerformer_.export(outfile, level, namespace_, name_='primaryPerformer', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'primaryPerformer': obj_ = POCP_MT010600UV_PrimaryPerformer.factory() obj_.build(child_) self.primaryPerformer.append(obj_) obj_.original_tagname_ = 'primaryPerformer' elif nodeName_ == 'author': obj_ = POCP_MT010600UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010600UV_ActDefinition
[docs]class POCP_MT010600UV_AdministerableMaterial(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ADMM', realmCode=None, typeId=None, templateId=None, administrableProduct=None, subjectOf=None, consumedIn=None, productOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.administrableProduct = administrableProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_AdministerableMaterial) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_AdministerableMaterial.subclass: return POCP_MT010600UV_AdministerableMaterial.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_AdministerableMaterial(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_administrableProduct(self): return self.administrableProduct
[docs] def set_administrableProduct(self, administrableProduct): self.administrableProduct = administrableProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassAdministerableMaterial(self, value): # Validate type RoleClassAdministerableMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADMM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAdministerableMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAdministerableMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAdministerableMaterial_patterns_, ))
validate_RoleClassAdministerableMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.administrableProduct is not None or self.subjectOf or self.consumedIn or self.productOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.AdministerableMaterial', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.AdministerableMaterial') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.AdministerableMaterial', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.AdministerableMaterial'): if self.classCode != "ADMM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.AdministerableMaterial', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.administrableProduct is not None: self.administrableProduct.export(outfile, level, namespace_, name_='administrableProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAdministerableMaterial(self.classCode) # validate type RoleClassAdministerableMaterial
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'administrableProduct': obj_ = POCP_MT010600UV_Product.factory() obj_.build(child_) self.administrableProduct = obj_ obj_.original_tagname_ = 'administrableProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010600UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010600UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf'
# end class POCP_MT010600UV_AdministerableMaterial
[docs]class POCP_MT010600UV_Author(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Author) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Author.subclass: return POCP_MT010600UV_Author.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Author(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Author', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Author') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Author', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Author'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Author', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT010600UV_Author
[docs]class POCP_MT010600UV_Consumable1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, substanceAdministration=None, substanceAdministration1=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.substanceAdministration = substanceAdministration self.substanceAdministration1 = substanceAdministration1
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Consumable1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Consumable1.subclass: return POCP_MT010600UV_Consumable1.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Consumable1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_substanceAdministration1(self): return self.substanceAdministration1
[docs] def set_substanceAdministration1(self, substanceAdministration1): self.substanceAdministration1 = substanceAdministration1
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.substanceAdministration is not None or self.substanceAdministration1 is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Consumable1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Consumable1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Consumable1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Consumable1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Consumable1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print) if self.substanceAdministration1 is not None: self.substanceAdministration1.export(outfile, level, namespace_, name_='substanceAdministration1', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT010600UV_SubstanceAdministration.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration' elif nodeName_ == 'substanceAdministration1': obj_ = POCP_MT060100UV_SubstanceAdministration1.factory() obj_.build(child_) self.substanceAdministration1 = obj_ obj_.original_tagname_ = 'substanceAdministration1'
# end class POCP_MT010600UV_Consumable1
[docs]class POCP_MT010600UV_Consumable2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, quantity=None, manufacturedProduct1=None, content1=None, content2=None, administerableMaterial=None, manufacturedProduct2=None, part=None, manufacturedProduct3=None, ingredient=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.manufacturedProduct1 = manufacturedProduct1 self.content1 = content1 self.content2 = content2 self.administerableMaterial = administerableMaterial self.manufacturedProduct2 = manufacturedProduct2 self.part = part self.manufacturedProduct3 = manufacturedProduct3 self.ingredient = ingredient
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Consumable2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Consumable2.subclass: return POCP_MT010600UV_Consumable2.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Consumable2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_manufacturedProduct1(self): return self.manufacturedProduct1
[docs] def set_manufacturedProduct1(self, manufacturedProduct1): self.manufacturedProduct1 = manufacturedProduct1
[docs] def get_content1(self): return self.content1
[docs] def set_content1(self, content1): self.content1 = content1
[docs] def get_content2(self): return self.content2
[docs] def set_content2(self, content2): self.content2 = content2
[docs] def get_administerableMaterial(self): return self.administerableMaterial
[docs] def set_administerableMaterial(self, administerableMaterial): self.administerableMaterial = administerableMaterial
[docs] def get_manufacturedProduct2(self): return self.manufacturedProduct2
[docs] def set_manufacturedProduct2(self, manufacturedProduct2): self.manufacturedProduct2 = manufacturedProduct2
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def get_manufacturedProduct3(self): return self.manufacturedProduct3
[docs] def set_manufacturedProduct3(self, manufacturedProduct3): self.manufacturedProduct3 = manufacturedProduct3
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.manufacturedProduct1 is not None or self.content1 is not None or self.content2 is not None or self.administerableMaterial is not None or self.manufacturedProduct2 is not None or self.part is not None or self.manufacturedProduct3 is not None or self.ingredient is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Consumable2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Consumable2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Consumable2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Consumable2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Consumable2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.manufacturedProduct1 is not None: self.manufacturedProduct1.export(outfile, level, namespace_, name_='manufacturedProduct1', pretty_print=pretty_print) if self.content1 is not None: self.content1.export(outfile, level, namespace_, name_='content1', pretty_print=pretty_print) if self.content2 is not None: self.content2.export(outfile, level, namespace_, name_='content2', pretty_print=pretty_print) if self.administerableMaterial is not None: self.administerableMaterial.export(outfile, level, namespace_, name_='administerableMaterial', pretty_print=pretty_print) if self.manufacturedProduct2 is not None: self.manufacturedProduct2.export(outfile, level, namespace_, name_='manufacturedProduct2', pretty_print=pretty_print) if self.part is not None: self.part.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) if self.manufacturedProduct3 is not None: self.manufacturedProduct3.export(outfile, level, namespace_, name_='manufacturedProduct3', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'manufacturedProduct1': obj_ = POCP_MT010600UV_ManufacturedProduct2.factory() obj_.build(child_) self.manufacturedProduct1 = obj_ obj_.original_tagname_ = 'manufacturedProduct1' elif nodeName_ == 'content1': obj_ = POCP_MT010600UV_Content1.factory() obj_.build(child_) self.content1 = obj_ obj_.original_tagname_ = 'content1' elif nodeName_ == 'content2': obj_ = POCP_MT010600UV_Content.factory() obj_.build(child_) self.content2 = obj_ obj_.original_tagname_ = 'content2' elif nodeName_ == 'administerableMaterial': obj_ = POCP_MT010600UV_AdministerableMaterial.factory() obj_.build(child_) self.administerableMaterial = obj_ obj_.original_tagname_ = 'administerableMaterial' elif nodeName_ == 'manufacturedProduct2': obj_ = POCP_MT010600UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct2 = obj_ obj_.original_tagname_ = 'manufacturedProduct2' elif nodeName_ == 'part': obj_ = POCP_MT010600UV_Part.factory() obj_.build(child_) self.part = obj_ obj_.original_tagname_ = 'part' elif nodeName_ == 'manufacturedProduct3': obj_ = POCP_MT010600UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct3 = obj_ obj_.original_tagname_ = 'manufacturedProduct3' elif nodeName_ == 'ingredient': obj_ = POCP_MT010600UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient'
# end class POCP_MT010600UV_Consumable2
[docs]class POCP_MT010600UV_Content(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, containerPackagedProduct=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.containerPackagedProduct = containerPackagedProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Content) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Content.subclass: return POCP_MT010600UV_Content.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Content(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_containerPackagedProduct(self): return self.containerPackagedProduct
[docs] def set_containerPackagedProduct(self, containerPackagedProduct): self.containerPackagedProduct = containerPackagedProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.containerPackagedProduct is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Content', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Content') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Content', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Content'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Content', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.containerPackagedProduct is not None: self.containerPackagedProduct.export(outfile, level, namespace_, name_='containerPackagedProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'containerPackagedProduct': obj_ = POCP_MT010600UV_PackagedProduct.factory() obj_.build(child_) self.containerPackagedProduct = obj_ obj_.original_tagname_ = 'containerPackagedProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010600UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010600UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010600UV_Content
[docs]class POCP_MT010600UV_Content1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, containerPackagedProduct=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.containerPackagedProduct = containerPackagedProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Content1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Content1.subclass: return POCP_MT010600UV_Content1.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Content1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_containerPackagedProduct(self): return self.containerPackagedProduct
[docs] def set_containerPackagedProduct(self, containerPackagedProduct): self.containerPackagedProduct = containerPackagedProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.containerPackagedProduct is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Content1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Content1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Content1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Content1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Content1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.containerPackagedProduct is not None: self.containerPackagedProduct.export(outfile, level, namespace_, name_='containerPackagedProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'containerPackagedProduct': obj_ = POCP_MT010600UV_PackagedProduct.factory() obj_.build(child_) self.containerPackagedProduct = obj_ obj_.original_tagname_ = 'containerPackagedProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010600UV_Product2.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010600UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010600UV_Content1
[docs]class POCP_MT010600UV_Device(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DEV', realmCode=None, typeId=None, templateId=None, observation=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observation = observation self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Device) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Device.subclass: return POCP_MT010600UV_Device.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Device(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observation is not None or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Device', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Device') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Device', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Device'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DEV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Device', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observation': obj_ = POCP_MT070100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation' elif nodeName_ == 'actDefinition': obj_ = POCP_MT070200UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT010600UV_Device
[docs]class POCP_MT010600UV_EntityWithGeneric(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='GRIC', realmCode=None, typeId=None, templateId=None, genericMedicine=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.genericMedicine = genericMedicine
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_EntityWithGeneric) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_EntityWithGeneric.subclass: return POCP_MT010600UV_EntityWithGeneric.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_EntityWithGeneric(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_genericMedicine(self): return self.genericMedicine
[docs] def set_genericMedicine(self, genericMedicine): self.genericMedicine = genericMedicine
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassHasGeneric(self, value): # Validate type RoleClassHasGeneric, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassHasGeneric' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassHasGeneric_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassHasGeneric_patterns_, ))
validate_RoleClassHasGeneric_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.genericMedicine is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.EntityWithGeneric', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.EntityWithGeneric') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.EntityWithGeneric', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.EntityWithGeneric'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "GRIC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.EntityWithGeneric', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.genericMedicine is not None: self.genericMedicine.export(outfile, level, namespace_, name_='genericMedicine', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassHasGeneric(self.classCode) # validate type RoleClassHasGeneric
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'genericMedicine': obj_ = POCP_MT010600UV_GenericMedicine.factory() obj_.build(child_) self.genericMedicine = obj_ obj_.original_tagname_ = 'genericMedicine'
# end class POCP_MT010600UV_EntityWithGeneric
[docs]class POCP_MT010600UV_EquivalentEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='EQUIV', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, definingMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity self.definingMaterialKind = definingMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_EquivalentEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_EquivalentEntity.subclass: return POCP_MT010600UV_EquivalentEntity.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_EquivalentEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_definingMaterialKind(self): return self.definingMaterialKind
[docs] def set_definingMaterialKind(self, definingMaterialKind): self.definingMaterialKind = definingMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassEquivalentEntity(self, value): # Validate type RoleClassEquivalentEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EQUIV', 'SAME', 'SUBY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassEquivalentEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassEquivalentEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassEquivalentEntity_patterns_, ))
validate_RoleClassEquivalentEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.definingMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.EquivalentEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.EquivalentEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.EquivalentEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.EquivalentEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "EQUIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.EquivalentEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.definingMaterialKind is not None: self.definingMaterialKind.export(outfile, level, namespace_, name_='definingMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassEquivalentEntity(self.classCode) # validate type RoleClassEquivalentEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'definingMaterialKind': obj_ = POCP_MT010600UV_MaterialKind.factory() obj_.build(child_) self.definingMaterialKind = obj_ obj_.original_tagname_ = 'definingMaterialKind'
# end class POCP_MT010600UV_EquivalentEntity
[docs]class POCP_MT010600UV_GenericMedicine(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_GenericMedicine) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_GenericMedicine.subclass: return POCP_MT010600UV_GenericMedicine.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_GenericMedicine(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.GenericMedicine', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.GenericMedicine') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.GenericMedicine', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.GenericMedicine'): if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.GenericMedicine', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010600UV_GenericMedicine
[docs]class POCP_MT010600UV_IdentifiedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, id=None, code=None, effectiveTime=None, assigningOrganization=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.effectiveTime = effectiveTime self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_IdentifiedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_IdentifiedEntity.subclass: return POCP_MT010600UV_IdentifiedEntity.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_IdentifiedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.effectiveTime is not None or self.assigningOrganization is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.IdentifiedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.IdentifiedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.IdentifiedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.IdentifiedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.IdentifiedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT010600UV_IdentifiedEntity
[docs]class POCP_MT010600UV_IndirectTarget(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='IND', realmCode=None, typeId=None, templateId=None, valuedItem=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.valuedItem = valuedItem
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_IndirectTarget) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_IndirectTarget.subclass: return POCP_MT010600UV_IndirectTarget.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_IndirectTarget(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_valuedItem(self): return self.valuedItem
[docs] def set_valuedItem(self, valuedItem): self.valuedItem = valuedItem
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationIndirectTarget(self, value): # Validate type ParticipationIndirectTarget, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IND', 'BEN', 'CAGNT', 'COV', 'GUAR', 'HLD', 'RCT', 'RCV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationIndirectTarget' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationIndirectTarget_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationIndirectTarget_patterns_, ))
validate_ParticipationIndirectTarget_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.valuedItem is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.IndirectTarget', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.IndirectTarget') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.IndirectTarget', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.IndirectTarget'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "IND" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.IndirectTarget', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.valuedItem is not None: self.valuedItem.export(outfile, level, namespace_, name_='valuedItem', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationIndirectTarget(self.typeCode) # validate type ParticipationIndirectTarget
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'valuedItem': obj_ = COCT_MT440001UV09_ValuedItem.factory() obj_.build(child_) self.valuedItem = obj_ obj_.original_tagname_ = 'valuedItem'
# end class POCP_MT010600UV_IndirectTarget
[docs]class POCP_MT010600UV_Ingredient(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='INGR', realmCode=None, typeId=None, templateId=None, id=None, effectiveTime=None, confidentialityCode=None, quantity=None, ingredientSubstance=None, subjectOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.quantity = quantity self.ingredientSubstance = ingredientSubstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Ingredient) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Ingredient.subclass: return POCP_MT010600UV_Ingredient.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Ingredient(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_ingredientSubstance(self): return self.ingredientSubstance
[docs] def set_ingredientSubstance(self, ingredientSubstance): self.ingredientSubstance = ingredientSubstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIngredientEntity(self, value): # Validate type RoleClassIngredientEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIngredientEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIngredientEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIngredientEntity_patterns_, ))
validate_RoleClassIngredientEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.quantity is not None or self.ingredientSubstance is not None or self.subjectOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Ingredient', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Ingredient') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Ingredient', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Ingredient'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "INGR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Ingredient', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.ingredientSubstance is not None: self.ingredientSubstance.export(outfile, level, namespace_, name_='ingredientSubstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIngredientEntity(self.classCode) # validate type RoleClassIngredientEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'ingredientSubstance': obj_ = POCP_MT081100UV_Substance.factory() obj_.build(child_) self.ingredientSubstance = obj_ obj_.original_tagname_ = 'ingredientSubstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010600UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010600UV_Ingredient
[docs]class POCP_MT010600UV_ManufacturedProduct(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturedProduct=None, manufacturerOrganization=None, subjectOf=None, deviceOf=None, consumedIn=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturedProduct = manufacturedProduct self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if deviceOf is None: self.deviceOf = [] else: self.deviceOf = deviceOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_ManufacturedProduct) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_ManufacturedProduct.subclass: return POCP_MT010600UV_ManufacturedProduct.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_ManufacturedProduct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_deviceOf(self): return self.deviceOf
[docs] def set_deviceOf(self, deviceOf): self.deviceOf = deviceOf
[docs] def add_deviceOf(self, value): self.deviceOf.append(value)
[docs] def insert_deviceOf_at(self, index, value): self.deviceOf.insert(index, value)
[docs] def replace_deviceOf_at(self, index, value): self.deviceOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturedProduct is not None or self.manufacturerOrganization is not None or self.subjectOf or self.deviceOf or self.consumedIn or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.ManufacturedProduct') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct'): if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for deviceOf_ in self.deviceOf: deviceOf_.export(outfile, level, namespace_, name_='deviceOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010600UV_Product.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'deviceOf': obj_ = POCP_MT010600UV_Device.factory() obj_.build(child_) self.deviceOf.append(obj_) obj_.original_tagname_ = 'deviceOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010600UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010600UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010600UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010600UV_ManufacturedProduct
[docs]class POCP_MT010600UV_ManufacturedProduct2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturerOrganization=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_ManufacturedProduct2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_ManufacturedProduct2.subclass: return POCP_MT010600UV_ManufacturedProduct2.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_ManufacturedProduct2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturerOrganization is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.ManufacturedProduct2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010600UV_Product2.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010600UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010600UV_ManufacturedProduct2
[docs]class POCP_MT010600UV_ManufacturedProduct3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturerOrganization=None, subjectOf=None, consumedIn=None, productOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_ManufacturedProduct3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_ManufacturedProduct3.subclass: return POCP_MT010600UV_ManufacturedProduct3.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_ManufacturedProduct3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturerOrganization is not None or self.subjectOf or self.consumedIn or self.productOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.ManufacturedProduct3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.ManufacturedProduct3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010600UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010600UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf'
# end class POCP_MT010600UV_ManufacturedProduct3
[docs]class POCP_MT010600UV_MaterialKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_MaterialKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_MaterialKind.subclass: return POCP_MT010600UV_MaterialKind.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_MaterialKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassMaterial(self, value): # Validate type EntityClassMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MAT', 'CHEM', 'FOOD', 'MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassMaterial_patterns_, ))
validate_EntityClassMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.MaterialKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.MaterialKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.MaterialKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.MaterialKind'): if self.classCode != "MAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.MaterialKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassMaterial(self.classCode) # validate type EntityClassMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010600UV_MaterialKind
[docs]class POCP_MT010600UV_PackagedProduct(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='CONT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, formCode=None, capacityQuantity=None, capTypeCode=None, asIdentifiedEntity=None, asManufacturedProduct=None, asContent=None, asSpecializedKind=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc self.formCode = formCode self.capacityQuantity = capacityQuantity self.capTypeCode = capTypeCode if asIdentifiedEntity is None: self.asIdentifiedEntity = [] else: self.asIdentifiedEntity = asIdentifiedEntity if asManufacturedProduct is None: self.asManufacturedProduct = [] else: self.asManufacturedProduct = asManufacturedProduct if asContent is None: self.asContent = [] else: self.asContent = asContent if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_PackagedProduct) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_PackagedProduct.subclass: return POCP_MT010600UV_PackagedProduct.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_PackagedProduct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_capacityQuantity(self): return self.capacityQuantity
[docs] def set_capacityQuantity(self, capacityQuantity): self.capacityQuantity = capacityQuantity
[docs] def get_capTypeCode(self): return self.capTypeCode
[docs] def set_capTypeCode(self, capTypeCode): self.capTypeCode = capTypeCode
[docs] def get_asIdentifiedEntity(self): return self.asIdentifiedEntity
[docs] def set_asIdentifiedEntity(self, asIdentifiedEntity): self.asIdentifiedEntity = asIdentifiedEntity
[docs] def add_asIdentifiedEntity(self, value): self.asIdentifiedEntity.append(value)
[docs] def insert_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity.insert(index, value)
[docs] def replace_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity[index] = value
[docs] def get_asManufacturedProduct(self): return self.asManufacturedProduct
[docs] def set_asManufacturedProduct(self, asManufacturedProduct): self.asManufacturedProduct = asManufacturedProduct
[docs] def add_asManufacturedProduct(self, value): self.asManufacturedProduct.append(value)
[docs] def insert_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct.insert(index, value)
[docs] def replace_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def add_asContent(self, value): self.asContent.append(value)
[docs] def insert_asContent_at(self, index, value): self.asContent.insert(index, value)
[docs] def replace_asContent_at(self, index, value): self.asContent[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassContainer(self, value): # Validate type EntityClassContainer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT', 'HOLD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassContainer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassContainer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassContainer_patterns_, ))
validate_EntityClassContainer_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.formCode is not None or self.capacityQuantity is not None or self.capTypeCode is not None or self.asIdentifiedEntity or self.asManufacturedProduct or self.asContent or self.asSpecializedKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PackagedProduct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.PackagedProduct') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.PackagedProduct', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.PackagedProduct'): if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PackagedProduct', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.capacityQuantity is not None: self.capacityQuantity.export(outfile, level, namespace_, name_='capacityQuantity', pretty_print=pretty_print) if self.capTypeCode is not None: self.capTypeCode.export(outfile, level, namespace_, name_='capTypeCode', pretty_print=pretty_print) for asIdentifiedEntity_ in self.asIdentifiedEntity: asIdentifiedEntity_.export(outfile, level, namespace_, name_='asIdentifiedEntity', pretty_print=pretty_print) for asManufacturedProduct_ in self.asManufacturedProduct: asManufacturedProduct_.export(outfile, level, namespace_, name_='asManufacturedProduct', pretty_print=pretty_print) for asContent_ in self.asContent: asContent_.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassContainer(self.classCode) # validate type EntityClassContainer value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'capacityQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.capacityQuantity = obj_ obj_.original_tagname_ = 'capacityQuantity' elif nodeName_ == 'capTypeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.capTypeCode = obj_ obj_.original_tagname_ = 'capTypeCode' elif nodeName_ == 'asIdentifiedEntity': obj_ = POCP_MT010600UV_IdentifiedEntity.factory() obj_.build(child_) self.asIdentifiedEntity.append(obj_) obj_.original_tagname_ = 'asIdentifiedEntity' elif nodeName_ == 'asManufacturedProduct': obj_ = POCP_MT010600UV_ManufacturedProduct2.factory() obj_.build(child_) self.asManufacturedProduct.append(obj_) obj_.original_tagname_ = 'asManufacturedProduct' elif nodeName_ == 'asContent': obj_ = POCP_MT010600UV_Content1.factory() obj_.build(child_) self.asContent.append(obj_) obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010600UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind'
# end class POCP_MT010600UV_PackagedProduct
[docs]class POCP_MT010600UV_Part(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, id=None, code=None, quantity=None, partProduct=None, subjectOf=None, deviceOf=None, consumedIn=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.quantity = quantity self.partProduct = partProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if deviceOf is None: self.deviceOf = [] else: self.deviceOf = deviceOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Part) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Part.subclass: return POCP_MT010600UV_Part.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Part(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_partProduct(self): return self.partProduct
[docs] def set_partProduct(self, partProduct): self.partProduct = partProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_deviceOf(self): return self.deviceOf
[docs] def set_deviceOf(self, deviceOf): self.deviceOf = deviceOf
[docs] def add_deviceOf(self, value): self.deviceOf.append(value)
[docs] def insert_deviceOf_at(self, index, value): self.deviceOf.insert(index, value)
[docs] def replace_deviceOf_at(self, index, value): self.deviceOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.quantity is not None or self.partProduct is not None or self.subjectOf or self.deviceOf or self.consumedIn or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Part', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Part') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Part', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Part'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Part', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.partProduct is not None: self.partProduct.export(outfile, level, namespace_, name_='partProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for deviceOf_ in self.deviceOf: deviceOf_.export(outfile, level, namespace_, name_='deviceOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'partProduct': obj_ = POCP_MT010600UV_Product.factory() obj_.build(child_) self.partProduct = obj_ obj_.original_tagname_ = 'partProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'deviceOf': obj_ = POCP_MT010600UV_Device.factory() obj_.build(child_) self.deviceOf.append(obj_) obj_.original_tagname_ = 'deviceOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010600UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010600UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010600UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010600UV_Part
[docs]class POCP_MT010600UV_PartOfAssembly(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, code=None, wholeProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.wholeProduct = wholeProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_PartOfAssembly) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_PartOfAssembly.subclass: return POCP_MT010600UV_PartOfAssembly.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_PartOfAssembly(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_wholeProduct(self): return self.wholeProduct
[docs] def set_wholeProduct(self, wholeProduct): self.wholeProduct = wholeProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.wholeProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PartOfAssembly', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.PartOfAssembly') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.PartOfAssembly', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.PartOfAssembly'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PartOfAssembly', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.wholeProduct is not None: self.wholeProduct.export(outfile, level, namespace_, name_='wholeProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'wholeProduct': obj_ = POCP_MT010600UV_Product.factory() obj_.build(child_) self.wholeProduct = obj_ obj_.original_tagname_ = 'wholeProduct'
# end class POCP_MT010600UV_PartOfAssembly
[docs]class POCP_MT010600UV_PotentialSupply(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SPLY', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, title=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.title = title self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_PotentialSupply) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_PotentialSupply.subclass: return POCP_MT010600UV_PotentialSupply.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_PotentialSupply(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSupply(self, value): # Validate type ActClassSupply, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SPLY', 'DIET'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSupply' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSupply_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSupply_patterns_, ))
validate_ActClassSupply_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.title is not None or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PotentialSupply', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.PotentialSupply') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.PotentialSupply', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.PotentialSupply'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SPLY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PotentialSupply', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSupply(self.classCode) # validate type ActClassSupply value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'title': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'author': obj_ = POCP_MT010600UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010600UV_PotentialSupply
[docs]class POCP_MT010600UV_PrimaryPerformer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PPRF', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_PrimaryPerformer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_PrimaryPerformer.subclass: return POCP_MT010600UV_PrimaryPerformer.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_PrimaryPerformer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPrimaryPerformer(self, value): # Validate type ParticipationPrimaryPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPrimaryPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPrimaryPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPrimaryPerformer_patterns_, ))
validate_ParticipationPrimaryPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PrimaryPerformer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.PrimaryPerformer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.PrimaryPerformer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.PrimaryPerformer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PPRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.PrimaryPerformer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPrimaryPerformer(self.typeCode) # validate type ParticipationPrimaryPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT010600UV_PrimaryPerformer
[docs]class POCP_MT010600UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, riskCode=None, handlingCode=None, formCode=None, expirationTime=None, asIdentifiedEntity=None, asNamedEntity=None, asManufacturedProduct=None, asSpecializedKind=None, asEntityWithGeneric=None, asEquivalentEntity=None, ingredient=None, asContent=None, asPartOfAssembly=None, part=None, instanceOfKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc if riskCode is None: self.riskCode = [] else: self.riskCode = riskCode if handlingCode is None: self.handlingCode = [] else: self.handlingCode = handlingCode self.formCode = formCode self.expirationTime = expirationTime if asIdentifiedEntity is None: self.asIdentifiedEntity = [] else: self.asIdentifiedEntity = asIdentifiedEntity if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if asManufacturedProduct is None: self.asManufacturedProduct = [] else: self.asManufacturedProduct = asManufacturedProduct if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind self.asEntityWithGeneric = asEntityWithGeneric if asEquivalentEntity is None: self.asEquivalentEntity = [] else: self.asEquivalentEntity = asEquivalentEntity if ingredient is None: self.ingredient = [] else: self.ingredient = ingredient if asContent is None: self.asContent = [] else: self.asContent = asContent if asPartOfAssembly is None: self.asPartOfAssembly = [] else: self.asPartOfAssembly = asPartOfAssembly if part is None: self.part = [] else: self.part = part if instanceOfKind is None: self.instanceOfKind = [] else: self.instanceOfKind = instanceOfKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Product.subclass: return POCP_MT010600UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_riskCode(self): return self.riskCode
[docs] def set_riskCode(self, riskCode): self.riskCode = riskCode
[docs] def add_riskCode(self, value): self.riskCode.append(value)
[docs] def insert_riskCode_at(self, index, value): self.riskCode.insert(index, value)
[docs] def replace_riskCode_at(self, index, value): self.riskCode[index] = value
[docs] def get_handlingCode(self): return self.handlingCode
[docs] def set_handlingCode(self, handlingCode): self.handlingCode = handlingCode
[docs] def add_handlingCode(self, value): self.handlingCode.append(value)
[docs] def insert_handlingCode_at(self, index, value): self.handlingCode.insert(index, value)
[docs] def replace_handlingCode_at(self, index, value): self.handlingCode[index] = value
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_expirationTime(self): return self.expirationTime
[docs] def set_expirationTime(self, expirationTime): self.expirationTime = expirationTime
[docs] def get_asIdentifiedEntity(self): return self.asIdentifiedEntity
[docs] def set_asIdentifiedEntity(self, asIdentifiedEntity): self.asIdentifiedEntity = asIdentifiedEntity
[docs] def add_asIdentifiedEntity(self, value): self.asIdentifiedEntity.append(value)
[docs] def insert_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity.insert(index, value)
[docs] def replace_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity[index] = value
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_asManufacturedProduct(self): return self.asManufacturedProduct
[docs] def set_asManufacturedProduct(self, asManufacturedProduct): self.asManufacturedProduct = asManufacturedProduct
[docs] def add_asManufacturedProduct(self, value): self.asManufacturedProduct.append(value)
[docs] def insert_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct.insert(index, value)
[docs] def replace_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_asEntityWithGeneric(self): return self.asEntityWithGeneric
[docs] def set_asEntityWithGeneric(self, asEntityWithGeneric): self.asEntityWithGeneric = asEntityWithGeneric
[docs] def get_asEquivalentEntity(self): return self.asEquivalentEntity
[docs] def set_asEquivalentEntity(self, asEquivalentEntity): self.asEquivalentEntity = asEquivalentEntity
[docs] def add_asEquivalentEntity(self, value): self.asEquivalentEntity.append(value)
[docs] def insert_asEquivalentEntity_at(self, index, value): self.asEquivalentEntity.insert(index, value)
[docs] def replace_asEquivalentEntity_at(self, index, value): self.asEquivalentEntity[index] = value
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def add_ingredient(self, value): self.ingredient.append(value)
[docs] def insert_ingredient_at(self, index, value): self.ingredient.insert(index, value)
[docs] def replace_ingredient_at(self, index, value): self.ingredient[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def add_asContent(self, value): self.asContent.append(value)
[docs] def insert_asContent_at(self, index, value): self.asContent.insert(index, value)
[docs] def replace_asContent_at(self, index, value): self.asContent[index] = value
[docs] def get_asPartOfAssembly(self): return self.asPartOfAssembly
[docs] def set_asPartOfAssembly(self, asPartOfAssembly): self.asPartOfAssembly = asPartOfAssembly
[docs] def add_asPartOfAssembly(self, value): self.asPartOfAssembly.append(value)
[docs] def insert_asPartOfAssembly_at(self, index, value): self.asPartOfAssembly.insert(index, value)
[docs] def replace_asPartOfAssembly_at(self, index, value): self.asPartOfAssembly[index] = value
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_instanceOfKind(self): return self.instanceOfKind
[docs] def set_instanceOfKind(self, instanceOfKind): self.instanceOfKind = instanceOfKind
[docs] def add_instanceOfKind(self, value): self.instanceOfKind.append(value)
[docs] def insert_instanceOfKind_at(self, index, value): self.instanceOfKind.insert(index, value)
[docs] def replace_instanceOfKind_at(self, index, value): self.instanceOfKind[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.riskCode or self.handlingCode or self.formCode is not None or self.expirationTime is not None or self.asIdentifiedEntity or self.asNamedEntity or self.asManufacturedProduct or self.asSpecializedKind or self.asEntityWithGeneric is not None or self.asEquivalentEntity or self.ingredient or self.asContent or self.asPartOfAssembly or self.part or self.instanceOfKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) for riskCode_ in self.riskCode: riskCode_.export(outfile, level, namespace_, name_='riskCode', pretty_print=pretty_print) for handlingCode_ in self.handlingCode: handlingCode_.export(outfile, level, namespace_, name_='handlingCode', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.expirationTime is not None: self.expirationTime.export(outfile, level, namespace_, name_='expirationTime', pretty_print=pretty_print) for asIdentifiedEntity_ in self.asIdentifiedEntity: asIdentifiedEntity_.export(outfile, level, namespace_, name_='asIdentifiedEntity', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for asManufacturedProduct_ in self.asManufacturedProduct: asManufacturedProduct_.export(outfile, level, namespace_, name_='asManufacturedProduct', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) if self.asEntityWithGeneric is not None: self.asEntityWithGeneric.export(outfile, level, namespace_, name_='asEntityWithGeneric', pretty_print=pretty_print) for asEquivalentEntity_ in self.asEquivalentEntity: asEquivalentEntity_.export(outfile, level, namespace_, name_='asEquivalentEntity', pretty_print=pretty_print) for ingredient_ in self.ingredient: ingredient_.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) for asContent_ in self.asContent: asContent_.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) for asPartOfAssembly_ in self.asPartOfAssembly: asPartOfAssembly_.export(outfile, level, namespace_, name_='asPartOfAssembly', pretty_print=pretty_print) for part_ in self.part: part_.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) for instanceOfKind_ in self.instanceOfKind: instanceOfKind_.export(outfile, level, namespace_, name_='instanceOfKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'riskCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.riskCode.append(obj_) obj_.original_tagname_ = 'riskCode' elif nodeName_ == 'handlingCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.handlingCode.append(obj_) obj_.original_tagname_ = 'handlingCode' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'expirationTime': obj_ = IVL_TS.factory() obj_.build(child_) self.expirationTime = obj_ obj_.original_tagname_ = 'expirationTime' elif nodeName_ == 'asIdentifiedEntity': obj_ = POCP_MT010600UV_IdentifiedEntity.factory() obj_.build(child_) self.asIdentifiedEntity.append(obj_) obj_.original_tagname_ = 'asIdentifiedEntity' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT000100UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'asManufacturedProduct': obj_ = POCP_MT010600UV_ManufacturedProduct3.factory() obj_.build(child_) self.asManufacturedProduct.append(obj_) obj_.original_tagname_ = 'asManufacturedProduct' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010600UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'asEntityWithGeneric': obj_ = POCP_MT010600UV_EntityWithGeneric.factory() obj_.build(child_) self.asEntityWithGeneric = obj_ obj_.original_tagname_ = 'asEntityWithGeneric' elif nodeName_ == 'asEquivalentEntity': obj_ = POCP_MT010600UV_EquivalentEntity.factory() obj_.build(child_) self.asEquivalentEntity.append(obj_) obj_.original_tagname_ = 'asEquivalentEntity' elif nodeName_ == 'ingredient': obj_ = POCP_MT010600UV_Ingredient.factory() obj_.build(child_) self.ingredient.append(obj_) obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'asContent': obj_ = POCP_MT010600UV_Content.factory() obj_.build(child_) self.asContent.append(obj_) obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asPartOfAssembly': obj_ = POCP_MT010600UV_PartOfAssembly.factory() obj_.build(child_) self.asPartOfAssembly.append(obj_) obj_.original_tagname_ = 'asPartOfAssembly' elif nodeName_ == 'part': obj_ = POCP_MT010600UV_Part.factory() obj_.build(child_) self.part.append(obj_) obj_.original_tagname_ = 'part' elif nodeName_ == 'instanceOfKind': obj_ = POCP_MT020100UV_InstanceOfKind1.factory() obj_.build(child_) self.instanceOfKind.append(obj_) obj_.original_tagname_ = 'instanceOfKind'
# end class POCP_MT010600UV_Product
[docs]class POCP_MT010600UV_Product2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, potentialSupply=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.potentialSupply = potentialSupply
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Product2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Product2.subclass: return POCP_MT010600UV_Product2.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Product2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_potentialSupply(self): return self.potentialSupply
[docs] def set_potentialSupply(self, potentialSupply): self.potentialSupply = potentialSupply
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.potentialSupply is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Product2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Product2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Product2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Product2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Product2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.potentialSupply is not None: self.potentialSupply.export(outfile, level, namespace_, name_='potentialSupply', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'potentialSupply': obj_ = POCP_MT010600UV_PotentialSupply.factory() obj_.build(child_) self.potentialSupply = obj_ obj_.original_tagname_ = 'potentialSupply'
# end class POCP_MT010600UV_Product2
[docs]class POCP_MT010600UV_Product3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, potentialSupply=None, reconstitution=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.potentialSupply = potentialSupply self.reconstitution = reconstitution self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Product3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Product3.subclass: return POCP_MT010600UV_Product3.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Product3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_potentialSupply(self): return self.potentialSupply
[docs] def set_potentialSupply(self, potentialSupply): self.potentialSupply = potentialSupply
[docs] def get_reconstitution(self): return self.reconstitution
[docs] def set_reconstitution(self, reconstitution): self.reconstitution = reconstitution
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.potentialSupply is not None or self.reconstitution is not None or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Product3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Product3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Product3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Product3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Product3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.potentialSupply is not None: self.potentialSupply.export(outfile, level, namespace_, name_='potentialSupply', pretty_print=pretty_print) if self.reconstitution is not None: self.reconstitution.export(outfile, level, namespace_, name_='reconstitution', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'potentialSupply': obj_ = POCP_MT010600UV_PotentialSupply.factory() obj_.build(child_) self.potentialSupply = obj_ obj_.original_tagname_ = 'potentialSupply' elif nodeName_ == 'reconstitution': obj_ = POCP_MT010600UV_Reconstitution.factory() obj_.build(child_) self.reconstitution = obj_ obj_.original_tagname_ = 'reconstitution' elif nodeName_ == 'actDefinition': obj_ = POCP_MT010600UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT010600UV_Product3
[docs]class POCP_MT010600UV_Reconstitution(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, consumable=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if consumable is None: self.consumable = [] else: self.consumable = consumable self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Reconstitution) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Reconstitution.subclass: return POCP_MT010600UV_Reconstitution.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Reconstitution(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_consumable(self): return self.consumable
[docs] def set_consumable(self, consumable): self.consumable = consumable
[docs] def add_consumable(self, value): self.consumable.append(value)
[docs] def insert_consumable_at(self, index, value): self.consumable.insert(index, value)
[docs] def replace_consumable_at(self, index, value): self.consumable[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.consumable or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Reconstitution', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Reconstitution') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Reconstitution', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Reconstitution'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Reconstitution', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for consumable_ in self.consumable: consumable_.export(outfile, level, namespace_, name_='consumable', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'consumable': obj_ = POCP_MT010600UV_Consumable2.factory() obj_.build(child_) self.consumable.append(obj_) obj_.original_tagname_ = 'consumable' elif nodeName_ == 'author': obj_ = POCP_MT010600UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010600UV_Reconstitution
[docs]class POCP_MT010600UV_SpecializedKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='GEN', realmCode=None, typeId=None, templateId=None, code=None, generalizedMaterialKind=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.generalizedMaterialKind = generalizedMaterialKind if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_SpecializedKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_SpecializedKind.subclass: return POCP_MT010600UV_SpecializedKind.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_SpecializedKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_generalizedMaterialKind(self): return self.generalizedMaterialKind
[docs] def set_generalizedMaterialKind(self, generalizedMaterialKind): self.generalizedMaterialKind = generalizedMaterialKind
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIsSpeciesEntity(self, value): # Validate type RoleClassIsSpeciesEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN', 'GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIsSpeciesEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIsSpeciesEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIsSpeciesEntity_patterns_, ))
validate_RoleClassIsSpeciesEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.generalizedMaterialKind is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.SpecializedKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.SpecializedKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.SpecializedKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.SpecializedKind'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "GEN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.SpecializedKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.generalizedMaterialKind is not None: self.generalizedMaterialKind.export(outfile, level, namespace_, name_='generalizedMaterialKind', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIsSpeciesEntity(self.classCode) # validate type RoleClassIsSpeciesEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'generalizedMaterialKind': obj_ = POCP_MT010600UV_MaterialKind.factory() obj_.build(child_) self.generalizedMaterialKind = obj_ obj_.original_tagname_ = 'generalizedMaterialKind' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010600UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT010600UV_SpecializedKind
[docs]class POCP_MT010600UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', negationInd='false', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None, approval=None, policy=None, marketingAct=None, monitoringProgram=None, storage=None, observationGoal=None, substanceSpecification=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.negationInd = _cast(None, negationInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action self.approval = approval self.policy = policy self.marketingAct = marketingAct self.monitoringProgram = monitoringProgram self.storage = storage self.observationGoal = observationGoal self.substanceSpecification = substanceSpecification
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_Subject.subclass: return POCP_MT010600UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_marketingAct(self): return self.marketingAct
[docs] def set_marketingAct(self, marketingAct): self.marketingAct = marketingAct
[docs] def get_monitoringProgram(self): return self.monitoringProgram
[docs] def set_monitoringProgram(self, monitoringProgram): self.monitoringProgram = monitoringProgram
[docs] def get_storage(self): return self.storage
[docs] def set_storage(self, storage): self.storage = storage
[docs] def get_observationGoal(self): return self.observationGoal
[docs] def set_observationGoal(self, observationGoal): self.observationGoal = observationGoal
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_negationInd(self): return self.negationInd
[docs] def set_negationInd(self, negationInd): self.negationInd = negationInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None or self.approval is not None or self.policy is not None or self.marketingAct is not None or self.monitoringProgram is not None or self.storage is not None or self.observationGoal is not None or self.substanceSpecification is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.negationInd and 'negationInd' not in already_processed: already_processed.add('negationInd') outfile.write(' negationInd=%s' % (quote_attrib(self.negationInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.marketingAct is not None: self.marketingAct.export(outfile, level, namespace_, name_='marketingAct', pretty_print=pretty_print) if self.monitoringProgram is not None: self.monitoringProgram.export(outfile, level, namespace_, name_='monitoringProgram', pretty_print=pretty_print) if self.storage is not None: self.storage.export(outfile, level, namespace_, name_='storage', pretty_print=pretty_print) if self.observationGoal is not None: self.observationGoal.export(outfile, level, namespace_, name_='observationGoal', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject value = find_attr_value_('negationInd', node) if value is not None and 'negationInd' not in already_processed: already_processed.add('negationInd') if value in ('true', '1'): self.negationInd = True elif value in ('false', '0'): self.negationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.negationInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050100UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050100UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050100UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval' elif nodeName_ == 'policy': obj_ = POCP_MT050100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'marketingAct': obj_ = POCP_MT050100UV_MarketingAct.factory() obj_.build(child_) self.marketingAct = obj_ obj_.original_tagname_ = 'marketingAct' elif nodeName_ == 'monitoringProgram': obj_ = POCP_MT050100UV_MonitoringProgram.factory() obj_.build(child_) self.monitoringProgram = obj_ obj_.original_tagname_ = 'monitoringProgram' elif nodeName_ == 'storage': obj_ = POCP_MT050100UV_Storage.factory() obj_.build(child_) self.storage = obj_ obj_.original_tagname_ = 'storage' elif nodeName_ == 'observationGoal': obj_ = POCP_MT050100UV_ObservationGoal.factory() obj_.build(child_) self.observationGoal = obj_ obj_.original_tagname_ = 'observationGoal' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification'
# end class POCP_MT010600UV_Subject
[docs]class POCP_MT010600UV_SubstanceAdministration(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SBADM', moodCode='DEF', realmCode=None, typeId=None, templateId=None, routeCode=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.routeCode = routeCode
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010600UV_SubstanceAdministration) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010600UV_SubstanceAdministration.subclass: return POCP_MT010600UV_SubstanceAdministration.subclass(*args_, **kwargs_) else: return POCP_MT010600UV_SubstanceAdministration(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_routeCode(self): return self.routeCode
[docs] def set_routeCode(self, routeCode): self.routeCode = routeCode
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSubstanceAdministration(self, value): # Validate type ActClassSubstanceAdministration, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBADM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSubstanceAdministration' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSubstanceAdministration_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSubstanceAdministration_patterns_, ))
validate_ActClassSubstanceAdministration_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.routeCode is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010600UV.SubstanceAdministration', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010600UV.SubstanceAdministration') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010600UV.SubstanceAdministration', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010600UV.SubstanceAdministration'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SBADM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010600UV.SubstanceAdministration', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.routeCode is not None: self.routeCode.export(outfile, level, namespace_, name_='routeCode', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSubstanceAdministration(self.classCode) # validate type ActClassSubstanceAdministration value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'routeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.routeCode = obj_ obj_.original_tagname_ = 'routeCode'
# end class POCP_MT010600UV_SubstanceAdministration
[docs]class POCP_MT070100UV_Component(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, priorityNumber=None, pauseQuantity=None, checkpointCode=None, splitCode=None, joinCode=None, localVariableName=None, observation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.priorityNumber = priorityNumber self.pauseQuantity = pauseQuantity self.checkpointCode = checkpointCode self.splitCode = splitCode self.joinCode = joinCode self.localVariableName = localVariableName self.observation = observation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_Component) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_Component.subclass: return POCP_MT070100UV_Component.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_Component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_priorityNumber(self): return self.priorityNumber
[docs] def set_priorityNumber(self, priorityNumber): self.priorityNumber = priorityNumber
[docs] def get_pauseQuantity(self): return self.pauseQuantity
[docs] def set_pauseQuantity(self, pauseQuantity): self.pauseQuantity = pauseQuantity
[docs] def get_checkpointCode(self): return self.checkpointCode
[docs] def set_checkpointCode(self, checkpointCode): self.checkpointCode = checkpointCode
[docs] def get_splitCode(self): return self.splitCode
[docs] def set_splitCode(self, splitCode): self.splitCode = splitCode
[docs] def get_joinCode(self): return self.joinCode
[docs] def set_joinCode(self, joinCode): self.joinCode = joinCode
[docs] def get_localVariableName(self): return self.localVariableName
[docs] def set_localVariableName(self, localVariableName): self.localVariableName = localVariableName
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.priorityNumber is not None or self.pauseQuantity is not None or self.checkpointCode is not None or self.splitCode is not None or self.joinCode is not None or self.localVariableName is not None or self.observation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Component', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.Component') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.Component', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.Component'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Component', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.priorityNumber is not None: self.priorityNumber.export(outfile, level, namespace_, name_='priorityNumber', pretty_print=pretty_print) if self.pauseQuantity is not None: self.pauseQuantity.export(outfile, level, namespace_, name_='pauseQuantity', pretty_print=pretty_print) if self.checkpointCode is not None: self.checkpointCode.export(outfile, level, namespace_, name_='checkpointCode', pretty_print=pretty_print) if self.splitCode is not None: self.splitCode.export(outfile, level, namespace_, name_='splitCode', pretty_print=pretty_print) if self.joinCode is not None: self.joinCode.export(outfile, level, namespace_, name_='joinCode', pretty_print=pretty_print) if self.localVariableName is not None: self.localVariableName.export(outfile, level, namespace_, name_='localVariableName', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'priorityNumber': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.priorityNumber = obj_ obj_.original_tagname_ = 'priorityNumber' elif nodeName_ == 'pauseQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.pauseQuantity = obj_ obj_.original_tagname_ = 'pauseQuantity' elif nodeName_ == 'checkpointCode': obj_ = CS.factory() obj_.build(child_) self.checkpointCode = obj_ obj_.original_tagname_ = 'checkpointCode' elif nodeName_ == 'splitCode': obj_ = CS.factory() obj_.build(child_) self.splitCode = obj_ obj_.original_tagname_ = 'splitCode' elif nodeName_ == 'joinCode': obj_ = CS.factory() obj_.build(child_) self.joinCode = obj_ obj_.original_tagname_ = 'joinCode' elif nodeName_ == 'localVariableName': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.localVariableName = obj_ obj_.original_tagname_ = 'localVariableName' elif nodeName_ == 'observation': obj_ = POCP_MT070100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation'
# end class POCP_MT070100UV_Component
[docs]class POCP_MT070100UV_Consumable(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_Consumable) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_Consumable.subclass: return POCP_MT070100UV_Consumable.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_Consumable(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Consumable', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.Consumable') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.Consumable', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.Consumable'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Consumable', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT070100UV_Consumable
[docs]class POCP_MT070100UV_DerivedFrom(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DRIV', realmCode=None, typeId=None, templateId=None, localVariableName=None, subsetCode=None, observation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.localVariableName = localVariableName self.subsetCode = subsetCode self.observation = observation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_DerivedFrom) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_DerivedFrom.subclass: return POCP_MT070100UV_DerivedFrom.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_DerivedFrom(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_localVariableName(self): return self.localVariableName
[docs] def set_localVariableName(self, localVariableName): self.localVariableName = localVariableName
[docs] def get_subsetCode(self): return self.subsetCode
[docs] def set_subsetCode(self, subsetCode): self.subsetCode = subsetCode
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipIsDerivedFrom(self, value): # Validate type ActRelationshipIsDerivedFrom, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DRIV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipIsDerivedFrom' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipIsDerivedFrom_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipIsDerivedFrom_patterns_, ))
validate_ActRelationshipIsDerivedFrom_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.localVariableName is not None or self.subsetCode is not None or self.observation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.DerivedFrom', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.DerivedFrom') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.DerivedFrom', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.DerivedFrom'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DRIV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.DerivedFrom', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.localVariableName is not None: self.localVariableName.export(outfile, level, namespace_, name_='localVariableName', pretty_print=pretty_print) if self.subsetCode is not None: self.subsetCode.export(outfile, level, namespace_, name_='subsetCode', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipIsDerivedFrom(self.typeCode) # validate type ActRelationshipIsDerivedFrom
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'localVariableName': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.localVariableName = obj_ obj_.original_tagname_ = 'localVariableName' elif nodeName_ == 'subsetCode': obj_ = CS.factory() obj_.build(child_) self.subsetCode = obj_ obj_.original_tagname_ = 'subsetCode' elif nodeName_ == 'observation': obj_ = POCP_MT070100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation'
# end class POCP_MT070100UV_DerivedFrom
[docs]class POCP_MT070100UV_Generalization(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='GEN', realmCode=None, typeId=None, templateId=None, observation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observation = observation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_Generalization) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_Generalization.subclass: return POCP_MT070100UV_Generalization.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_Generalization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasGeneralization(self, value): # Validate type ActRelationshipHasGeneralization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasGeneralization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasGeneralization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasGeneralization_patterns_, ))
validate_ActRelationshipHasGeneralization_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Generalization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.Generalization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.Generalization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.Generalization'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "GEN" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Generalization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasGeneralization(self.typeCode) # validate type ActRelationshipHasGeneralization
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observation': obj_ = POCP_MT070100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation'
# end class POCP_MT070100UV_Generalization
[docs]class POCP_MT070100UV_ManifestationOf(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='MFST', realmCode=None, typeId=None, templateId=None, observationCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observationCriterion = observationCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_ManifestationOf) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_ManifestationOf.subclass: return POCP_MT070100UV_ManifestationOf.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_ManifestationOf(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observationCriterion(self): return self.observationCriterion
[docs] def set_observationCriterion(self, observationCriterion): self.observationCriterion = observationCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipIsManifestationOf(self, value): # Validate type ActRelationshipIsManifestationOf, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MFST'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipIsManifestationOf' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipIsManifestationOf_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipIsManifestationOf_patterns_, ))
validate_ActRelationshipIsManifestationOf_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observationCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.ManifestationOf', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.ManifestationOf') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.ManifestationOf', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.ManifestationOf'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "MFST" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.ManifestationOf', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observationCriterion is not None: self.observationCriterion.export(outfile, level, namespace_, name_='observationCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipIsManifestationOf(self.typeCode) # validate type ActRelationshipIsManifestationOf
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observationCriterion': obj_ = POCP_MT070100UV_ObservationCriterion.factory() obj_.build(child_) self.observationCriterion = obj_ obj_.original_tagname_ = 'observationCriterion'
# end class POCP_MT070100UV_ManifestationOf
[docs]class POCP_MT070100UV_Observation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, title=None, text=None, effectiveTime=None, confidentialityCode=None, value=None, analyte=None, consumable=None, generalization=None, derivedFrom=None, referenceRange=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.title = title self.text = text self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.value = value if analyte is None: self.analyte = [] else: self.analyte = analyte if consumable is None: self.consumable = [] else: self.consumable = consumable if generalization is None: self.generalization = [] else: self.generalization = generalization if derivedFrom is None: self.derivedFrom = [] else: self.derivedFrom = derivedFrom if referenceRange is None: self.referenceRange = [] else: self.referenceRange = referenceRange if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_Observation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_Observation.subclass: return POCP_MT070100UV_Observation.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_Observation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_analyte(self): return self.analyte
[docs] def set_analyte(self, analyte): self.analyte = analyte
[docs] def add_analyte(self, value): self.analyte.append(value)
[docs] def insert_analyte_at(self, index, value): self.analyte.insert(index, value)
[docs] def replace_analyte_at(self, index, value): self.analyte[index] = value
[docs] def get_consumable(self): return self.consumable
[docs] def set_consumable(self, consumable): self.consumable = consumable
[docs] def add_consumable(self, value): self.consumable.append(value)
[docs] def insert_consumable_at(self, index, value): self.consumable.insert(index, value)
[docs] def replace_consumable_at(self, index, value): self.consumable[index] = value
[docs] def get_generalization(self): return self.generalization
[docs] def set_generalization(self, generalization): self.generalization = generalization
[docs] def add_generalization(self, value): self.generalization.append(value)
[docs] def insert_generalization_at(self, index, value): self.generalization.insert(index, value)
[docs] def replace_generalization_at(self, index, value): self.generalization[index] = value
[docs] def get_derivedFrom(self): return self.derivedFrom
[docs] def set_derivedFrom(self, derivedFrom): self.derivedFrom = derivedFrom
[docs] def add_derivedFrom(self, value): self.derivedFrom.append(value)
[docs] def insert_derivedFrom_at(self, index, value): self.derivedFrom.insert(index, value)
[docs] def replace_derivedFrom_at(self, index, value): self.derivedFrom[index] = value
[docs] def get_referenceRange(self): return self.referenceRange
[docs] def set_referenceRange(self, referenceRange): self.referenceRange = referenceRange
[docs] def add_referenceRange(self, value): self.referenceRange.append(value)
[docs] def insert_referenceRange_at(self, index, value): self.referenceRange.insert(index, value)
[docs] def replace_referenceRange_at(self, index, value): self.referenceRange[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.title is not None or self.text is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.value is not None or self.analyte or self.consumable or self.generalization or self.derivedFrom or self.referenceRange or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Observation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.Observation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.Observation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.Observation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Observation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for analyte_ in self.analyte: analyte_.export(outfile, level, namespace_, name_='analyte', pretty_print=pretty_print) for consumable_ in self.consumable: consumable_.export(outfile, level, namespace_, name_='consumable', pretty_print=pretty_print) for generalization_ in self.generalization: generalization_.export(outfile, level, namespace_, name_='generalization', pretty_print=pretty_print) for derivedFrom_ in self.derivedFrom: derivedFrom_.export(outfile, level, namespace_, name_='derivedFrom', pretty_print=pretty_print) for referenceRange_ in self.referenceRange: referenceRange_.export(outfile, level, namespace_, name_='referenceRange', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'title': obj_ = ED.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'analyte': obj_ = POCP_MT070100UV_Participant.factory() obj_.build(child_) self.analyte.append(obj_) obj_.original_tagname_ = 'analyte' elif nodeName_ == 'consumable': obj_ = POCP_MT070100UV_Consumable.factory() obj_.build(child_) self.consumable.append(obj_) obj_.original_tagname_ = 'consumable' elif nodeName_ == 'generalization': obj_ = POCP_MT070100UV_Generalization.factory() obj_.build(child_) self.generalization.append(obj_) obj_.original_tagname_ = 'generalization' elif nodeName_ == 'derivedFrom': obj_ = POCP_MT070100UV_DerivedFrom.factory() obj_.build(child_) self.derivedFrom.append(obj_) obj_.original_tagname_ = 'derivedFrom' elif nodeName_ == 'referenceRange': obj_ = POCP_MT070100UV_ReferenceRange.factory() obj_.build(child_) self.referenceRange.append(obj_) obj_.original_tagname_ = 'referenceRange' elif nodeName_ == 'component': obj_ = POCP_MT070100UV_Component.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT070100UV_Observation
[docs]class POCP_MT070100UV_ObservationCriterion(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='EVN.CRT', isCriterionInd=None, realmCode=None, typeId=None, templateId=None, code=None, value=None, interpretationCode=None, manifestationOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) self.isCriterionInd = _cast(None, isCriterionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.value = value self.interpretationCode = interpretationCode if manifestationOf is None: self.manifestationOf = [] else: self.manifestationOf = manifestationOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_ObservationCriterion) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_ObservationCriterion.subclass: return POCP_MT070100UV_ObservationCriterion.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_ObservationCriterion(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_interpretationCode(self): return self.interpretationCode
[docs] def set_interpretationCode(self, interpretationCode): self.interpretationCode = interpretationCode
[docs] def get_manifestationOf(self): return self.manifestationOf
[docs] def set_manifestationOf(self, manifestationOf): self.manifestationOf = manifestationOf
[docs] def add_manifestationOf(self, value): self.manifestationOf.append(value)
[docs] def insert_manifestationOf_at(self, index, value): self.manifestationOf.insert(index, value)
[docs] def replace_manifestationOf_at(self, index, value): self.manifestationOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def get_isCriterionInd(self): return self.isCriterionInd
[docs] def set_isCriterionInd(self, isCriterionInd): self.isCriterionInd = isCriterionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventCriterion(self, value): # Validate type ActMoodEventCriterion, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN.CRT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventCriterion' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventCriterion_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventCriterion_patterns_, ))
validate_ActMoodEventCriterion_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.value is not None or self.interpretationCode is not None or self.manifestationOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.ObservationCriterion', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.ObservationCriterion') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.ObservationCriterion', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.ObservationCriterion'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN.CRT" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), )) if self.isCriterionInd is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') outfile.write(' isCriterionInd=%s' % (quote_attrib(self.isCriterionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.ObservationCriterion', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.interpretationCode is not None: self.interpretationCode.export(outfile, level, namespace_, name_='interpretationCode', pretty_print=pretty_print) for manifestationOf_ in self.manifestationOf: manifestationOf_.export(outfile, level, namespace_, name_='manifestationOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventCriterion(self.moodCode) # validate type ActMoodEventCriterion value = find_attr_value_('isCriterionInd', node) if value is not None and 'isCriterionInd' not in already_processed: already_processed.add('isCriterionInd') if value in ('true', '1'): self.isCriterionInd = True elif value in ('false', '0'): self.isCriterionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.isCriterionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'interpretationCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.interpretationCode = obj_ obj_.original_tagname_ = 'interpretationCode' elif nodeName_ == 'manifestationOf': obj_ = POCP_MT070100UV_ManifestationOf.factory() obj_.build(child_) self.manifestationOf.append(obj_) obj_.original_tagname_ = 'manifestationOf'
# end class POCP_MT070100UV_ObservationCriterion
[docs]class POCP_MT070100UV_Participant(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ALY', realmCode=None, typeId=None, templateId=None, presentSubstance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.presentSubstance = presentSubstance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_Participant) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_Participant.subclass: return POCP_MT070100UV_Participant.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_Participant(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_presentSubstance(self): return self.presentSubstance
[docs] def set_presentSubstance(self, presentSubstance): self.presentSubstance = presentSubstance
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAnalyte(self, value): # Validate type ParticipationAnalyte, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ALY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAnalyte' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAnalyte_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAnalyte_patterns_, ))
validate_ParticipationAnalyte_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.presentSubstance is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Participant', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.Participant') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.Participant', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.Participant'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ALY" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.Participant', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.presentSubstance is not None: self.presentSubstance.export(outfile, level, namespace_, name_='presentSubstance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAnalyte(self.typeCode) # validate type ParticipationAnalyte
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'presentSubstance': obj_ = POCP_MT080200UV_PresentSubstance.factory() obj_.build(child_) self.presentSubstance = obj_ obj_.original_tagname_ = 'presentSubstance'
# end class POCP_MT070100UV_Participant
[docs]class POCP_MT070100UV_ReferenceRange(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='REFV', realmCode=None, typeId=None, templateId=None, observationCriterion=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observationCriterion = observationCriterion
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070100UV_ReferenceRange) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070100UV_ReferenceRange.subclass: return POCP_MT070100UV_ReferenceRange.subclass(*args_, **kwargs_) else: return POCP_MT070100UV_ReferenceRange(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observationCriterion(self): return self.observationCriterion
[docs] def set_observationCriterion(self, observationCriterion): self.observationCriterion = observationCriterion
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasReferenceValues(self, value): # Validate type ActRelationshipHasReferenceValues, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['REFV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasReferenceValues' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasReferenceValues_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasReferenceValues_patterns_, ))
validate_ActRelationshipHasReferenceValues_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observationCriterion is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070100UV.ReferenceRange', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070100UV.ReferenceRange') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070100UV.ReferenceRange', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070100UV.ReferenceRange'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "REFV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070100UV.ReferenceRange', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observationCriterion is not None: self.observationCriterion.export(outfile, level, namespace_, name_='observationCriterion', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasReferenceValues(self.typeCode) # validate type ActRelationshipHasReferenceValues
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observationCriterion': obj_ = POCP_MT070100UV_ObservationCriterion.factory() obj_.build(child_) self.observationCriterion = obj_ obj_.original_tagname_ = 'observationCriterion'
# end class POCP_MT070100UV_ReferenceRange
[docs]class POCP_MT070200UV_ActDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, controlVariable=None, component=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_ActDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_ActDefinition.subclass: return POCP_MT070200UV_ActDefinition.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_ActDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.text is not None or self.effectiveTime is not None or self.controlVariable or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.ActDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.ActDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.ActDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.ActDefinition'): if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.ActDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'controlVariable': obj_ = POCP_MT070200UV_ControlVariable2.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'component': obj_ = POCP_MT070200UV_Component2.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT070200UV_ActDefinition
[docs]class POCP_MT070200UV_Component1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', contextControlCode='AP', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, priorityNumber=None, interventionProcedure=None, patientObservation=None, deviceObservation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.priorityNumber = priorityNumber self.interventionProcedure = interventionProcedure self.patientObservation = patientObservation self.deviceObservation = deviceObservation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_Component1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_Component1.subclass: return POCP_MT070200UV_Component1.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_Component1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_priorityNumber(self): return self.priorityNumber
[docs] def set_priorityNumber(self, priorityNumber): self.priorityNumber = priorityNumber
[docs] def get_interventionProcedure(self): return self.interventionProcedure
[docs] def set_interventionProcedure(self, interventionProcedure): self.interventionProcedure = interventionProcedure
[docs] def get_patientObservation(self): return self.patientObservation
[docs] def set_patientObservation(self, patientObservation): self.patientObservation = patientObservation
[docs] def get_deviceObservation(self): return self.deviceObservation
[docs] def set_deviceObservation(self, deviceObservation): self.deviceObservation = deviceObservation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.priorityNumber is not None or self.interventionProcedure is not None or self.patientObservation is not None or self.deviceObservation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Component1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.Component1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.Component1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.Component1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "AP" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Component1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.priorityNumber is not None: self.priorityNumber.export(outfile, level, namespace_, name_='priorityNumber', pretty_print=pretty_print) if self.interventionProcedure is not None: self.interventionProcedure.export(outfile, level, namespace_, name_='interventionProcedure', pretty_print=pretty_print) if self.patientObservation is not None: self.patientObservation.export(outfile, level, namespace_, name_='patientObservation', pretty_print=pretty_print) if self.deviceObservation is not None: self.deviceObservation.export(outfile, level, namespace_, name_='deviceObservation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'priorityNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.priorityNumber = obj_ obj_.original_tagname_ = 'priorityNumber' elif nodeName_ == 'interventionProcedure': obj_ = POCP_MT070200UV_InterventionProcedure.factory() obj_.build(child_) self.interventionProcedure = obj_ obj_.original_tagname_ = 'interventionProcedure' elif nodeName_ == 'patientObservation': obj_ = POCP_MT070200UV_PatientObservation.factory() obj_.build(child_) self.patientObservation = obj_ obj_.original_tagname_ = 'patientObservation' elif nodeName_ == 'deviceObservation': obj_ = POCP_MT070200UV_DeviceObservation.factory() obj_.build(child_) self.deviceObservation = obj_ obj_.original_tagname_ = 'deviceObservation'
# end class POCP_MT070200UV_Component1
[docs]class POCP_MT070200UV_Component2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', contextControlCode='AN', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, interventionProcedure=None, patientObservation=None, deviceObservation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.interventionProcedure = interventionProcedure self.patientObservation = patientObservation self.deviceObservation = deviceObservation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_Component2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_Component2.subclass: return POCP_MT070200UV_Component2.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_Component2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_interventionProcedure(self): return self.interventionProcedure
[docs] def set_interventionProcedure(self, interventionProcedure): self.interventionProcedure = interventionProcedure
[docs] def get_patientObservation(self): return self.patientObservation
[docs] def set_patientObservation(self, patientObservation): self.patientObservation = patientObservation
[docs] def get_deviceObservation(self): return self.deviceObservation
[docs] def set_deviceObservation(self, deviceObservation): self.deviceObservation = deviceObservation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.interventionProcedure is not None or self.patientObservation is not None or self.deviceObservation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Component2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.Component2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.Component2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.Component2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "AN" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Component2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.interventionProcedure is not None: self.interventionProcedure.export(outfile, level, namespace_, name_='interventionProcedure', pretty_print=pretty_print) if self.patientObservation is not None: self.patientObservation.export(outfile, level, namespace_, name_='patientObservation', pretty_print=pretty_print) if self.deviceObservation is not None: self.deviceObservation.export(outfile, level, namespace_, name_='deviceObservation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'interventionProcedure': obj_ = POCP_MT070200UV_InterventionProcedure.factory() obj_.build(child_) self.interventionProcedure = obj_ obj_.original_tagname_ = 'interventionProcedure' elif nodeName_ == 'patientObservation': obj_ = POCP_MT070200UV_PatientObservation.factory() obj_.build(child_) self.patientObservation = obj_ obj_.original_tagname_ = 'patientObservation' elif nodeName_ == 'deviceObservation': obj_ = POCP_MT070200UV_DeviceObservation.factory() obj_.build(child_) self.deviceObservation = obj_ obj_.original_tagname_ = 'deviceObservation'
# end class POCP_MT070200UV_Component2
[docs]class POCP_MT070200UV_Component3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', contextControlCode='AP', contextConductionInd='true', realmCode=None, typeId=None, templateId=None, sequenceNumber=None, priorityNumber=None, deviceSetting=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.sequenceNumber = sequenceNumber self.priorityNumber = priorityNumber self.deviceSetting = deviceSetting
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_Component3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_Component3.subclass: return POCP_MT070200UV_Component3.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_Component3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_sequenceNumber(self): return self.sequenceNumber
[docs] def set_sequenceNumber(self, sequenceNumber): self.sequenceNumber = sequenceNumber
[docs] def get_priorityNumber(self): return self.priorityNumber
[docs] def set_priorityNumber(self, priorityNumber): self.priorityNumber = priorityNumber
[docs] def get_deviceSetting(self): return self.deviceSetting
[docs] def set_deviceSetting(self, deviceSetting): self.deviceSetting = deviceSetting
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.sequenceNumber is not None or self.priorityNumber is not None or self.deviceSetting is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Component3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.Component3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.Component3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.Component3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "AP" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), )) if not self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Component3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.sequenceNumber is not None: self.sequenceNumber.export(outfile, level, namespace_, name_='sequenceNumber', pretty_print=pretty_print) if self.priorityNumber is not None: self.priorityNumber.export(outfile, level, namespace_, name_='priorityNumber', pretty_print=pretty_print) if self.deviceSetting is not None: self.deviceSetting.export(outfile, level, namespace_, name_='deviceSetting', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'sequenceNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.sequenceNumber = obj_ obj_.original_tagname_ = 'sequenceNumber' elif nodeName_ == 'priorityNumber': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.priorityNumber = obj_ obj_.original_tagname_ = 'priorityNumber' elif nodeName_ == 'deviceSetting': obj_ = POCP_MT070200UV_DeviceSetting.factory() obj_.build(child_) self.deviceSetting = obj_ obj_.original_tagname_ = 'deviceSetting'
# end class POCP_MT070200UV_Component3
[docs]class POCP_MT070200UV_ControlVariable1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CTRLV', contextControlCode='AN', contextConductionInd='false', realmCode=None, typeId=None, templateId=None, deviceSetting=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.deviceSetting = deviceSetting
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_ControlVariable1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_ControlVariable1.subclass: return POCP_MT070200UV_ControlVariable1.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_ControlVariable1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_deviceSetting(self): return self.deviceSetting
[docs] def set_deviceSetting(self, deviceSetting): self.deviceSetting = deviceSetting
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasControlVariable(self, value): # Validate type ActRelationshipHasControlVariable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CTRLV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasControlVariable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasControlVariable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasControlVariable_patterns_, ))
validate_ActRelationshipHasControlVariable_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.deviceSetting is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.ControlVariable1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.ControlVariable1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.ControlVariable1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.ControlVariable1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CTRLV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "AN" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), )) if self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.ControlVariable1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.deviceSetting is not None: self.deviceSetting.export(outfile, level, namespace_, name_='deviceSetting', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasControlVariable(self.typeCode) # validate type ActRelationshipHasControlVariable value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'deviceSetting': obj_ = POCP_MT070200UV_DeviceSetting.factory() obj_.build(child_) self.deviceSetting = obj_ obj_.original_tagname_ = 'deviceSetting'
# end class POCP_MT070200UV_ControlVariable1
[docs]class POCP_MT070200UV_ControlVariable2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CTRLV', contextControlCode='AN', contextConductionInd='false', realmCode=None, typeId=None, templateId=None, deviceSetting=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) self.contextConductionInd = _cast(None, contextConductionInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.deviceSetting = deviceSetting
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_ControlVariable2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_ControlVariable2.subclass: return POCP_MT070200UV_ControlVariable2.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_ControlVariable2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_deviceSetting(self): return self.deviceSetting
[docs] def set_deviceSetting(self, deviceSetting): self.deviceSetting = deviceSetting
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def get_contextConductionInd(self): return self.contextConductionInd
[docs] def set_contextConductionInd(self, contextConductionInd): self.contextConductionInd = contextConductionInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasControlVariable(self, value): # Validate type ActRelationshipHasControlVariable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CTRLV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasControlVariable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasControlVariable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasControlVariable_patterns_, ))
validate_ActRelationshipHasControlVariable_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.deviceSetting is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.ControlVariable2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.ControlVariable2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.ControlVariable2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.ControlVariable2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CTRLV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "AN" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), )) if self.contextConductionInd and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') outfile.write(' contextConductionInd=%s' % (quote_attrib(self.contextConductionInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.ControlVariable2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.deviceSetting is not None: self.deviceSetting.export(outfile, level, namespace_, name_='deviceSetting', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasControlVariable(self.typeCode) # validate type ActRelationshipHasControlVariable value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl value = find_attr_value_('contextConductionInd', node) if value is not None and 'contextConductionInd' not in already_processed: already_processed.add('contextConductionInd') if value in ('true', '1'): self.contextConductionInd = True elif value in ('false', '0'): self.contextConductionInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.contextConductionInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'deviceSetting': obj_ = POCP_MT070200UV_DeviceSetting.factory() obj_.build(child_) self.deviceSetting = obj_ obj_.original_tagname_ = 'deviceSetting'
# end class POCP_MT070200UV_ControlVariable2
[docs]class POCP_MT070200UV_Device2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DEV', contextControlCode='OP', realmCode=None, typeId=None, templateId=None, manufacturedProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct = manufacturedProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_Device2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_Device2.subclass: return POCP_MT070200UV_Device2.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_Device2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Device2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.Device2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.Device2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.Device2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DEV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "OP" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Device2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010100UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct'
# end class POCP_MT070200UV_Device2
[docs]class POCP_MT070200UV_DeviceObservation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, value=None, interpretationCode=None, methodCode=None, subject=None, controlVariable=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime self.value = value self.interpretationCode = interpretationCode self.methodCode = methodCode self.subject = subject if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_DeviceObservation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_DeviceObservation.subclass: return POCP_MT070200UV_DeviceObservation.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_DeviceObservation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_interpretationCode(self): return self.interpretationCode
[docs] def set_interpretationCode(self, interpretationCode): self.interpretationCode = interpretationCode
[docs] def get_methodCode(self): return self.methodCode
[docs] def set_methodCode(self, methodCode): self.methodCode = methodCode
[docs] def get_subject(self): return self.subject
[docs] def set_subject(self, subject): self.subject = subject
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.value is not None or self.interpretationCode is not None or self.methodCode is not None or self.subject is not None or self.controlVariable or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.DeviceObservation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.DeviceObservation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.DeviceObservation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.DeviceObservation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.DeviceObservation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.interpretationCode is not None: self.interpretationCode.export(outfile, level, namespace_, name_='interpretationCode', pretty_print=pretty_print) if self.methodCode is not None: self.methodCode.export(outfile, level, namespace_, name_='methodCode', pretty_print=pretty_print) if self.subject is not None: self.subject.export(outfile, level, namespace_, name_='subject', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'interpretationCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.interpretationCode = obj_ obj_.original_tagname_ = 'interpretationCode' elif nodeName_ == 'methodCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.methodCode = obj_ obj_.original_tagname_ = 'methodCode' elif nodeName_ == 'subject': obj_ = POCP_MT070200UV_Subject2.factory() obj_.build(child_) self.subject = obj_ obj_.original_tagname_ = 'subject' elif nodeName_ == 'controlVariable': obj_ = POCP_MT070200UV_ControlVariable1.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'component': obj_ = POCP_MT070200UV_Component1.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT070200UV_DeviceObservation
[docs]class POCP_MT070200UV_DeviceSetting(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, value=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.value = value if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_DeviceSetting) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_DeviceSetting.subclass: return POCP_MT070200UV_DeviceSetting.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_DeviceSetting(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.value is not None or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.DeviceSetting', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.DeviceSetting') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.DeviceSetting', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.DeviceSetting'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.DeviceSetting', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'component': obj_ = POCP_MT070200UV_Component3.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT070200UV_DeviceSetting
[docs]class POCP_MT070200UV_InterventionProcedure(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, activityTime=None, controlVariable=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.activityTime = activityTime if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_InterventionProcedure) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_InterventionProcedure.subclass: return POCP_MT070200UV_InterventionProcedure.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_InterventionProcedure(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_activityTime(self): return self.activityTime
[docs] def set_activityTime(self, activityTime): self.activityTime = activityTime
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.activityTime is not None or self.controlVariable or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.InterventionProcedure', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.InterventionProcedure') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.InterventionProcedure', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.InterventionProcedure'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.InterventionProcedure', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.activityTime is not None: self.activityTime.export(outfile, level, namespace_, name_='activityTime', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'activityTime': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.activityTime = obj_ obj_.original_tagname_ = 'activityTime' elif nodeName_ == 'controlVariable': obj_ = POCP_MT070200UV_ControlVariable1.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'component': obj_ = POCP_MT070200UV_Component1.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT070200UV_InterventionProcedure
[docs]class POCP_MT070200UV_PatientObservation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='OBS', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, value=None, interpretationCode=None, device=None, controlVariable=None, component=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime self.value = value self.interpretationCode = interpretationCode self.device = device if controlVariable is None: self.controlVariable = [] else: self.controlVariable = controlVariable if component is None: self.component = [] else: self.component = component
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_PatientObservation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_PatientObservation.subclass: return POCP_MT070200UV_PatientObservation.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_PatientObservation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_interpretationCode(self): return self.interpretationCode
[docs] def set_interpretationCode(self, interpretationCode): self.interpretationCode = interpretationCode
[docs] def get_device(self): return self.device
[docs] def set_device(self, device): self.device = device
[docs] def get_controlVariable(self): return self.controlVariable
[docs] def set_controlVariable(self, controlVariable): self.controlVariable = controlVariable
[docs] def add_controlVariable(self, value): self.controlVariable.append(value)
[docs] def insert_controlVariable_at(self, index, value): self.controlVariable.insert(index, value)
[docs] def replace_controlVariable_at(self, index, value): self.controlVariable[index] = value
[docs] def get_component(self): return self.component
[docs] def set_component(self, component): self.component = component
[docs] def add_component(self, value): self.component.append(value)
[docs] def insert_component_at(self, index, value): self.component.insert(index, value)
[docs] def replace_component_at(self, index, value): self.component[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.text is not None or self.effectiveTime is not None or self.value is not None or self.interpretationCode is not None or self.device is not None or self.controlVariable or self.component ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.PatientObservation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.PatientObservation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.PatientObservation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.PatientObservation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.PatientObservation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) if self.interpretationCode is not None: self.interpretationCode.export(outfile, level, namespace_, name_='interpretationCode', pretty_print=pretty_print) if self.device is not None: self.device.export(outfile, level, namespace_, name_='device', pretty_print=pretty_print) for controlVariable_ in self.controlVariable: controlVariable_.export(outfile, level, namespace_, name_='controlVariable', pretty_print=pretty_print) for component_ in self.component: component_.export(outfile, level, namespace_, name_='component', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'interpretationCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.interpretationCode = obj_ obj_.original_tagname_ = 'interpretationCode' elif nodeName_ == 'device': obj_ = POCP_MT070200UV_Device2.factory() obj_.build(child_) self.device = obj_ obj_.original_tagname_ = 'device' elif nodeName_ == 'controlVariable': obj_ = POCP_MT070200UV_ControlVariable1.factory() obj_.build(child_) self.controlVariable.append(obj_) obj_.original_tagname_ = 'controlVariable' elif nodeName_ == 'component': obj_ = POCP_MT070200UV_Component1.factory() obj_.build(child_) self.component.append(obj_) obj_.original_tagname_ = 'component'
# end class POCP_MT070200UV_PatientObservation
[docs]class POCP_MT070200UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', contextControlCode='OP', realmCode=None, typeId=None, templateId=None, manufacturedProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.contextControlCode = _cast(None, contextControlCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct = manufacturedProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT070200UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT070200UV_Subject2.subclass: return POCP_MT070200UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT070200UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_contextControlCode(self): return self.contextControlCode
[docs] def set_contextControlCode(self, contextControlCode): self.contextControlCode = contextControlCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ContextControl(self, value): # Validate type ContextControl, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AN', 'AP', 'ON', 'OP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ContextControl' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ContextControl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ContextControl_patterns_, ))
validate_ContextControl_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT070200UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT070200UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT070200UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.contextControlCode != "OP" and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') outfile.write(' contextControlCode=%s' % (quote_attrib(self.contextControlCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT070200UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject value = find_attr_value_('contextControlCode', node) if value is not None and 'contextControlCode' not in already_processed: already_processed.add('contextControlCode') self.contextControlCode = value self.validate_ContextControl(self.contextControlCode) # validate type ContextControl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010100UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct'
# end class POCP_MT070200UV_Subject2
[docs]class POCP_MT010100UV_ActDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, primaryPerformer=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime if primaryPerformer is None: self.primaryPerformer = [] else: self.primaryPerformer = primaryPerformer self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_ActDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_ActDefinition.subclass: return POCP_MT010100UV_ActDefinition.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_ActDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_primaryPerformer(self): return self.primaryPerformer
[docs] def set_primaryPerformer(self, primaryPerformer): self.primaryPerformer = primaryPerformer
[docs] def add_primaryPerformer(self, value): self.primaryPerformer.append(value)
[docs] def insert_primaryPerformer_at(self, index, value): self.primaryPerformer.insert(index, value)
[docs] def replace_primaryPerformer_at(self, index, value): self.primaryPerformer[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.primaryPerformer or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ActDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.ActDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.ActDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.ActDefinition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ActDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for primaryPerformer_ in self.primaryPerformer: primaryPerformer_.export(outfile, level, namespace_, name_='primaryPerformer', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'primaryPerformer': obj_ = POCP_MT010100UV_PrimaryPerformer.factory() obj_.build(child_) self.primaryPerformer.append(obj_) obj_.original_tagname_ = 'primaryPerformer' elif nodeName_ == 'author': obj_ = POCP_MT010100UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010100UV_ActDefinition
[docs]class POCP_MT010100UV_AdministerableMaterial(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ADMM', realmCode=None, typeId=None, templateId=None, administrableProduct=None, subjectOf=None, consumedIn=None, productOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.administrableProduct = administrableProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_AdministerableMaterial) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_AdministerableMaterial.subclass: return POCP_MT010100UV_AdministerableMaterial.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_AdministerableMaterial(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_administrableProduct(self): return self.administrableProduct
[docs] def set_administrableProduct(self, administrableProduct): self.administrableProduct = administrableProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAdministerableMaterial(self, value): # Validate type RoleClassAdministerableMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ADMM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAdministerableMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAdministerableMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAdministerableMaterial_patterns_, ))
validate_RoleClassAdministerableMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.administrableProduct is not None or self.subjectOf or self.consumedIn or self.productOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.AdministerableMaterial', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.AdministerableMaterial') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.AdministerableMaterial', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.AdministerableMaterial'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ADMM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.AdministerableMaterial', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.administrableProduct is not None: self.administrableProduct.export(outfile, level, namespace_, name_='administrableProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAdministerableMaterial(self.classCode) # validate type RoleClassAdministerableMaterial
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'administrableProduct': obj_ = POCP_MT010100UV_Product.factory() obj_.build(child_) self.administrableProduct = obj_ obj_.original_tagname_ = 'administrableProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010100UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010100UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf'
# end class POCP_MT010100UV_AdministerableMaterial
[docs]class POCP_MT010100UV_Author(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Author) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Author.subclass: return POCP_MT010100UV_Author.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Author(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Author', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Author') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Author', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Author'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Author', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT010100UV_Author
[docs]class POCP_MT010100UV_Consumable1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, substanceAdministration=None, substanceAdministration1=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.substanceAdministration = substanceAdministration self.substanceAdministration1 = substanceAdministration1
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Consumable1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Consumable1.subclass: return POCP_MT010100UV_Consumable1.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Consumable1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_substanceAdministration(self): return self.substanceAdministration
[docs] def set_substanceAdministration(self, substanceAdministration): self.substanceAdministration = substanceAdministration
[docs] def get_substanceAdministration1(self): return self.substanceAdministration1
[docs] def set_substanceAdministration1(self, substanceAdministration1): self.substanceAdministration1 = substanceAdministration1
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.substanceAdministration is not None or self.substanceAdministration1 is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Consumable1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Consumable1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Consumable1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Consumable1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Consumable1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.substanceAdministration is not None: self.substanceAdministration.export(outfile, level, namespace_, name_='substanceAdministration', pretty_print=pretty_print) if self.substanceAdministration1 is not None: self.substanceAdministration1.export(outfile, level, namespace_, name_='substanceAdministration1', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'substanceAdministration': obj_ = POCP_MT010100UV_SubstanceAdministration.factory() obj_.build(child_) self.substanceAdministration = obj_ obj_.original_tagname_ = 'substanceAdministration' elif nodeName_ == 'substanceAdministration1': obj_ = POCP_MT060100UV_SubstanceAdministration1.factory() obj_.build(child_) self.substanceAdministration1 = obj_ obj_.original_tagname_ = 'substanceAdministration1'
# end class POCP_MT010100UV_Consumable1
[docs]class POCP_MT010100UV_Consumable2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='CSM', realmCode=None, typeId=None, templateId=None, quantity=None, manufacturedProduct1=None, content1=None, content2=None, administerableMaterial=None, manufacturedProduct2=None, part=None, manufacturedProduct3=None, ingredient=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.manufacturedProduct1 = manufacturedProduct1 self.content1 = content1 self.content2 = content2 self.administerableMaterial = administerableMaterial self.manufacturedProduct2 = manufacturedProduct2 self.part = part self.manufacturedProduct3 = manufacturedProduct3 self.ingredient = ingredient
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Consumable2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Consumable2.subclass: return POCP_MT010100UV_Consumable2.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Consumable2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_manufacturedProduct1(self): return self.manufacturedProduct1
[docs] def set_manufacturedProduct1(self, manufacturedProduct1): self.manufacturedProduct1 = manufacturedProduct1
[docs] def get_content1(self): return self.content1
[docs] def set_content1(self, content1): self.content1 = content1
[docs] def get_content2(self): return self.content2
[docs] def set_content2(self, content2): self.content2 = content2
[docs] def get_administerableMaterial(self): return self.administerableMaterial
[docs] def set_administerableMaterial(self, administerableMaterial): self.administerableMaterial = administerableMaterial
[docs] def get_manufacturedProduct2(self): return self.manufacturedProduct2
[docs] def set_manufacturedProduct2(self, manufacturedProduct2): self.manufacturedProduct2 = manufacturedProduct2
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def get_manufacturedProduct3(self): return self.manufacturedProduct3
[docs] def set_manufacturedProduct3(self, manufacturedProduct3): self.manufacturedProduct3 = manufacturedProduct3
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationConsumable(self, value): # Validate type ParticipationConsumable, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CSM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationConsumable' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationConsumable_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationConsumable_patterns_, ))
validate_ParticipationConsumable_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.manufacturedProduct1 is not None or self.content1 is not None or self.content2 is not None or self.administerableMaterial is not None or self.manufacturedProduct2 is not None or self.part is not None or self.manufacturedProduct3 is not None or self.ingredient is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Consumable2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Consumable2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Consumable2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Consumable2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "CSM" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Consumable2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.manufacturedProduct1 is not None: self.manufacturedProduct1.export(outfile, level, namespace_, name_='manufacturedProduct1', pretty_print=pretty_print) if self.content1 is not None: self.content1.export(outfile, level, namespace_, name_='content1', pretty_print=pretty_print) if self.content2 is not None: self.content2.export(outfile, level, namespace_, name_='content2', pretty_print=pretty_print) if self.administerableMaterial is not None: self.administerableMaterial.export(outfile, level, namespace_, name_='administerableMaterial', pretty_print=pretty_print) if self.manufacturedProduct2 is not None: self.manufacturedProduct2.export(outfile, level, namespace_, name_='manufacturedProduct2', pretty_print=pretty_print) if self.part is not None: self.part.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) if self.manufacturedProduct3 is not None: self.manufacturedProduct3.export(outfile, level, namespace_, name_='manufacturedProduct3', pretty_print=pretty_print) if self.ingredient is not None: self.ingredient.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationConsumable(self.typeCode) # validate type ParticipationConsumable
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'manufacturedProduct1': obj_ = POCP_MT010100UV_ManufacturedProduct2.factory() obj_.build(child_) self.manufacturedProduct1 = obj_ obj_.original_tagname_ = 'manufacturedProduct1' elif nodeName_ == 'content1': obj_ = POCP_MT010100UV_Content1.factory() obj_.build(child_) self.content1 = obj_ obj_.original_tagname_ = 'content1' elif nodeName_ == 'content2': obj_ = POCP_MT010100UV_Content.factory() obj_.build(child_) self.content2 = obj_ obj_.original_tagname_ = 'content2' elif nodeName_ == 'administerableMaterial': obj_ = POCP_MT010100UV_AdministerableMaterial.factory() obj_.build(child_) self.administerableMaterial = obj_ obj_.original_tagname_ = 'administerableMaterial' elif nodeName_ == 'manufacturedProduct2': obj_ = POCP_MT010100UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct2 = obj_ obj_.original_tagname_ = 'manufacturedProduct2' elif nodeName_ == 'part': obj_ = POCP_MT010100UV_Part.factory() obj_.build(child_) self.part = obj_ obj_.original_tagname_ = 'part' elif nodeName_ == 'manufacturedProduct3': obj_ = POCP_MT010100UV_ManufacturedProduct.factory() obj_.build(child_) self.manufacturedProduct3 = obj_ obj_.original_tagname_ = 'manufacturedProduct3' elif nodeName_ == 'ingredient': obj_ = POCP_MT010100UV_Ingredient.factory() obj_.build(child_) self.ingredient = obj_ obj_.original_tagname_ = 'ingredient'
# end class POCP_MT010100UV_Consumable2
[docs]class POCP_MT010100UV_Content(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, containerPackagedProduct=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.containerPackagedProduct = containerPackagedProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Content) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Content.subclass: return POCP_MT010100UV_Content.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Content(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_containerPackagedProduct(self): return self.containerPackagedProduct
[docs] def set_containerPackagedProduct(self, containerPackagedProduct): self.containerPackagedProduct = containerPackagedProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.containerPackagedProduct is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Content', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Content') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Content', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Content'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Content', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.containerPackagedProduct is not None: self.containerPackagedProduct.export(outfile, level, namespace_, name_='containerPackagedProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'containerPackagedProduct': obj_ = POCP_MT010100UV_PackagedProduct.factory() obj_.build(child_) self.containerPackagedProduct = obj_ obj_.original_tagname_ = 'containerPackagedProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010100UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010100UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010100UV_Content
[docs]class POCP_MT010100UV_Content1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, containerPackagedProduct=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.containerPackagedProduct = containerPackagedProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Content1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Content1.subclass: return POCP_MT010100UV_Content1.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Content1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_containerPackagedProduct(self): return self.containerPackagedProduct
[docs] def set_containerPackagedProduct(self, containerPackagedProduct): self.containerPackagedProduct = containerPackagedProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.containerPackagedProduct is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Content1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Content1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Content1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Content1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Content1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.containerPackagedProduct is not None: self.containerPackagedProduct.export(outfile, level, namespace_, name_='containerPackagedProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'containerPackagedProduct': obj_ = POCP_MT010100UV_PackagedProduct.factory() obj_.build(child_) self.containerPackagedProduct = obj_ obj_.original_tagname_ = 'containerPackagedProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010100UV_Product2.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010100UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010100UV_Content1
[docs]class POCP_MT010100UV_Device(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DEV', realmCode=None, typeId=None, templateId=None, observation=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.observation = observation self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Device) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Device.subclass: return POCP_MT010100UV_Device.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Device(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_observation(self): return self.observation
[docs] def set_observation(self, observation): self.observation = observation
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetDevice(self, value): # Validate type ParticipationTargetDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'NRD', 'RDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetDevice_patterns_, ))
validate_ParticipationTargetDevice_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.observation is not None or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Device', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Device') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Device', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Device'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DEV" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Device', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.observation is not None: self.observation.export(outfile, level, namespace_, name_='observation', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetDevice(self.typeCode) # validate type ParticipationTargetDevice
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'observation': obj_ = POCP_MT070100UV_Observation.factory() obj_.build(child_) self.observation = obj_ obj_.original_tagname_ = 'observation' elif nodeName_ == 'actDefinition': obj_ = POCP_MT070200UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT010100UV_Device
[docs]class POCP_MT010100UV_EntityWithGeneric(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='GRIC', realmCode=None, typeId=None, templateId=None, genericMedicine=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.genericMedicine = genericMedicine
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_EntityWithGeneric) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_EntityWithGeneric.subclass: return POCP_MT010100UV_EntityWithGeneric.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_EntityWithGeneric(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_genericMedicine(self): return self.genericMedicine
[docs] def set_genericMedicine(self, genericMedicine): self.genericMedicine = genericMedicine
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassHasGeneric(self, value): # Validate type RoleClassHasGeneric, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassHasGeneric' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassHasGeneric_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassHasGeneric_patterns_, ))
validate_RoleClassHasGeneric_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.genericMedicine is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.EntityWithGeneric', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.EntityWithGeneric') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.EntityWithGeneric', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.EntityWithGeneric'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "GRIC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.EntityWithGeneric', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.genericMedicine is not None: self.genericMedicine.export(outfile, level, namespace_, name_='genericMedicine', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassHasGeneric(self.classCode) # validate type RoleClassHasGeneric
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'genericMedicine': obj_ = POCP_MT010100UV_GenericMedicine.factory() obj_.build(child_) self.genericMedicine = obj_ obj_.original_tagname_ = 'genericMedicine'
# end class POCP_MT010100UV_EntityWithGeneric
[docs]class POCP_MT010100UV_EquivalentEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='EQUIV', realmCode=None, typeId=None, templateId=None, code=None, quantity=None, definingMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.quantity = quantity self.definingMaterialKind = definingMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_EquivalentEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_EquivalentEntity.subclass: return POCP_MT010100UV_EquivalentEntity.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_EquivalentEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_definingMaterialKind(self): return self.definingMaterialKind
[docs] def set_definingMaterialKind(self, definingMaterialKind): self.definingMaterialKind = definingMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassEquivalentEntity(self, value): # Validate type RoleClassEquivalentEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EQUIV', 'SAME', 'SUBY'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassEquivalentEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassEquivalentEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassEquivalentEntity_patterns_, ))
validate_RoleClassEquivalentEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.quantity is not None or self.definingMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.EquivalentEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.EquivalentEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.EquivalentEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.EquivalentEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "EQUIV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.EquivalentEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.definingMaterialKind is not None: self.definingMaterialKind.export(outfile, level, namespace_, name_='definingMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassEquivalentEntity(self.classCode) # validate type RoleClassEquivalentEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'definingMaterialKind': obj_ = POCP_MT010100UV_MaterialKind.factory() obj_.build(child_) self.definingMaterialKind = obj_ obj_.original_tagname_ = 'definingMaterialKind'
# end class POCP_MT010100UV_EquivalentEntity
[docs]class POCP_MT010100UV_GenericMedicine(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_GenericMedicine) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_GenericMedicine.subclass: return POCP_MT010100UV_GenericMedicine.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_GenericMedicine(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.GenericMedicine', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.GenericMedicine') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.GenericMedicine', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.GenericMedicine'): if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.GenericMedicine', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010100UV_GenericMedicine
[docs]class POCP_MT010100UV_IdentifiedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, id=None, code=None, effectiveTime=None, assigningOrganization=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.effectiveTime = effectiveTime self.assigningOrganization = assigningOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_IdentifiedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_IdentifiedEntity.subclass: return POCP_MT010100UV_IdentifiedEntity.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_IdentifiedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_assigningOrganization(self): return self.assigningOrganization
[docs] def set_assigningOrganization(self, assigningOrganization): self.assigningOrganization = assigningOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.effectiveTime is not None or self.assigningOrganization is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.IdentifiedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.IdentifiedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.IdentifiedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.IdentifiedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.IdentifiedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.assigningOrganization is not None: self.assigningOrganization.export(outfile, level, namespace_, name_='assigningOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'assigningOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.assigningOrganization = obj_ obj_.original_tagname_ = 'assigningOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT010100UV_IdentifiedEntity
[docs]class POCP_MT010100UV_IndirectTarget(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='IND', realmCode=None, typeId=None, templateId=None, valuedItem=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.valuedItem = valuedItem
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_IndirectTarget) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_IndirectTarget.subclass: return POCP_MT010100UV_IndirectTarget.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_IndirectTarget(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_valuedItem(self): return self.valuedItem
[docs] def set_valuedItem(self, valuedItem): self.valuedItem = valuedItem
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationIndirectTarget(self, value): # Validate type ParticipationIndirectTarget, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IND', 'BEN', 'CAGNT', 'COV', 'GUAR', 'HLD', 'RCT', 'RCV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationIndirectTarget' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationIndirectTarget_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationIndirectTarget_patterns_, ))
validate_ParticipationIndirectTarget_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.valuedItem is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.IndirectTarget', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.IndirectTarget') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.IndirectTarget', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.IndirectTarget'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "IND" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.IndirectTarget', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.valuedItem is not None: self.valuedItem.export(outfile, level, namespace_, name_='valuedItem', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationIndirectTarget(self.typeCode) # validate type ParticipationIndirectTarget
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'valuedItem': obj_ = COCT_MT440001UV09_ValuedItem.factory() obj_.build(child_) self.valuedItem = obj_ obj_.original_tagname_ = 'valuedItem'
# end class POCP_MT010100UV_IndirectTarget
[docs]class POCP_MT010100UV_Ingredient(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='INGR', realmCode=None, typeId=None, templateId=None, id=None, effectiveTime=None, confidentialityCode=None, quantity=None, ingredientSubstance=None, subjectOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.effectiveTime = effectiveTime self.confidentialityCode = confidentialityCode self.quantity = quantity self.ingredientSubstance = ingredientSubstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Ingredient) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Ingredient.subclass: return POCP_MT010100UV_Ingredient.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Ingredient(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_ingredientSubstance(self): return self.ingredientSubstance
[docs] def set_ingredientSubstance(self, ingredientSubstance): self.ingredientSubstance = ingredientSubstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIngredientEntity(self, value): # Validate type RoleClassIngredientEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIngredientEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIngredientEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIngredientEntity_patterns_, ))
validate_RoleClassIngredientEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.effectiveTime is not None or self.confidentialityCode is not None or self.quantity is not None or self.ingredientSubstance is not None or self.subjectOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Ingredient', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Ingredient') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Ingredient', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Ingredient'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "INGR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Ingredient', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.ingredientSubstance is not None: self.ingredientSubstance.export(outfile, level, namespace_, name_='ingredientSubstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIngredientEntity(self.classCode) # validate type RoleClassIngredientEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'ingredientSubstance': obj_ = POCP_MT081100UV_Substance.factory() obj_.build(child_) self.ingredientSubstance = obj_ obj_.original_tagname_ = 'ingredientSubstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010100UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010100UV_Ingredient
[docs]class POCP_MT010100UV_ManufacturedProduct(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturedProduct=None, manufacturerOrganization=None, subjectOf=None, deviceOf=None, consumedIn=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturedProduct = manufacturedProduct self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if deviceOf is None: self.deviceOf = [] else: self.deviceOf = deviceOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_ManufacturedProduct) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_ManufacturedProduct.subclass: return POCP_MT010100UV_ManufacturedProduct.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_ManufacturedProduct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_deviceOf(self): return self.deviceOf
[docs] def set_deviceOf(self, deviceOf): self.deviceOf = deviceOf
[docs] def add_deviceOf(self, value): self.deviceOf.append(value)
[docs] def insert_deviceOf_at(self, index, value): self.deviceOf.insert(index, value)
[docs] def replace_deviceOf_at(self, index, value): self.deviceOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturedProduct is not None or self.manufacturerOrganization is not None or self.subjectOf or self.deviceOf or self.consumedIn or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.ManufacturedProduct') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for deviceOf_ in self.deviceOf: deviceOf_.export(outfile, level, namespace_, name_='deviceOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT010100UV_Product.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'deviceOf': obj_ = POCP_MT010100UV_Device.factory() obj_.build(child_) self.deviceOf.append(obj_) obj_.original_tagname_ = 'deviceOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010100UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010100UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010100UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010100UV_ManufacturedProduct
[docs]class POCP_MT010100UV_ManufacturedProduct2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturerOrganization=None, subjectOf=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_ManufacturedProduct2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_ManufacturedProduct2.subclass: return POCP_MT010100UV_ManufacturedProduct2.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_ManufacturedProduct2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturerOrganization is not None or self.subjectOf or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.ManufacturedProduct2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'productOf': obj_ = POCP_MT010100UV_Product2.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010100UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010100UV_ManufacturedProduct2
[docs]class POCP_MT010100UV_ManufacturedProduct3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturerOrganization=None, subjectOf=None, consumedIn=None, productOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturerOrganization = manufacturerOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_ManufacturedProduct3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_ManufacturedProduct3.subclass: return POCP_MT010100UV_ManufacturedProduct3.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_ManufacturedProduct3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturerOrganization(self): return self.manufacturerOrganization
[docs] def set_manufacturerOrganization(self, manufacturerOrganization): self.manufacturerOrganization = manufacturerOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturerOrganization is not None or self.subjectOf or self.consumedIn or self.productOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.ManufacturedProduct3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.ManufacturedProduct3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturerOrganization is not None: self.manufacturerOrganization.export(outfile, level, namespace_, name_='manufacturerOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturerOrganization': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.manufacturerOrganization = obj_ obj_.original_tagname_ = 'manufacturerOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010100UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010100UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf'
# end class POCP_MT010100UV_ManufacturedProduct3
[docs]class POCP_MT010100UV_MaterialKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_MaterialKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_MaterialKind.subclass: return POCP_MT010100UV_MaterialKind.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_MaterialKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassMaterial(self, value): # Validate type EntityClassMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MAT', 'CHEM', 'FOOD', 'MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassMaterial_patterns_, ))
validate_EntityClassMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.MaterialKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.MaterialKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.MaterialKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.MaterialKind'): if self.classCode != "MAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.MaterialKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassMaterial(self.classCode) # validate type EntityClassMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = TN.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name'
# end class POCP_MT010100UV_MaterialKind
[docs]class POCP_MT010100UV_PackagedProduct(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='CONT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, formCode=None, capacityQuantity=None, capTypeCode=None, asIdentifiedEntity=None, asManufacturedProduct=None, asContent=None, asSpecializedKind=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc self.formCode = formCode self.capacityQuantity = capacityQuantity self.capTypeCode = capTypeCode if asIdentifiedEntity is None: self.asIdentifiedEntity = [] else: self.asIdentifiedEntity = asIdentifiedEntity if asManufacturedProduct is None: self.asManufacturedProduct = [] else: self.asManufacturedProduct = asManufacturedProduct if asContent is None: self.asContent = [] else: self.asContent = asContent if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_PackagedProduct) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_PackagedProduct.subclass: return POCP_MT010100UV_PackagedProduct.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_PackagedProduct(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_capacityQuantity(self): return self.capacityQuantity
[docs] def set_capacityQuantity(self, capacityQuantity): self.capacityQuantity = capacityQuantity
[docs] def get_capTypeCode(self): return self.capTypeCode
[docs] def set_capTypeCode(self, capTypeCode): self.capTypeCode = capTypeCode
[docs] def get_asIdentifiedEntity(self): return self.asIdentifiedEntity
[docs] def set_asIdentifiedEntity(self, asIdentifiedEntity): self.asIdentifiedEntity = asIdentifiedEntity
[docs] def add_asIdentifiedEntity(self, value): self.asIdentifiedEntity.append(value)
[docs] def insert_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity.insert(index, value)
[docs] def replace_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity[index] = value
[docs] def get_asManufacturedProduct(self): return self.asManufacturedProduct
[docs] def set_asManufacturedProduct(self, asManufacturedProduct): self.asManufacturedProduct = asManufacturedProduct
[docs] def add_asManufacturedProduct(self, value): self.asManufacturedProduct.append(value)
[docs] def insert_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct.insert(index, value)
[docs] def replace_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def add_asContent(self, value): self.asContent.append(value)
[docs] def insert_asContent_at(self, index, value): self.asContent.insert(index, value)
[docs] def replace_asContent_at(self, index, value): self.asContent[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassContainer(self, value): # Validate type EntityClassContainer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT', 'HOLD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassContainer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassContainer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassContainer_patterns_, ))
validate_EntityClassContainer_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.formCode is not None or self.capacityQuantity is not None or self.capTypeCode is not None or self.asIdentifiedEntity or self.asManufacturedProduct or self.asContent or self.asSpecializedKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PackagedProduct', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.PackagedProduct') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.PackagedProduct', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.PackagedProduct'): if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PackagedProduct', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.capacityQuantity is not None: self.capacityQuantity.export(outfile, level, namespace_, name_='capacityQuantity', pretty_print=pretty_print) if self.capTypeCode is not None: self.capTypeCode.export(outfile, level, namespace_, name_='capTypeCode', pretty_print=pretty_print) for asIdentifiedEntity_ in self.asIdentifiedEntity: asIdentifiedEntity_.export(outfile, level, namespace_, name_='asIdentifiedEntity', pretty_print=pretty_print) for asManufacturedProduct_ in self.asManufacturedProduct: asManufacturedProduct_.export(outfile, level, namespace_, name_='asManufacturedProduct', pretty_print=pretty_print) for asContent_ in self.asContent: asContent_.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassContainer(self.classCode) # validate type EntityClassContainer value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'capacityQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.capacityQuantity = obj_ obj_.original_tagname_ = 'capacityQuantity' elif nodeName_ == 'capTypeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.capTypeCode = obj_ obj_.original_tagname_ = 'capTypeCode' elif nodeName_ == 'asIdentifiedEntity': obj_ = POCP_MT010100UV_IdentifiedEntity.factory() obj_.build(child_) self.asIdentifiedEntity.append(obj_) obj_.original_tagname_ = 'asIdentifiedEntity' elif nodeName_ == 'asManufacturedProduct': obj_ = POCP_MT010100UV_ManufacturedProduct2.factory() obj_.build(child_) self.asManufacturedProduct.append(obj_) obj_.original_tagname_ = 'asManufacturedProduct' elif nodeName_ == 'asContent': obj_ = POCP_MT010100UV_Content1.factory() obj_.build(child_) self.asContent.append(obj_) obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010100UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind'
# end class POCP_MT010100UV_PackagedProduct
[docs]class POCP_MT010100UV_Part(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, id=None, code=None, quantity=None, partProduct=None, subjectOf=None, deviceOf=None, consumedIn=None, productOf=None, indirectTargetOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.quantity = quantity self.partProduct = partProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if deviceOf is None: self.deviceOf = [] else: self.deviceOf = deviceOf if consumedIn is None: self.consumedIn = [] else: self.consumedIn = consumedIn if productOf is None: self.productOf = [] else: self.productOf = productOf if indirectTargetOf is None: self.indirectTargetOf = [] else: self.indirectTargetOf = indirectTargetOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Part) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Part.subclass: return POCP_MT010100UV_Part.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Part(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_partProduct(self): return self.partProduct
[docs] def set_partProduct(self, partProduct): self.partProduct = partProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_deviceOf(self): return self.deviceOf
[docs] def set_deviceOf(self, deviceOf): self.deviceOf = deviceOf
[docs] def add_deviceOf(self, value): self.deviceOf.append(value)
[docs] def insert_deviceOf_at(self, index, value): self.deviceOf.insert(index, value)
[docs] def replace_deviceOf_at(self, index, value): self.deviceOf[index] = value
[docs] def get_consumedIn(self): return self.consumedIn
[docs] def set_consumedIn(self, consumedIn): self.consumedIn = consumedIn
[docs] def add_consumedIn(self, value): self.consumedIn.append(value)
[docs] def insert_consumedIn_at(self, index, value): self.consumedIn.insert(index, value)
[docs] def replace_consumedIn_at(self, index, value): self.consumedIn[index] = value
[docs] def get_productOf(self): return self.productOf
[docs] def set_productOf(self, productOf): self.productOf = productOf
[docs] def add_productOf(self, value): self.productOf.append(value)
[docs] def insert_productOf_at(self, index, value): self.productOf.insert(index, value)
[docs] def replace_productOf_at(self, index, value): self.productOf[index] = value
[docs] def get_indirectTargetOf(self): return self.indirectTargetOf
[docs] def set_indirectTargetOf(self, indirectTargetOf): self.indirectTargetOf = indirectTargetOf
[docs] def add_indirectTargetOf(self, value): self.indirectTargetOf.append(value)
[docs] def insert_indirectTargetOf_at(self, index, value): self.indirectTargetOf.insert(index, value)
[docs] def replace_indirectTargetOf_at(self, index, value): self.indirectTargetOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.quantity is not None or self.partProduct is not None or self.subjectOf or self.deviceOf or self.consumedIn or self.productOf or self.indirectTargetOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Part', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Part') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Part', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Part'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Part', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.partProduct is not None: self.partProduct.export(outfile, level, namespace_, name_='partProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for deviceOf_ in self.deviceOf: deviceOf_.export(outfile, level, namespace_, name_='deviceOf', pretty_print=pretty_print) for consumedIn_ in self.consumedIn: consumedIn_.export(outfile, level, namespace_, name_='consumedIn', pretty_print=pretty_print) for productOf_ in self.productOf: productOf_.export(outfile, level, namespace_, name_='productOf', pretty_print=pretty_print) for indirectTargetOf_ in self.indirectTargetOf: indirectTargetOf_.export(outfile, level, namespace_, name_='indirectTargetOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'partProduct': obj_ = POCP_MT010100UV_Product.factory() obj_.build(child_) self.partProduct = obj_ obj_.original_tagname_ = 'partProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'deviceOf': obj_ = POCP_MT010100UV_Device.factory() obj_.build(child_) self.deviceOf.append(obj_) obj_.original_tagname_ = 'deviceOf' elif nodeName_ == 'consumedIn': obj_ = POCP_MT010100UV_Consumable1.factory() obj_.build(child_) self.consumedIn.append(obj_) obj_.original_tagname_ = 'consumedIn' elif nodeName_ == 'productOf': obj_ = POCP_MT010100UV_Product3.factory() obj_.build(child_) self.productOf.append(obj_) obj_.original_tagname_ = 'productOf' elif nodeName_ == 'indirectTargetOf': obj_ = POCP_MT010100UV_IndirectTarget.factory() obj_.build(child_) self.indirectTargetOf.append(obj_) obj_.original_tagname_ = 'indirectTargetOf'
# end class POCP_MT010100UV_Part
[docs]class POCP_MT010100UV_PartOfAssembly(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, code=None, wholeProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.wholeProduct = wholeProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_PartOfAssembly) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_PartOfAssembly.subclass: return POCP_MT010100UV_PartOfAssembly.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_PartOfAssembly(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_wholeProduct(self): return self.wholeProduct
[docs] def set_wholeProduct(self, wholeProduct): self.wholeProduct = wholeProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.wholeProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PartOfAssembly', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.PartOfAssembly') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.PartOfAssembly', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.PartOfAssembly'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PartOfAssembly', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.wholeProduct is not None: self.wholeProduct.export(outfile, level, namespace_, name_='wholeProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'wholeProduct': obj_ = POCP_MT010100UV_Product.factory() obj_.build(child_) self.wholeProduct = obj_ obj_.original_tagname_ = 'wholeProduct'
# end class POCP_MT010100UV_PartOfAssembly
[docs]class POCP_MT010100UV_PotentialSupply(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SPLY', moodCode='DEF', realmCode=None, typeId=None, templateId=None, id=None, title=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.title = title self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_PotentialSupply) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_PotentialSupply.subclass: return POCP_MT010100UV_PotentialSupply.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_PotentialSupply(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_title(self): return self.title
[docs] def set_title(self, title): self.title = title
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSupply(self, value): # Validate type ActClassSupply, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SPLY', 'DIET'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSupply' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSupply_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSupply_patterns_, ))
validate_ActClassSupply_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.title is not None or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PotentialSupply', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.PotentialSupply') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.PotentialSupply', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.PotentialSupply'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SPLY" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PotentialSupply', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.title is not None: self.title.export(outfile, level, namespace_, name_='title', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSupply(self.classCode) # validate type ActClassSupply value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'title': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.title = obj_ obj_.original_tagname_ = 'title' elif nodeName_ == 'author': obj_ = POCP_MT010100UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010100UV_PotentialSupply
[docs]class POCP_MT010100UV_PrimaryPerformer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PPRF', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_PrimaryPerformer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_PrimaryPerformer.subclass: return POCP_MT010100UV_PrimaryPerformer.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_PrimaryPerformer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPrimaryPerformer(self, value): # Validate type ParticipationPrimaryPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPrimaryPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPrimaryPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPrimaryPerformer_patterns_, ))
validate_ParticipationPrimaryPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PrimaryPerformer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.PrimaryPerformer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.PrimaryPerformer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.PrimaryPerformer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PPRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.PrimaryPerformer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPrimaryPerformer(self.typeCode) # validate type ParticipationPrimaryPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT010100UV_PrimaryPerformer
[docs]class POCP_MT010100UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MMAT', determinerCode='KIND', realmCode=None, typeId=None, templateId=None, code=None, name=None, desc=None, riskCode=None, handlingCode=None, formCode=None, expirationTime=None, asIdentifiedEntity=None, asNamedEntity=None, asManufacturedProduct=None, asSpecializedKind=None, asEntityWithGeneric=None, asEquivalentEntity=None, ingredient=None, asContent=None, asPartOfAssembly=None, part=None, instanceOfKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc if riskCode is None: self.riskCode = [] else: self.riskCode = riskCode if handlingCode is None: self.handlingCode = [] else: self.handlingCode = handlingCode self.formCode = formCode self.expirationTime = expirationTime if asIdentifiedEntity is None: self.asIdentifiedEntity = [] else: self.asIdentifiedEntity = asIdentifiedEntity if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if asManufacturedProduct is None: self.asManufacturedProduct = [] else: self.asManufacturedProduct = asManufacturedProduct if asSpecializedKind is None: self.asSpecializedKind = [] else: self.asSpecializedKind = asSpecializedKind self.asEntityWithGeneric = asEntityWithGeneric if asEquivalentEntity is None: self.asEquivalentEntity = [] else: self.asEquivalentEntity = asEquivalentEntity if ingredient is None: self.ingredient = [] else: self.ingredient = ingredient if asContent is None: self.asContent = [] else: self.asContent = asContent if asPartOfAssembly is None: self.asPartOfAssembly = [] else: self.asPartOfAssembly = asPartOfAssembly if part is None: self.part = [] else: self.part = part if instanceOfKind is None: self.instanceOfKind = [] else: self.instanceOfKind = instanceOfKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Product.subclass: return POCP_MT010100UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_riskCode(self): return self.riskCode
[docs] def set_riskCode(self, riskCode): self.riskCode = riskCode
[docs] def add_riskCode(self, value): self.riskCode.append(value)
[docs] def insert_riskCode_at(self, index, value): self.riskCode.insert(index, value)
[docs] def replace_riskCode_at(self, index, value): self.riskCode[index] = value
[docs] def get_handlingCode(self): return self.handlingCode
[docs] def set_handlingCode(self, handlingCode): self.handlingCode = handlingCode
[docs] def add_handlingCode(self, value): self.handlingCode.append(value)
[docs] def insert_handlingCode_at(self, index, value): self.handlingCode.insert(index, value)
[docs] def replace_handlingCode_at(self, index, value): self.handlingCode[index] = value
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_expirationTime(self): return self.expirationTime
[docs] def set_expirationTime(self, expirationTime): self.expirationTime = expirationTime
[docs] def get_asIdentifiedEntity(self): return self.asIdentifiedEntity
[docs] def set_asIdentifiedEntity(self, asIdentifiedEntity): self.asIdentifiedEntity = asIdentifiedEntity
[docs] def add_asIdentifiedEntity(self, value): self.asIdentifiedEntity.append(value)
[docs] def insert_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity.insert(index, value)
[docs] def replace_asIdentifiedEntity_at(self, index, value): self.asIdentifiedEntity[index] = value
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_asManufacturedProduct(self): return self.asManufacturedProduct
[docs] def set_asManufacturedProduct(self, asManufacturedProduct): self.asManufacturedProduct = asManufacturedProduct
[docs] def add_asManufacturedProduct(self, value): self.asManufacturedProduct.append(value)
[docs] def insert_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct.insert(index, value)
[docs] def replace_asManufacturedProduct_at(self, index, value): self.asManufacturedProduct[index] = value
[docs] def get_asSpecializedKind(self): return self.asSpecializedKind
[docs] def set_asSpecializedKind(self, asSpecializedKind): self.asSpecializedKind = asSpecializedKind
[docs] def add_asSpecializedKind(self, value): self.asSpecializedKind.append(value)
[docs] def insert_asSpecializedKind_at(self, index, value): self.asSpecializedKind.insert(index, value)
[docs] def replace_asSpecializedKind_at(self, index, value): self.asSpecializedKind[index] = value
[docs] def get_asEntityWithGeneric(self): return self.asEntityWithGeneric
[docs] def set_asEntityWithGeneric(self, asEntityWithGeneric): self.asEntityWithGeneric = asEntityWithGeneric
[docs] def get_asEquivalentEntity(self): return self.asEquivalentEntity
[docs] def set_asEquivalentEntity(self, asEquivalentEntity): self.asEquivalentEntity = asEquivalentEntity
[docs] def add_asEquivalentEntity(self, value): self.asEquivalentEntity.append(value)
[docs] def insert_asEquivalentEntity_at(self, index, value): self.asEquivalentEntity.insert(index, value)
[docs] def replace_asEquivalentEntity_at(self, index, value): self.asEquivalentEntity[index] = value
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def add_ingredient(self, value): self.ingredient.append(value)
[docs] def insert_ingredient_at(self, index, value): self.ingredient.insert(index, value)
[docs] def replace_ingredient_at(self, index, value): self.ingredient[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def add_asContent(self, value): self.asContent.append(value)
[docs] def insert_asContent_at(self, index, value): self.asContent.insert(index, value)
[docs] def replace_asContent_at(self, index, value): self.asContent[index] = value
[docs] def get_asPartOfAssembly(self): return self.asPartOfAssembly
[docs] def set_asPartOfAssembly(self, asPartOfAssembly): self.asPartOfAssembly = asPartOfAssembly
[docs] def add_asPartOfAssembly(self, value): self.asPartOfAssembly.append(value)
[docs] def insert_asPartOfAssembly_at(self, index, value): self.asPartOfAssembly.insert(index, value)
[docs] def replace_asPartOfAssembly_at(self, index, value): self.asPartOfAssembly[index] = value
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_instanceOfKind(self): return self.instanceOfKind
[docs] def set_instanceOfKind(self, instanceOfKind): self.instanceOfKind = instanceOfKind
[docs] def add_instanceOfKind(self, value): self.instanceOfKind.append(value)
[docs] def insert_instanceOfKind_at(self, index, value): self.instanceOfKind.insert(index, value)
[docs] def replace_instanceOfKind_at(self, index, value): self.instanceOfKind[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerDetermined(self, value): # Validate type EntityDeterminerDetermined, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['KIND', 'GROUPKIND'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerDetermined' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerDetermined_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerDetermined_patterns_, ))
validate_EntityDeterminerDetermined_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name or self.desc is not None or self.riskCode or self.handlingCode or self.formCode is not None or self.expirationTime is not None or self.asIdentifiedEntity or self.asNamedEntity or self.asManufacturedProduct or self.asSpecializedKind or self.asEntityWithGeneric is not None or self.asEquivalentEntity or self.ingredient or self.asContent or self.asPartOfAssembly or self.part or self.instanceOfKind ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "KIND" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) for riskCode_ in self.riskCode: riskCode_.export(outfile, level, namespace_, name_='riskCode', pretty_print=pretty_print) for handlingCode_ in self.handlingCode: handlingCode_.export(outfile, level, namespace_, name_='handlingCode', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.expirationTime is not None: self.expirationTime.export(outfile, level, namespace_, name_='expirationTime', pretty_print=pretty_print) for asIdentifiedEntity_ in self.asIdentifiedEntity: asIdentifiedEntity_.export(outfile, level, namespace_, name_='asIdentifiedEntity', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for asManufacturedProduct_ in self.asManufacturedProduct: asManufacturedProduct_.export(outfile, level, namespace_, name_='asManufacturedProduct', pretty_print=pretty_print) for asSpecializedKind_ in self.asSpecializedKind: asSpecializedKind_.export(outfile, level, namespace_, name_='asSpecializedKind', pretty_print=pretty_print) if self.asEntityWithGeneric is not None: self.asEntityWithGeneric.export(outfile, level, namespace_, name_='asEntityWithGeneric', pretty_print=pretty_print) for asEquivalentEntity_ in self.asEquivalentEntity: asEquivalentEntity_.export(outfile, level, namespace_, name_='asEquivalentEntity', pretty_print=pretty_print) for ingredient_ in self.ingredient: ingredient_.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) for asContent_ in self.asContent: asContent_.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) for asPartOfAssembly_ in self.asPartOfAssembly: asPartOfAssembly_.export(outfile, level, namespace_, name_='asPartOfAssembly', pretty_print=pretty_print) for part_ in self.part: part_.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) for instanceOfKind_ in self.instanceOfKind: instanceOfKind_.export(outfile, level, namespace_, name_='instanceOfKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerDetermined(self.determinerCode) # validate type EntityDeterminerDetermined
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'riskCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.riskCode.append(obj_) obj_.original_tagname_ = 'riskCode' elif nodeName_ == 'handlingCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.handlingCode.append(obj_) obj_.original_tagname_ = 'handlingCode' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'expirationTime': obj_ = IVL_TS.factory() obj_.build(child_) self.expirationTime = obj_ obj_.original_tagname_ = 'expirationTime' elif nodeName_ == 'asIdentifiedEntity': obj_ = POCP_MT010100UV_IdentifiedEntity.factory() obj_.build(child_) self.asIdentifiedEntity.append(obj_) obj_.original_tagname_ = 'asIdentifiedEntity' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT000100UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'asManufacturedProduct': obj_ = POCP_MT010100UV_ManufacturedProduct3.factory() obj_.build(child_) self.asManufacturedProduct.append(obj_) obj_.original_tagname_ = 'asManufacturedProduct' elif nodeName_ == 'asSpecializedKind': obj_ = POCP_MT010100UV_SpecializedKind.factory() obj_.build(child_) self.asSpecializedKind.append(obj_) obj_.original_tagname_ = 'asSpecializedKind' elif nodeName_ == 'asEntityWithGeneric': obj_ = POCP_MT010100UV_EntityWithGeneric.factory() obj_.build(child_) self.asEntityWithGeneric = obj_ obj_.original_tagname_ = 'asEntityWithGeneric' elif nodeName_ == 'asEquivalentEntity': obj_ = POCP_MT010100UV_EquivalentEntity.factory() obj_.build(child_) self.asEquivalentEntity.append(obj_) obj_.original_tagname_ = 'asEquivalentEntity' elif nodeName_ == 'ingredient': obj_ = POCP_MT010100UV_Ingredient.factory() obj_.build(child_) self.ingredient.append(obj_) obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'asContent': obj_ = POCP_MT010100UV_Content.factory() obj_.build(child_) self.asContent.append(obj_) obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asPartOfAssembly': obj_ = POCP_MT010100UV_PartOfAssembly.factory() obj_.build(child_) self.asPartOfAssembly.append(obj_) obj_.original_tagname_ = 'asPartOfAssembly' elif nodeName_ == 'part': obj_ = POCP_MT010100UV_Part.factory() obj_.build(child_) self.part.append(obj_) obj_.original_tagname_ = 'part' elif nodeName_ == 'instanceOfKind': obj_ = POCP_MT020100UV_InstanceOfKind1.factory() obj_.build(child_) self.instanceOfKind.append(obj_) obj_.original_tagname_ = 'instanceOfKind'
# end class POCP_MT010100UV_Product
[docs]class POCP_MT010100UV_Product2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, potentialSupply=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.potentialSupply = potentialSupply
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Product2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Product2.subclass: return POCP_MT010100UV_Product2.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Product2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_potentialSupply(self): return self.potentialSupply
[docs] def set_potentialSupply(self, potentialSupply): self.potentialSupply = potentialSupply
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.potentialSupply is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Product2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Product2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Product2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Product2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Product2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.potentialSupply is not None: self.potentialSupply.export(outfile, level, namespace_, name_='potentialSupply', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'potentialSupply': obj_ = POCP_MT010100UV_PotentialSupply.factory() obj_.build(child_) self.potentialSupply = obj_ obj_.original_tagname_ = 'potentialSupply'
# end class POCP_MT010100UV_Product2
[docs]class POCP_MT010100UV_Product3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, potentialSupply=None, reconstitution=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.potentialSupply = potentialSupply self.reconstitution = reconstitution self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Product3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Product3.subclass: return POCP_MT010100UV_Product3.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Product3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_potentialSupply(self): return self.potentialSupply
[docs] def set_potentialSupply(self, potentialSupply): self.potentialSupply = potentialSupply
[docs] def get_reconstitution(self): return self.reconstitution
[docs] def set_reconstitution(self, reconstitution): self.reconstitution = reconstitution
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.potentialSupply is not None or self.reconstitution is not None or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Product3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Product3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Product3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Product3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Product3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.potentialSupply is not None: self.potentialSupply.export(outfile, level, namespace_, name_='potentialSupply', pretty_print=pretty_print) if self.reconstitution is not None: self.reconstitution.export(outfile, level, namespace_, name_='reconstitution', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'potentialSupply': obj_ = POCP_MT010100UV_PotentialSupply.factory() obj_.build(child_) self.potentialSupply = obj_ obj_.original_tagname_ = 'potentialSupply' elif nodeName_ == 'reconstitution': obj_ = POCP_MT010100UV_Reconstitution.factory() obj_.build(child_) self.reconstitution = obj_ obj_.original_tagname_ = 'reconstitution' elif nodeName_ == 'actDefinition': obj_ = POCP_MT010100UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT010100UV_Product3
[docs]class POCP_MT010100UV_Reconstitution(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PROC', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, consumable=None, author=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code if consumable is None: self.consumable = [] else: self.consumable = consumable self.author = author
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Reconstitution) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Reconstitution.subclass: return POCP_MT010100UV_Reconstitution.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Reconstitution(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_consumable(self): return self.consumable
[docs] def set_consumable(self, consumable): self.consumable = consumable
[docs] def add_consumable(self, value): self.consumable.append(value)
[docs] def insert_consumable_at(self, index, value): self.consumable.insert(index, value)
[docs] def replace_consumable_at(self, index, value): self.consumable[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassProcedure(self, value): # Validate type ActClassProcedure, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassProcedure' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassProcedure_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassProcedure_patterns_, ))
validate_ActClassProcedure_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.consumable or self.author is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Reconstitution', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Reconstitution') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Reconstitution', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Reconstitution'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PROC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Reconstitution', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for consumable_ in self.consumable: consumable_.export(outfile, level, namespace_, name_='consumable', pretty_print=pretty_print) if self.author is not None: self.author.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassProcedure(self.classCode) # validate type ActClassProcedure value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'consumable': obj_ = POCP_MT010100UV_Consumable2.factory() obj_.build(child_) self.consumable.append(obj_) obj_.original_tagname_ = 'consumable' elif nodeName_ == 'author': obj_ = POCP_MT010100UV_Author.factory() obj_.build(child_) self.author = obj_ obj_.original_tagname_ = 'author'
# end class POCP_MT010100UV_Reconstitution
[docs]class POCP_MT010100UV_SpecializedKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='GEN', realmCode=None, typeId=None, templateId=None, code=None, generalizedMaterialKind=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.generalizedMaterialKind = generalizedMaterialKind if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_SpecializedKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_SpecializedKind.subclass: return POCP_MT010100UV_SpecializedKind.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_SpecializedKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_generalizedMaterialKind(self): return self.generalizedMaterialKind
[docs] def set_generalizedMaterialKind(self, generalizedMaterialKind): self.generalizedMaterialKind = generalizedMaterialKind
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIsSpeciesEntity(self, value): # Validate type RoleClassIsSpeciesEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['GEN', 'GRIC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIsSpeciesEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIsSpeciesEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIsSpeciesEntity_patterns_, ))
validate_RoleClassIsSpeciesEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.generalizedMaterialKind is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.SpecializedKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.SpecializedKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.SpecializedKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.SpecializedKind'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "GEN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.SpecializedKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.generalizedMaterialKind is not None: self.generalizedMaterialKind.export(outfile, level, namespace_, name_='generalizedMaterialKind', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIsSpeciesEntity(self.classCode) # validate type RoleClassIsSpeciesEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'generalizedMaterialKind': obj_ = POCP_MT010100UV_MaterialKind.factory() obj_.build(child_) self.generalizedMaterialKind = obj_ obj_.original_tagname_ = 'generalizedMaterialKind' elif nodeName_ == 'subjectOf': obj_ = POCP_MT010100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT010100UV_SpecializedKind
[docs]class POCP_MT010100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', negationInd='false', realmCode=None, typeId=None, templateId=None, document=None, characteristic=None, action=None, approval=None, policy=None, marketingAct=None, monitoringProgram=None, storage=None, observationGoal=None, substanceSpecification=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) self.negationInd = _cast(None, negationInd) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.document = document self.characteristic = characteristic self.action = action self.approval = approval self.policy = policy self.marketingAct = marketingAct self.monitoringProgram = monitoringProgram self.storage = storage self.observationGoal = observationGoal self.substanceSpecification = substanceSpecification
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_Subject.subclass: return POCP_MT010100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_document(self): return self.document
[docs] def set_document(self, document): self.document = document
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_action(self): return self.action
[docs] def set_action(self, action): self.action = action
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_policy(self): return self.policy
[docs] def set_policy(self, policy): self.policy = policy
[docs] def get_marketingAct(self): return self.marketingAct
[docs] def set_marketingAct(self, marketingAct): self.marketingAct = marketingAct
[docs] def get_monitoringProgram(self): return self.monitoringProgram
[docs] def set_monitoringProgram(self, monitoringProgram): self.monitoringProgram = monitoringProgram
[docs] def get_storage(self): return self.storage
[docs] def set_storage(self, storage): self.storage = storage
[docs] def get_observationGoal(self): return self.observationGoal
[docs] def set_observationGoal(self, observationGoal): self.observationGoal = observationGoal
[docs] def get_substanceSpecification(self): return self.substanceSpecification
[docs] def set_substanceSpecification(self, substanceSpecification): self.substanceSpecification = substanceSpecification
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def get_negationInd(self): return self.negationInd
[docs] def set_negationInd(self, negationInd): self.negationInd = negationInd
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.document is not None or self.characteristic is not None or self.action is not None or self.approval is not None or self.policy is not None or self.marketingAct is not None or self.monitoringProgram is not None or self.storage is not None or self.observationGoal is not None or self.substanceSpecification is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), )) if self.negationInd and 'negationInd' not in already_processed: already_processed.add('negationInd') outfile.write(' negationInd=%s' % (quote_attrib(self.negationInd), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.document is not None: self.document.export(outfile, level, namespace_, name_='document', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print) if self.action is not None: self.action.export(outfile, level, namespace_, name_='action', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print) if self.policy is not None: self.policy.export(outfile, level, namespace_, name_='policy', pretty_print=pretty_print) if self.marketingAct is not None: self.marketingAct.export(outfile, level, namespace_, name_='marketingAct', pretty_print=pretty_print) if self.monitoringProgram is not None: self.monitoringProgram.export(outfile, level, namespace_, name_='monitoringProgram', pretty_print=pretty_print) if self.storage is not None: self.storage.export(outfile, level, namespace_, name_='storage', pretty_print=pretty_print) if self.observationGoal is not None: self.observationGoal.export(outfile, level, namespace_, name_='observationGoal', pretty_print=pretty_print) if self.substanceSpecification is not None: self.substanceSpecification.export(outfile, level, namespace_, name_='substanceSpecification', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject value = find_attr_value_('negationInd', node) if value is not None and 'negationInd' not in already_processed: already_processed.add('negationInd') if value in ('true', '1'): self.negationInd = True elif value in ('false', '0'): self.negationInd = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.negationInd) # validate type bl
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'document': obj_ = POCP_MT050100UV_Document.factory() obj_.build(child_) self.document = obj_ obj_.original_tagname_ = 'document' elif nodeName_ == 'characteristic': obj_ = POCP_MT050100UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic' elif nodeName_ == 'action': obj_ = POCP_MT050100UV_Action.factory() obj_.build(child_) self.action = obj_ obj_.original_tagname_ = 'action' elif nodeName_ == 'approval': obj_ = POCP_MT050100UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval' elif nodeName_ == 'policy': obj_ = POCP_MT050100UV_Policy.factory() obj_.build(child_) self.policy = obj_ obj_.original_tagname_ = 'policy' elif nodeName_ == 'marketingAct': obj_ = POCP_MT050100UV_MarketingAct.factory() obj_.build(child_) self.marketingAct = obj_ obj_.original_tagname_ = 'marketingAct' elif nodeName_ == 'monitoringProgram': obj_ = POCP_MT050100UV_MonitoringProgram.factory() obj_.build(child_) self.monitoringProgram = obj_ obj_.original_tagname_ = 'monitoringProgram' elif nodeName_ == 'storage': obj_ = POCP_MT050100UV_Storage.factory() obj_.build(child_) self.storage = obj_ obj_.original_tagname_ = 'storage' elif nodeName_ == 'observationGoal': obj_ = POCP_MT050100UV_ObservationGoal.factory() obj_.build(child_) self.observationGoal = obj_ obj_.original_tagname_ = 'observationGoal' elif nodeName_ == 'substanceSpecification': obj_ = POCP_MT090100UV_SubstanceSpecification.factory() obj_.build(child_) self.substanceSpecification = obj_ obj_.original_tagname_ = 'substanceSpecification'
# end class POCP_MT010100UV_Subject
[docs]class POCP_MT010100UV_SubstanceAdministration(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SBADM', moodCode='DEF', realmCode=None, typeId=None, templateId=None, routeCode=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.routeCode = routeCode
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT010100UV_SubstanceAdministration) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT010100UV_SubstanceAdministration.subclass: return POCP_MT010100UV_SubstanceAdministration.subclass(*args_, **kwargs_) else: return POCP_MT010100UV_SubstanceAdministration(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_routeCode(self): return self.routeCode
[docs] def set_routeCode(self, routeCode): self.routeCode = routeCode
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassSubstanceAdministration(self, value): # Validate type ActClassSubstanceAdministration, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBADM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassSubstanceAdministration' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassSubstanceAdministration_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassSubstanceAdministration_patterns_, ))
validate_ActClassSubstanceAdministration_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.routeCode is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT010100UV.SubstanceAdministration', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT010100UV.SubstanceAdministration') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT010100UV.SubstanceAdministration', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT010100UV.SubstanceAdministration'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SBADM" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT010100UV.SubstanceAdministration', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.routeCode is not None: self.routeCode.export(outfile, level, namespace_, name_='routeCode', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassSubstanceAdministration(self.classCode) # validate type ActClassSubstanceAdministration value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'routeCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.routeCode = obj_ obj_.original_tagname_ = 'routeCode'
# end class POCP_MT010100UV_SubstanceAdministration
[docs]class POCP_MT020100UV_Container(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, code=None, desc=None, formCode=None, capacityQuantity=None, asContent=None, asInstanceOfKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.desc = desc self.formCode = formCode self.capacityQuantity = capacityQuantity self.asContent = asContent self.asInstanceOfKind = asInstanceOfKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Container) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Container.subclass: return POCP_MT020100UV_Container.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Container(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_capacityQuantity(self): return self.capacityQuantity
[docs] def set_capacityQuantity(self, capacityQuantity): self.capacityQuantity = capacityQuantity
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def get_asInstanceOfKind(self): return self.asInstanceOfKind
[docs] def set_asInstanceOfKind(self, asInstanceOfKind): self.asInstanceOfKind = asInstanceOfKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassContainer(self, value): # Validate type EntityClassContainer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT', 'HOLD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassContainer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassContainer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassContainer_patterns_, ))
validate_EntityClassContainer_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.desc is not None or self.formCode is not None or self.capacityQuantity is not None or self.asContent is not None or self.asInstanceOfKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Container', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Container') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Container', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Container'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Container', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.capacityQuantity is not None: self.capacityQuantity.export(outfile, level, namespace_, name_='capacityQuantity', pretty_print=pretty_print) if self.asContent is not None: self.asContent.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) if self.asInstanceOfKind is not None: self.asInstanceOfKind.export(outfile, level, namespace_, name_='asInstanceOfKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassContainer(self.classCode) # validate type EntityClassContainer value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'capacityQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.capacityQuantity = obj_ obj_.original_tagname_ = 'capacityQuantity' elif nodeName_ == 'asContent': obj_ = POCP_MT020100UV_Content3.factory() obj_.build(child_) self.asContent = obj_ obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asInstanceOfKind': obj_ = POCP_MT020100UV_InstanceOfKind2.factory() obj_.build(child_) self.asInstanceOfKind = obj_ obj_.original_tagname_ = 'asInstanceOfKind'
# end class POCP_MT020100UV_Container
[docs]class POCP_MT020100UV_Content2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, container=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.container = container if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Content2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Content2.subclass: return POCP_MT020100UV_Content2.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Content2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_container(self): return self.container
[docs] def set_container(self, container): self.container = container
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.container is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Content2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Content2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Content2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Content2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Content2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.container is not None: self.container.export(outfile, level, namespace_, name_='container', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'container': obj_ = POCP_MT020100UV_Container.factory() obj_.build(child_) self.container = obj_ obj_.original_tagname_ = 'container' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020100UV_Content2
[docs]class POCP_MT020100UV_Content3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, container=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.container = container if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Content3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Content3.subclass: return POCP_MT020100UV_Content3.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Content3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_container(self): return self.container
[docs] def set_container(self, container): self.container = container
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.container is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Content3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Content3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Content3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Content3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Content3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.container is not None: self.container.export(outfile, level, namespace_, name_='container', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'container': obj_ = POCP_MT020100UV_Container.factory() obj_.build(child_) self.container = obj_ obj_.original_tagname_ = 'container' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020100UV_Content3
[docs]class POCP_MT020100UV_DeviceInstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='DEV', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, quantity=None, desc=None, existenceTime=None, expirationTime=None, manufacturerModelName=None, softwareName=None, asIdentifiedItem=None, asContent=None, asMember=None, asInstanceOfKind=None, part=None, ingredient=None, member=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.quantity = quantity self.desc = desc self.existenceTime = existenceTime self.expirationTime = expirationTime self.manufacturerModelName = manufacturerModelName self.softwareName = softwareName if asIdentifiedItem is None: self.asIdentifiedItem = [] else: self.asIdentifiedItem = asIdentifiedItem self.asContent = asContent self.asMember = asMember self.asInstanceOfKind = asInstanceOfKind if part is None: self.part = [] else: self.part = part if ingredient is None: self.ingredient = [] else: self.ingredient = ingredient if member is None: self.member = [] else: self.member = member
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_DeviceInstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_DeviceInstance.subclass: return POCP_MT020100UV_DeviceInstance.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_DeviceInstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_existenceTime(self): return self.existenceTime
[docs] def set_existenceTime(self, existenceTime): self.existenceTime = existenceTime
[docs] def get_expirationTime(self): return self.expirationTime
[docs] def set_expirationTime(self, expirationTime): self.expirationTime = expirationTime
[docs] def get_manufacturerModelName(self): return self.manufacturerModelName
[docs] def set_manufacturerModelName(self, manufacturerModelName): self.manufacturerModelName = manufacturerModelName
[docs] def get_softwareName(self): return self.softwareName
[docs] def set_softwareName(self, softwareName): self.softwareName = softwareName
[docs] def get_asIdentifiedItem(self): return self.asIdentifiedItem
[docs] def set_asIdentifiedItem(self, asIdentifiedItem): self.asIdentifiedItem = asIdentifiedItem
[docs] def add_asIdentifiedItem(self, value): self.asIdentifiedItem.append(value)
[docs] def insert_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem.insert(index, value)
[docs] def replace_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def get_asMember(self): return self.asMember
[docs] def set_asMember(self, asMember): self.asMember = asMember
[docs] def get_asInstanceOfKind(self): return self.asInstanceOfKind
[docs] def set_asInstanceOfKind(self, asInstanceOfKind): self.asInstanceOfKind = asInstanceOfKind
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def add_ingredient(self, value): self.ingredient.append(value)
[docs] def insert_ingredient_at(self, index, value): self.ingredient.insert(index, value)
[docs] def replace_ingredient_at(self, index, value): self.ingredient[index] = value
[docs] def get_member(self): return self.member
[docs] def set_member(self, member): self.member = member
[docs] def add_member(self, value): self.member.append(value)
[docs] def insert_member_at(self, index, value): self.member.insert(index, value)
[docs] def replace_member_at(self, index, value): self.member[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassDevice(self, value): # Validate type EntityClassDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassDevice_patterns_, ))
validate_EntityClassDevice_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.quantity is not None or self.desc is not None or self.existenceTime is not None or self.expirationTime is not None or self.manufacturerModelName is not None or self.softwareName is not None or self.asIdentifiedItem or self.asContent is not None or self.asMember is not None or self.asInstanceOfKind is not None or self.part or self.ingredient or self.member ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.DeviceInstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.DeviceInstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.DeviceInstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.DeviceInstance'): if self.classCode != "DEV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.DeviceInstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.existenceTime is not None: self.existenceTime.export(outfile, level, namespace_, name_='existenceTime', pretty_print=pretty_print) if self.expirationTime is not None: self.expirationTime.export(outfile, level, namespace_, name_='expirationTime', pretty_print=pretty_print) if self.manufacturerModelName is not None: self.manufacturerModelName.export(outfile, level, namespace_, name_='manufacturerModelName', pretty_print=pretty_print) if self.softwareName is not None: self.softwareName.export(outfile, level, namespace_, name_='softwareName', pretty_print=pretty_print) for asIdentifiedItem_ in self.asIdentifiedItem: asIdentifiedItem_.export(outfile, level, namespace_, name_='asIdentifiedItem', pretty_print=pretty_print) if self.asContent is not None: self.asContent.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) if self.asMember is not None: self.asMember.export(outfile, level, namespace_, name_='asMember', pretty_print=pretty_print) if self.asInstanceOfKind is not None: self.asInstanceOfKind.export(outfile, level, namespace_, name_='asInstanceOfKind', pretty_print=pretty_print) for part_ in self.part: part_.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) for ingredient_ in self.ingredient: ingredient_.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) for member_ in self.member: member_.export(outfile, level, namespace_, name_='member', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassDevice(self.classCode) # validate type EntityClassDevice value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'existenceTime': obj_ = IVL_TS.factory() obj_.build(child_) self.existenceTime = obj_ obj_.original_tagname_ = 'existenceTime' elif nodeName_ == 'expirationTime': obj_ = IVL_TS.factory() obj_.build(child_) self.expirationTime = obj_ obj_.original_tagname_ = 'expirationTime' elif nodeName_ == 'manufacturerModelName': class_obj_ = self.get_class_obj_(child_, SC) obj_ = class_obj_.factory() obj_.build(child_) self.manufacturerModelName = obj_ obj_.original_tagname_ = 'manufacturerModelName' elif nodeName_ == 'softwareName': class_obj_ = self.get_class_obj_(child_, SC) obj_ = class_obj_.factory() obj_.build(child_) self.softwareName = obj_ obj_.original_tagname_ = 'softwareName' elif nodeName_ == 'asIdentifiedItem': obj_ = POCP_MT020100UV_IdentifiedItem.factory() obj_.build(child_) self.asIdentifiedItem.append(obj_) obj_.original_tagname_ = 'asIdentifiedItem' elif nodeName_ == 'asContent': obj_ = POCP_MT020100UV_Content2.factory() obj_.build(child_) self.asContent = obj_ obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asMember': obj_ = POCP_MT020100UV_Member.factory() obj_.build(child_) self.asMember = obj_ obj_.original_tagname_ = 'asMember' elif nodeName_ == 'asInstanceOfKind': obj_ = POCP_MT020100UV_InstanceOfKind2.factory() obj_.build(child_) self.asInstanceOfKind = obj_ obj_.original_tagname_ = 'asInstanceOfKind' elif nodeName_ == 'part': obj_ = POCP_MT020100UV_Part.factory() obj_.build(child_) self.part.append(obj_) obj_.original_tagname_ = 'part' elif nodeName_ == 'ingredient': obj_ = POCP_MT020100UV_Ingredient1.factory() obj_.build(child_) self.ingredient.append(obj_) obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'member': obj_ = POCP_MT020100UV_Member1.factory() obj_.build(child_) self.member.append(obj_) obj_.original_tagname_ = 'member'
# end class POCP_MT020100UV_DeviceInstance
[docs]class POCP_MT020100UV_IdentifiedItem(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, id=None, code=None, assigningProductIdentifierIssuer=None, assigningOrganization1=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.assigningProductIdentifierIssuer = assigningProductIdentifierIssuer self.assigningOrganization1 = assigningOrganization1
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_IdentifiedItem) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_IdentifiedItem.subclass: return POCP_MT020100UV_IdentifiedItem.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_IdentifiedItem(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_assigningProductIdentifierIssuer(self): return self.assigningProductIdentifierIssuer
[docs] def set_assigningProductIdentifierIssuer(self, assigningProductIdentifierIssuer): self.assigningProductIdentifierIssuer = assigningProductIdentifierIssuer
[docs] def get_assigningOrganization1(self): return self.assigningOrganization1
[docs] def set_assigningOrganization1(self, assigningOrganization1): self.assigningOrganization1 = assigningOrganization1
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.assigningProductIdentifierIssuer is not None or self.assigningOrganization1 is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.IdentifiedItem', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.IdentifiedItem') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.IdentifiedItem', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.IdentifiedItem'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.IdentifiedItem', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.assigningProductIdentifierIssuer is not None: self.assigningProductIdentifierIssuer.export(outfile, level, namespace_, name_='assigningProductIdentifierIssuer', pretty_print=pretty_print) if self.assigningOrganization1 is not None: self.assigningOrganization1.export(outfile, level, namespace_, name_='assigningOrganization1', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'assigningProductIdentifierIssuer': obj_ = POCP_MT020100UV_ProductIdentifierIssuer.factory() obj_.build(child_) self.assigningProductIdentifierIssuer = obj_ obj_.original_tagname_ = 'assigningProductIdentifierIssuer' elif nodeName_ == 'assigningOrganization1': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.assigningOrganization1 = obj_ obj_.original_tagname_ = 'assigningOrganization1'
# end class POCP_MT020100UV_IdentifiedItem
[docs]class POCP_MT020100UV_Ingredient1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='INGR', realmCode=None, typeId=None, templateId=None, quantity=None, ingredientProductInstance=None, ingredientDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.ingredientProductInstance = ingredientProductInstance self.ingredientDeviceInstance = ingredientDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Ingredient1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Ingredient1.subclass: return POCP_MT020100UV_Ingredient1.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Ingredient1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_ingredientProductInstance(self): return self.ingredientProductInstance
[docs] def set_ingredientProductInstance(self, ingredientProductInstance): self.ingredientProductInstance = ingredientProductInstance
[docs] def get_ingredientDeviceInstance(self): return self.ingredientDeviceInstance
[docs] def set_ingredientDeviceInstance(self, ingredientDeviceInstance): self.ingredientDeviceInstance = ingredientDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIngredientEntity(self, value): # Validate type RoleClassIngredientEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIngredientEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIngredientEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIngredientEntity_patterns_, ))
validate_RoleClassIngredientEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.ingredientProductInstance is not None or self.ingredientDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Ingredient1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Ingredient1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Ingredient1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Ingredient1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "INGR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Ingredient1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.ingredientProductInstance is not None: self.ingredientProductInstance.export(outfile, level, namespace_, name_='ingredientProductInstance', pretty_print=pretty_print) if self.ingredientDeviceInstance is not None: self.ingredientDeviceInstance.export(outfile, level, namespace_, name_='ingredientDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIngredientEntity(self.classCode) # validate type RoleClassIngredientEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'ingredientProductInstance': obj_ = POCP_MT020100UV_ProductInstance.factory() obj_.build(child_) self.ingredientProductInstance = obj_ obj_.original_tagname_ = 'ingredientProductInstance' elif nodeName_ == 'ingredientDeviceInstance': obj_ = POCP_MT020100UV_DeviceInstance.factory() obj_.build(child_) self.ingredientDeviceInstance = obj_ obj_.original_tagname_ = 'ingredientDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020100UV_Ingredient1
[docs]class POCP_MT020100UV_InstanceOfKind1(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='INST', realmCode=None, typeId=None, templateId=None, quantity=None, productInstance=None, deviceInstance=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.productInstance = productInstance self.deviceInstance = deviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_InstanceOfKind1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_InstanceOfKind1.subclass: return POCP_MT020100UV_InstanceOfKind1.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_InstanceOfKind1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_productInstance(self): return self.productInstance
[docs] def set_productInstance(self, productInstance): self.productInstance = productInstance
[docs] def get_deviceInstance(self): return self.deviceInstance
[docs] def set_deviceInstance(self, deviceInstance): self.deviceInstance = deviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassInstance(self, value): # Validate type RoleClassInstance, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INST'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassInstance' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassInstance_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassInstance_patterns_, ))
validate_RoleClassInstance_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.productInstance is not None or self.deviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.InstanceOfKind1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.InstanceOfKind1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.InstanceOfKind1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.InstanceOfKind1'): if self.classCode != "INST" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.InstanceOfKind1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.productInstance is not None: self.productInstance.export(outfile, level, namespace_, name_='productInstance', pretty_print=pretty_print) if self.deviceInstance is not None: self.deviceInstance.export(outfile, level, namespace_, name_='deviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassInstance(self.classCode) # validate type RoleClassInstance
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'productInstance': obj_ = POCP_MT020100UV_ProductInstance.factory() obj_.build(child_) self.productInstance = obj_ obj_.original_tagname_ = 'productInstance' elif nodeName_ == 'deviceInstance': obj_ = POCP_MT020100UV_DeviceInstance.factory() obj_.build(child_) self.deviceInstance = obj_ obj_.original_tagname_ = 'deviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020100UV_InstanceOfKind1
[docs]class POCP_MT020100UV_InstanceOfKind2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='INST', realmCode=None, typeId=None, templateId=None, kindOfMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.kindOfMaterialKind = kindOfMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_InstanceOfKind2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_InstanceOfKind2.subclass: return POCP_MT020100UV_InstanceOfKind2.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_InstanceOfKind2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_kindOfMaterialKind(self): return self.kindOfMaterialKind
[docs] def set_kindOfMaterialKind(self, kindOfMaterialKind): self.kindOfMaterialKind = kindOfMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassInstance(self, value): # Validate type RoleClassInstance, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INST'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassInstance' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassInstance_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassInstance_patterns_, ))
validate_RoleClassInstance_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.kindOfMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.InstanceOfKind2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.InstanceOfKind2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.InstanceOfKind2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.InstanceOfKind2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "INST" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.InstanceOfKind2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.kindOfMaterialKind is not None: self.kindOfMaterialKind.export(outfile, level, namespace_, name_='kindOfMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassInstance(self.classCode) # validate type RoleClassInstance
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'kindOfMaterialKind': obj_ = POCP_MT010400UV_MaterialKind.factory() obj_.build(child_) self.kindOfMaterialKind = obj_ obj_.original_tagname_ = 'kindOfMaterialKind'
# end class POCP_MT020100UV_InstanceOfKind2
[docs]class POCP_MT020100UV_Member(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MBR', realmCode=None, typeId=None, templateId=None, groupProductInstance=None, groupDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.groupProductInstance = groupProductInstance self.groupDeviceInstance = groupDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Member) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Member.subclass: return POCP_MT020100UV_Member.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Member(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_groupProductInstance(self): return self.groupProductInstance
[docs] def set_groupProductInstance(self, groupProductInstance): self.groupProductInstance = groupProductInstance
[docs] def get_groupDeviceInstance(self): return self.groupDeviceInstance
[docs] def set_groupDeviceInstance(self, groupDeviceInstance): self.groupDeviceInstance = groupDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassMember(self, value): # Validate type RoleClassMember, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MBR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassMember' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassMember_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassMember_patterns_, ))
validate_RoleClassMember_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.groupProductInstance is not None or self.groupDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Member', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Member') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Member', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Member'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MBR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Member', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.groupProductInstance is not None: self.groupProductInstance.export(outfile, level, namespace_, name_='groupProductInstance', pretty_print=pretty_print) if self.groupDeviceInstance is not None: self.groupDeviceInstance.export(outfile, level, namespace_, name_='groupDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassMember(self.classCode) # validate type RoleClassMember
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'groupProductInstance': obj_ = POCP_MT020100UV_ProductInstance.factory() obj_.build(child_) self.groupProductInstance = obj_ obj_.original_tagname_ = 'groupProductInstance' elif nodeName_ == 'groupDeviceInstance': obj_ = POCP_MT020100UV_DeviceInstance.factory() obj_.build(child_) self.groupDeviceInstance = obj_ obj_.original_tagname_ = 'groupDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020100UV_Member
[docs]class POCP_MT020100UV_Member1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MBR', realmCode=None, typeId=None, templateId=None, memberProductInstance=None, memberDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.memberProductInstance = memberProductInstance self.memberDeviceInstance = memberDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Member1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Member1.subclass: return POCP_MT020100UV_Member1.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Member1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_memberProductInstance(self): return self.memberProductInstance
[docs] def set_memberProductInstance(self, memberProductInstance): self.memberProductInstance = memberProductInstance
[docs] def get_memberDeviceInstance(self): return self.memberDeviceInstance
[docs] def set_memberDeviceInstance(self, memberDeviceInstance): self.memberDeviceInstance = memberDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassMember(self, value): # Validate type RoleClassMember, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MBR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassMember' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassMember_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassMember_patterns_, ))
validate_RoleClassMember_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.memberProductInstance is not None or self.memberDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Member1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Member1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Member1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Member1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MBR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Member1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.memberProductInstance is not None: self.memberProductInstance.export(outfile, level, namespace_, name_='memberProductInstance', pretty_print=pretty_print) if self.memberDeviceInstance is not None: self.memberDeviceInstance.export(outfile, level, namespace_, name_='memberDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassMember(self.classCode) # validate type RoleClassMember
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'memberProductInstance': obj_ = POCP_MT020100UV_ProductInstance.factory() obj_.build(child_) self.memberProductInstance = obj_ obj_.original_tagname_ = 'memberProductInstance' elif nodeName_ == 'memberDeviceInstance': obj_ = POCP_MT020100UV_DeviceInstance.factory() obj_.build(child_) self.memberDeviceInstance = obj_ obj_.original_tagname_ = 'memberDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020100UV_Member1
[docs]class POCP_MT020100UV_Part(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, partProductInstance=None, partDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.partProductInstance = partProductInstance self.partDeviceInstance = partDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Part) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Part.subclass: return POCP_MT020100UV_Part.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Part(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_partProductInstance(self): return self.partProductInstance
[docs] def set_partProductInstance(self, partProductInstance): self.partProductInstance = partProductInstance
[docs] def get_partDeviceInstance(self): return self.partDeviceInstance
[docs] def set_partDeviceInstance(self, partDeviceInstance): self.partDeviceInstance = partDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.partProductInstance is not None or self.partDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Part', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Part') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Part', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Part'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Part', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.partProductInstance is not None: self.partProductInstance.export(outfile, level, namespace_, name_='partProductInstance', pretty_print=pretty_print) if self.partDeviceInstance is not None: self.partDeviceInstance.export(outfile, level, namespace_, name_='partDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'partProductInstance': obj_ = POCP_MT020100UV_ProductInstance.factory() obj_.build(child_) self.partProductInstance = obj_ obj_.original_tagname_ = 'partProductInstance' elif nodeName_ == 'partDeviceInstance': obj_ = POCP_MT020100UV_DeviceInstance.factory() obj_.build(child_) self.partDeviceInstance = obj_ obj_.original_tagname_ = 'partDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020100UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020100UV_Part
[docs]class POCP_MT020100UV_ProductIdentifierIssuer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_ProductIdentifierIssuer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_ProductIdentifierIssuer.subclass: return POCP_MT020100UV_ProductIdentifierIssuer.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_ProductIdentifierIssuer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.ProductIdentifierIssuer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.ProductIdentifierIssuer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.ProductIdentifierIssuer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.ProductIdentifierIssuer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.ProductIdentifierIssuer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT020100UV_ProductIdentifierIssuer
[docs]class POCP_MT020100UV_ProductInstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='MMAT', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, quantity=None, desc=None, existenceTime=None, expirationTime=None, stabilityTime=None, asIdentifiedItem=None, asContent=None, asMember=None, asInstanceOfKind=None, part=None, ingredient=None, member=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.quantity = quantity self.desc = desc self.existenceTime = existenceTime self.expirationTime = expirationTime self.stabilityTime = stabilityTime if asIdentifiedItem is None: self.asIdentifiedItem = [] else: self.asIdentifiedItem = asIdentifiedItem self.asContent = asContent self.asMember = asMember self.asInstanceOfKind = asInstanceOfKind if part is None: self.part = [] else: self.part = part if ingredient is None: self.ingredient = [] else: self.ingredient = ingredient if member is None: self.member = [] else: self.member = member
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_ProductInstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_ProductInstance.subclass: return POCP_MT020100UV_ProductInstance.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_ProductInstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_existenceTime(self): return self.existenceTime
[docs] def set_existenceTime(self, existenceTime): self.existenceTime = existenceTime
[docs] def get_expirationTime(self): return self.expirationTime
[docs] def set_expirationTime(self, expirationTime): self.expirationTime = expirationTime
[docs] def get_stabilityTime(self): return self.stabilityTime
[docs] def set_stabilityTime(self, stabilityTime): self.stabilityTime = stabilityTime
[docs] def get_asIdentifiedItem(self): return self.asIdentifiedItem
[docs] def set_asIdentifiedItem(self, asIdentifiedItem): self.asIdentifiedItem = asIdentifiedItem
[docs] def add_asIdentifiedItem(self, value): self.asIdentifiedItem.append(value)
[docs] def insert_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem.insert(index, value)
[docs] def replace_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def get_asMember(self): return self.asMember
[docs] def set_asMember(self, asMember): self.asMember = asMember
[docs] def get_asInstanceOfKind(self): return self.asInstanceOfKind
[docs] def set_asInstanceOfKind(self, asInstanceOfKind): self.asInstanceOfKind = asInstanceOfKind
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def add_ingredient(self, value): self.ingredient.append(value)
[docs] def insert_ingredient_at(self, index, value): self.ingredient.insert(index, value)
[docs] def replace_ingredient_at(self, index, value): self.ingredient[index] = value
[docs] def get_member(self): return self.member
[docs] def set_member(self, member): self.member = member
[docs] def add_member(self, value): self.member.append(value)
[docs] def insert_member_at(self, index, value): self.member.insert(index, value)
[docs] def replace_member_at(self, index, value): self.member[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.quantity is not None or self.desc is not None or self.existenceTime is not None or self.expirationTime is not None or self.stabilityTime is not None or self.asIdentifiedItem or self.asContent is not None or self.asMember is not None or self.asInstanceOfKind is not None or self.part or self.ingredient or self.member ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.ProductInstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.ProductInstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.ProductInstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.ProductInstance'): if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.ProductInstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.existenceTime is not None: self.existenceTime.export(outfile, level, namespace_, name_='existenceTime', pretty_print=pretty_print) if self.expirationTime is not None: self.expirationTime.export(outfile, level, namespace_, name_='expirationTime', pretty_print=pretty_print) if self.stabilityTime is not None: self.stabilityTime.export(outfile, level, namespace_, name_='stabilityTime', pretty_print=pretty_print) for asIdentifiedItem_ in self.asIdentifiedItem: asIdentifiedItem_.export(outfile, level, namespace_, name_='asIdentifiedItem', pretty_print=pretty_print) if self.asContent is not None: self.asContent.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) if self.asMember is not None: self.asMember.export(outfile, level, namespace_, name_='asMember', pretty_print=pretty_print) if self.asInstanceOfKind is not None: self.asInstanceOfKind.export(outfile, level, namespace_, name_='asInstanceOfKind', pretty_print=pretty_print) for part_ in self.part: part_.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) for ingredient_ in self.ingredient: ingredient_.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) for member_ in self.member: member_.export(outfile, level, namespace_, name_='member', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'existenceTime': obj_ = IVL_TS.factory() obj_.build(child_) self.existenceTime = obj_ obj_.original_tagname_ = 'existenceTime' elif nodeName_ == 'expirationTime': obj_ = IVL_TS.factory() obj_.build(child_) self.expirationTime = obj_ obj_.original_tagname_ = 'expirationTime' elif nodeName_ == 'stabilityTime': obj_ = IVL_TS.factory() obj_.build(child_) self.stabilityTime = obj_ obj_.original_tagname_ = 'stabilityTime' elif nodeName_ == 'asIdentifiedItem': obj_ = POCP_MT020100UV_IdentifiedItem.factory() obj_.build(child_) self.asIdentifiedItem.append(obj_) obj_.original_tagname_ = 'asIdentifiedItem' elif nodeName_ == 'asContent': obj_ = POCP_MT020100UV_Content2.factory() obj_.build(child_) self.asContent = obj_ obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asMember': obj_ = POCP_MT020100UV_Member.factory() obj_.build(child_) self.asMember = obj_ obj_.original_tagname_ = 'asMember' elif nodeName_ == 'asInstanceOfKind': obj_ = POCP_MT020100UV_InstanceOfKind2.factory() obj_.build(child_) self.asInstanceOfKind = obj_ obj_.original_tagname_ = 'asInstanceOfKind' elif nodeName_ == 'part': obj_ = POCP_MT020100UV_Part.factory() obj_.build(child_) self.part.append(obj_) obj_.original_tagname_ = 'part' elif nodeName_ == 'ingredient': obj_ = POCP_MT020100UV_Ingredient1.factory() obj_.build(child_) self.ingredient.append(obj_) obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'member': obj_ = POCP_MT020100UV_Member1.factory() obj_.build(child_) self.member.append(obj_) obj_.original_tagname_ = 'member'
# end class POCP_MT020100UV_ProductInstance
[docs]class POCP_MT020100UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, quantity=None, productEvent=None, observationEvent=None, transportationEvent=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.productEvent = productEvent self.observationEvent = observationEvent self.transportationEvent = transportationEvent
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020100UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020100UV_Subject.subclass: return POCP_MT020100UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT020100UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_productEvent(self): return self.productEvent
[docs] def set_productEvent(self, productEvent): self.productEvent = productEvent
[docs] def get_observationEvent(self): return self.observationEvent
[docs] def set_observationEvent(self, observationEvent): self.observationEvent = observationEvent
[docs] def get_transportationEvent(self): return self.transportationEvent
[docs] def set_transportationEvent(self, transportationEvent): self.transportationEvent = transportationEvent
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.productEvent is not None or self.observationEvent is not None or self.transportationEvent is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020100UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020100UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020100UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020100UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.productEvent is not None: self.productEvent.export(outfile, level, namespace_, name_='productEvent', pretty_print=pretty_print) if self.observationEvent is not None: self.observationEvent.export(outfile, level, namespace_, name_='observationEvent', pretty_print=pretty_print) if self.transportationEvent is not None: self.transportationEvent.export(outfile, level, namespace_, name_='transportationEvent', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'productEvent': obj_ = POCP_MT040100UV_ProductEvent.factory() obj_.build(child_) self.productEvent = obj_ obj_.original_tagname_ = 'productEvent' elif nodeName_ == 'observationEvent': obj_ = POCP_MT040100UV_ObservationEvent.factory() obj_.build(child_) self.observationEvent = obj_ obj_.original_tagname_ = 'observationEvent' elif nodeName_ == 'transportationEvent': obj_ = POCP_MT040100UV_TransportationEvent.factory() obj_.build(child_) self.transportationEvent = obj_ obj_.original_tagname_ = 'transportationEvent'
# end class POCP_MT020100UV_Subject
[docs]class POCP_MT040100UV_Author(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='AUT', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_Author) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_Author.subclass: return POCP_MT040100UV_Author.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_Author(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationAuthorOriginator(self, value): # Validate type ParticipationAuthorOriginator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['AUT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationAuthorOriginator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationAuthorOriginator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationAuthorOriginator_patterns_, ))
validate_ParticipationAuthorOriginator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Author', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.Author') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.Author', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.Author'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "AUT" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Author', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationAuthorOriginator(self.typeCode) # validate type ParticipationAuthorOriginator
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT040100UV_Author
[docs]class POCP_MT040100UV_Component(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='COMP', realmCode=None, typeId=None, templateId=None, productEvent=None, observationEvent=None, transportationEvent=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.productEvent = productEvent self.observationEvent = observationEvent self.transportationEvent = transportationEvent
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_Component) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_Component.subclass: return POCP_MT040100UV_Component.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_Component(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_productEvent(self): return self.productEvent
[docs] def set_productEvent(self, productEvent): self.productEvent = productEvent
[docs] def get_observationEvent(self): return self.observationEvent
[docs] def set_observationEvent(self, observationEvent): self.observationEvent = observationEvent
[docs] def get_transportationEvent(self): return self.transportationEvent
[docs] def set_transportationEvent(self, transportationEvent): self.transportationEvent = transportationEvent
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasComponent(self, value): # Validate type ActRelationshipHasComponent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['COMP', 'CTRLV', 'MBR', 'STEP', 'ARR', 'DEP', 'PART'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasComponent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasComponent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasComponent_patterns_, ))
validate_ActRelationshipHasComponent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.productEvent is not None or self.observationEvent is not None or self.transportationEvent is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Component', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.Component') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.Component', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.Component'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "COMP" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Component', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.productEvent is not None: self.productEvent.export(outfile, level, namespace_, name_='productEvent', pretty_print=pretty_print) if self.observationEvent is not None: self.observationEvent.export(outfile, level, namespace_, name_='observationEvent', pretty_print=pretty_print) if self.transportationEvent is not None: self.transportationEvent.export(outfile, level, namespace_, name_='transportationEvent', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasComponent(self.typeCode) # validate type ActRelationshipHasComponent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'productEvent': obj_ = POCP_MT040100UV_ProductEvent.factory() obj_.build(child_) self.productEvent = obj_ obj_.original_tagname_ = 'productEvent' elif nodeName_ == 'observationEvent': obj_ = POCP_MT040100UV_ObservationEvent.factory() obj_.build(child_) self.observationEvent = obj_ obj_.original_tagname_ = 'observationEvent' elif nodeName_ == 'transportationEvent': obj_ = POCP_MT040100UV_TransportationEvent.factory() obj_.build(child_) self.transportationEvent = obj_ obj_.original_tagname_ = 'transportationEvent'
# end class POCP_MT040100UV_Component
[docs]class POCP_MT040100UV_Destination(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='DST', realmCode=None, typeId=None, templateId=None, serviceDeliveryLocation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.serviceDeliveryLocation = serviceDeliveryLocation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_Destination) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_Destination.subclass: return POCP_MT040100UV_Destination.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_Destination(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_serviceDeliveryLocation(self): return self.serviceDeliveryLocation
[docs] def set_serviceDeliveryLocation(self, serviceDeliveryLocation): self.serviceDeliveryLocation = serviceDeliveryLocation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationDestination(self, value): # Validate type ParticipationDestination, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DST'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationDestination' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationDestination_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationDestination_patterns_, ))
validate_ParticipationDestination_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.serviceDeliveryLocation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Destination', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.Destination') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.Destination', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.Destination'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "DST" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Destination', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.serviceDeliveryLocation is not None: self.serviceDeliveryLocation.export(outfile, level, namespace_, name_='serviceDeliveryLocation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationDestination(self.typeCode) # validate type ParticipationDestination
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'serviceDeliveryLocation': obj_ = COCT_MT240003UV02_ServiceDeliveryLocation.factory() obj_.build(child_) self.serviceDeliveryLocation = obj_ obj_.original_tagname_ = 'serviceDeliveryLocation'
# end class POCP_MT040100UV_Destination
[docs]class POCP_MT040100UV_ObservationEvent(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='OBS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, value=None, performer=None, author=None, sequel=None, componentOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime self.value = value if performer is None: self.performer = [] else: self.performer = performer if author is None: self.author = [] else: self.author = author if sequel is None: self.sequel = [] else: self.sequel = sequel if componentOf is None: self.componentOf = [] else: self.componentOf = componentOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_ObservationEvent) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_ObservationEvent.subclass: return POCP_MT040100UV_ObservationEvent.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_ObservationEvent(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_performer(self): return self.performer
[docs] def set_performer(self, performer): self.performer = performer
[docs] def add_performer(self, value): self.performer.append(value)
[docs] def insert_performer_at(self, index, value): self.performer.insert(index, value)
[docs] def replace_performer_at(self, index, value): self.performer[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_sequel(self): return self.sequel
[docs] def set_sequel(self, sequel): self.sequel = sequel
[docs] def add_sequel(self, value): self.sequel.append(value)
[docs] def insert_sequel_at(self, index, value): self.sequel.insert(index, value)
[docs] def replace_sequel_at(self, index, value): self.sequel[index] = value
[docs] def get_componentOf(self): return self.componentOf
[docs] def set_componentOf(self, componentOf): self.componentOf = componentOf
[docs] def add_componentOf(self, value): self.componentOf.append(value)
[docs] def insert_componentOf_at(self, index, value): self.componentOf.insert(index, value)
[docs] def replace_componentOf_at(self, index, value): self.componentOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassObservation(self, value): # Validate type ActClassObservation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassObservation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassObservation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassObservation_patterns_, ))
validate_ActClassObservation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.text is not None or self.effectiveTime is not None or self.value is not None or self.performer or self.author or self.sequel or self.componentOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.ObservationEvent', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.ObservationEvent') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.ObservationEvent', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.ObservationEvent'): if self.classCode != "OBS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.ObservationEvent', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) if self.value is not None: self.value.export(outfile, level, namespace_, name_='value', pretty_print=pretty_print) for performer_ in self.performer: performer_.export(outfile, level, namespace_, name_='performer', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for sequel_ in self.sequel: sequel_.export(outfile, level, namespace_, name_='sequel', pretty_print=pretty_print) for componentOf_ in self.componentOf: componentOf_.export(outfile, level, namespace_, name_='componentOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassObservation(self.classCode) # validate type ActClassObservation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'value': type_name_ = child_.attrib.get( '{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <value> element') self.value = obj_ obj_.original_tagname_ = 'value' elif nodeName_ == 'performer': obj_ = POCP_MT040100UV_Performer.factory() obj_.build(child_) self.performer.append(obj_) obj_.original_tagname_ = 'performer' elif nodeName_ == 'author': obj_ = POCP_MT040100UV_Author.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'sequel': obj_ = POCP_MT040100UV_SequelTo.factory() obj_.build(child_) self.sequel.append(obj_) obj_.original_tagname_ = 'sequel' elif nodeName_ == 'componentOf': obj_ = POCP_MT040100UV_Component.factory() obj_.build(child_) self.componentOf.append(obj_) obj_.original_tagname_ = 'componentOf'
# end class POCP_MT040100UV_ObservationEvent
[docs]class POCP_MT040100UV_Origin(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='ORG', realmCode=None, typeId=None, templateId=None, serviceDeliveryLocation=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.serviceDeliveryLocation = serviceDeliveryLocation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_Origin) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_Origin.subclass: return POCP_MT040100UV_Origin.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_Origin(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_serviceDeliveryLocation(self): return self.serviceDeliveryLocation
[docs] def set_serviceDeliveryLocation(self, serviceDeliveryLocation): self.serviceDeliveryLocation = serviceDeliveryLocation
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationOrigin(self, value): # Validate type ParticipationOrigin, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationOrigin' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationOrigin_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationOrigin_patterns_, ))
validate_ParticipationOrigin_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.serviceDeliveryLocation is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Origin', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.Origin') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.Origin', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.Origin'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "ORG" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Origin', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.serviceDeliveryLocation is not None: self.serviceDeliveryLocation.export(outfile, level, namespace_, name_='serviceDeliveryLocation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationOrigin(self.typeCode) # validate type ParticipationOrigin
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'serviceDeliveryLocation': obj_ = COCT_MT240003UV02_ServiceDeliveryLocation.factory() obj_.build(child_) self.serviceDeliveryLocation = obj_ obj_.original_tagname_ = 'serviceDeliveryLocation'
# end class POCP_MT040100UV_Origin
[docs]class POCP_MT040100UV_Performer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRF', realmCode=None, typeId=None, templateId=None, assignedEntity=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.assignedEntity = assignedEntity
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_Performer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_Performer.subclass: return POCP_MT040100UV_Performer.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_Performer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_assignedEntity(self): return self.assignedEntity
[docs] def set_assignedEntity(self, assignedEntity): self.assignedEntity = assignedEntity
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPhysicalPerformer(self, value): # Validate type ParticipationPhysicalPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRF', 'DIST', 'PPRF', 'SPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPhysicalPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPhysicalPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPhysicalPerformer_patterns_, ))
validate_ParticipationPhysicalPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.assignedEntity is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Performer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.Performer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.Performer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.Performer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.Performer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.assignedEntity is not None: self.assignedEntity.export(outfile, level, namespace_, name_='assignedEntity', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPhysicalPerformer(self.typeCode) # validate type ParticipationPhysicalPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'assignedEntity': obj_ = POCP_MT030100UV_AssignedEntity2.factory() obj_.build(child_) self.assignedEntity = obj_ obj_.original_tagname_ = 'assignedEntity'
# end class POCP_MT040100UV_Performer
[docs]class POCP_MT040100UV_ProductEvent(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ACT', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, performer=None, author=None, sequel=None, componentOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime if performer is None: self.performer = [] else: self.performer = performer if author is None: self.author = [] else: self.author = author if sequel is None: self.sequel = [] else: self.sequel = sequel if componentOf is None: self.componentOf = [] else: self.componentOf = componentOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_ProductEvent) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_ProductEvent.subclass: return POCP_MT040100UV_ProductEvent.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_ProductEvent(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_performer(self): return self.performer
[docs] def set_performer(self, performer): self.performer = performer
[docs] def add_performer(self, value): self.performer.append(value)
[docs] def insert_performer_at(self, index, value): self.performer.insert(index, value)
[docs] def replace_performer_at(self, index, value): self.performer[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_sequel(self): return self.sequel
[docs] def set_sequel(self, sequel): self.sequel = sequel
[docs] def add_sequel(self, value): self.sequel.append(value)
[docs] def insert_sequel_at(self, index, value): self.sequel.insert(index, value)
[docs] def replace_sequel_at(self, index, value): self.sequel[index] = value
[docs] def get_componentOf(self): return self.componentOf
[docs] def set_componentOf(self, componentOf): self.componentOf = componentOf
[docs] def add_componentOf(self, value): self.componentOf.append(value)
[docs] def insert_componentOf_at(self, index, value): self.componentOf.insert(index, value)
[docs] def replace_componentOf_at(self, index, value): self.componentOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.text is not None or self.effectiveTime is not None or self.performer or self.author or self.sequel or self.componentOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.ProductEvent', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.ProductEvent') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.ProductEvent', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.ProductEvent'): if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.ProductEvent', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for performer_ in self.performer: performer_.export(outfile, level, namespace_, name_='performer', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) for sequel_ in self.sequel: sequel_.export(outfile, level, namespace_, name_='sequel', pretty_print=pretty_print) for componentOf_ in self.componentOf: componentOf_.export(outfile, level, namespace_, name_='componentOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CV) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': class_obj_ = self.get_class_obj_(child_, ST) obj_ = class_obj_.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'performer': obj_ = POCP_MT040100UV_Performer.factory() obj_.build(child_) self.performer.append(obj_) obj_.original_tagname_ = 'performer' elif nodeName_ == 'author': obj_ = POCP_MT040100UV_Author.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'sequel': obj_ = POCP_MT040100UV_SequelTo.factory() obj_.build(child_) self.sequel.append(obj_) obj_.original_tagname_ = 'sequel' elif nodeName_ == 'componentOf': obj_ = POCP_MT040100UV_Component.factory() obj_.build(child_) self.componentOf.append(obj_) obj_.original_tagname_ = 'componentOf'
# end class POCP_MT040100UV_ProductEvent
[docs]class POCP_MT040100UV_SequelTo(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SEQL', realmCode=None, typeId=None, templateId=None, productEvent=None, observationEvent=None, transportationEvent=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.productEvent = productEvent self.observationEvent = observationEvent self.transportationEvent = transportationEvent
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_SequelTo) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_SequelTo.subclass: return POCP_MT040100UV_SequelTo.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_SequelTo(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_productEvent(self): return self.productEvent
[docs] def set_productEvent(self, productEvent): self.productEvent = productEvent
[docs] def get_observationEvent(self): return self.observationEvent
[docs] def set_observationEvent(self, observationEvent): self.observationEvent = observationEvent
[docs] def get_transportationEvent(self): return self.transportationEvent
[docs] def set_transportationEvent(self, transportationEvent): self.transportationEvent = transportationEvent
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipSequel(self, value): # Validate type ActRelationshipSequel, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SEQL', 'APND', 'BSLN', 'COMPLY', 'DOC', 'FLFS', 'OCCR', 'OREF', 'SCH', 'GEN', 'GEVL', 'INST', 'MOD', 'MTCH', 'OPTN', 'RCHAL', 'REV', 'RPLC', 'SUCC', 'UPDT', 'XCRPT', 'VRXCRPT', 'XFRM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipSequel' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipSequel_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipSequel_patterns_, ))
validate_ActRelationshipSequel_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.productEvent is not None or self.observationEvent is not None or self.transportationEvent is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.SequelTo', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.SequelTo') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.SequelTo', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.SequelTo'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SEQL" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.SequelTo', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.productEvent is not None: self.productEvent.export(outfile, level, namespace_, name_='productEvent', pretty_print=pretty_print) if self.observationEvent is not None: self.observationEvent.export(outfile, level, namespace_, name_='observationEvent', pretty_print=pretty_print) if self.transportationEvent is not None: self.transportationEvent.export(outfile, level, namespace_, name_='transportationEvent', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipSequel(self.typeCode) # validate type ActRelationshipSequel
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'productEvent': obj_ = POCP_MT040100UV_ProductEvent.factory() obj_.build(child_) self.productEvent = obj_ obj_.original_tagname_ = 'productEvent' elif nodeName_ == 'observationEvent': obj_ = POCP_MT040100UV_ObservationEvent.factory() obj_.build(child_) self.observationEvent = obj_ obj_.original_tagname_ = 'observationEvent' elif nodeName_ == 'transportationEvent': obj_ = POCP_MT040100UV_TransportationEvent.factory() obj_.build(child_) self.transportationEvent = obj_ obj_.original_tagname_ = 'transportationEvent'
# end class POCP_MT040100UV_SequelTo
[docs]class POCP_MT040100UV_TransportationEvent(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='TRNS', moodCode='EVN', realmCode=None, typeId=None, templateId=None, id=None, code=None, text=None, effectiveTime=None, performer=None, author=None, origin=None, destination=None, sequel=None, componentOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.text = text self.effectiveTime = effectiveTime if performer is None: self.performer = [] else: self.performer = performer if author is None: self.author = [] else: self.author = author self.origin = origin if destination is None: self.destination = [] else: self.destination = destination if sequel is None: self.sequel = [] else: self.sequel = sequel if componentOf is None: self.componentOf = [] else: self.componentOf = componentOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT040100UV_TransportationEvent) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT040100UV_TransportationEvent.subclass: return POCP_MT040100UV_TransportationEvent.subclass(*args_, **kwargs_) else: return POCP_MT040100UV_TransportationEvent(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_performer(self): return self.performer
[docs] def set_performer(self, performer): self.performer = performer
[docs] def add_performer(self, value): self.performer.append(value)
[docs] def insert_performer_at(self, index, value): self.performer.insert(index, value)
[docs] def replace_performer_at(self, index, value): self.performer[index] = value
[docs] def get_author(self): return self.author
[docs] def set_author(self, author): self.author = author
[docs] def add_author(self, value): self.author.append(value)
[docs] def insert_author_at(self, index, value): self.author.insert(index, value)
[docs] def replace_author_at(self, index, value): self.author[index] = value
[docs] def get_origin(self): return self.origin
[docs] def set_origin(self, origin): self.origin = origin
[docs] def get_destination(self): return self.destination
[docs] def set_destination(self, destination): self.destination = destination
[docs] def add_destination(self, value): self.destination.append(value)
[docs] def insert_destination_at(self, index, value): self.destination.insert(index, value)
[docs] def replace_destination_at(self, index, value): self.destination[index] = value
[docs] def get_sequel(self): return self.sequel
[docs] def set_sequel(self, sequel): self.sequel = sequel
[docs] def add_sequel(self, value): self.sequel.append(value)
[docs] def insert_sequel_at(self, index, value): self.sequel.insert(index, value)
[docs] def replace_sequel_at(self, index, value): self.sequel[index] = value
[docs] def get_componentOf(self): return self.componentOf
[docs] def set_componentOf(self, componentOf): self.componentOf = componentOf
[docs] def add_componentOf(self, value): self.componentOf.append(value)
[docs] def insert_componentOf_at(self, index, value): self.componentOf.insert(index, value)
[docs] def replace_componentOf_at(self, index, value): self.componentOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_ActClassTransportation(self, value): # Validate type ActClassTransportation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['TRNS'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassTransportation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassTransportation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassTransportation_patterns_, ))
validate_ActClassTransportation_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodEventOccurrence(self, value): # Validate type ActMoodEventOccurrence, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['EVN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodEventOccurrence' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodEventOccurrence_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodEventOccurrence_patterns_, ))
validate_ActMoodEventOccurrence_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.text is not None or self.effectiveTime is not None or self.performer or self.author or self.origin is not None or self.destination or self.sequel or self.componentOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT040100UV.TransportationEvent', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT040100UV.TransportationEvent') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT040100UV.TransportationEvent', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT040100UV.TransportationEvent'): if self.classCode != "TRNS" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "EVN" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT040100UV.TransportationEvent', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for performer_ in self.performer: performer_.export(outfile, level, namespace_, name_='performer', pretty_print=pretty_print) for author_ in self.author: author_.export(outfile, level, namespace_, name_='author', pretty_print=pretty_print) if self.origin is not None: self.origin.export(outfile, level, namespace_, name_='origin', pretty_print=pretty_print) for destination_ in self.destination: destination_.export(outfile, level, namespace_, name_='destination', pretty_print=pretty_print) for sequel_ in self.sequel: sequel_.export(outfile, level, namespace_, name_='sequel', pretty_print=pretty_print) for componentOf_ in self.componentOf: componentOf_.export(outfile, level, namespace_, name_='componentOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassTransportation(self.classCode) # validate type ActClassTransportation value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodEventOccurrence(self.moodCode) # validate type ActMoodEventOccurrence
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'performer': obj_ = POCP_MT040100UV_Performer.factory() obj_.build(child_) self.performer.append(obj_) obj_.original_tagname_ = 'performer' elif nodeName_ == 'author': obj_ = POCP_MT040100UV_Author.factory() obj_.build(child_) self.author.append(obj_) obj_.original_tagname_ = 'author' elif nodeName_ == 'origin': obj_ = POCP_MT040100UV_Origin.factory() obj_.build(child_) self.origin = obj_ obj_.original_tagname_ = 'origin' elif nodeName_ == 'destination': obj_ = POCP_MT040100UV_Destination.factory() obj_.build(child_) self.destination.append(obj_) obj_.original_tagname_ = 'destination' elif nodeName_ == 'sequel': obj_ = POCP_MT040100UV_SequelTo.factory() obj_.build(child_) self.sequel.append(obj_) obj_.original_tagname_ = 'sequel' elif nodeName_ == 'componentOf': obj_ = POCP_MT040100UV_Component.factory() obj_.build(child_) self.componentOf.append(obj_) obj_.original_tagname_ = 'componentOf'
# end class POCP_MT040100UV_TransportationEvent
[docs]class COCT_MT240003UV02_ServiceDeliveryLocation(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, addr=None, telecom=None, location=None, serviceProviderOrganization=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if addr is None: self.addr = [] else: self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.location = location self.serviceProviderOrganization = serviceProviderOrganization
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT240003UV02_ServiceDeliveryLocation) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT240003UV02_ServiceDeliveryLocation.subclass: return COCT_MT240003UV02_ServiceDeliveryLocation.subclass(*args_, **kwargs_) else: return COCT_MT240003UV02_ServiceDeliveryLocation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def add_addr(self, value): self.addr.append(value)
[docs] def insert_addr_at(self, index, value): self.addr.insert(index, value)
[docs] def replace_addr_at(self, index, value): self.addr[index] = value
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_location(self): return self.location
[docs] def set_location(self, location): self.location = location
[docs] def get_serviceProviderOrganization(self): return self.serviceProviderOrganization
[docs] def set_serviceProviderOrganization(self, serviceProviderOrganization): self.serviceProviderOrganization = serviceProviderOrganization
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassServiceDeliveryLocation(self, value): # Validate type RoleClassServiceDeliveryLocation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SDLOC', 'DSDLOC', 'ISDLOC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassServiceDeliveryLocation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassServiceDeliveryLocation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassServiceDeliveryLocation_patterns_, ))
validate_RoleClassServiceDeliveryLocation_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.addr or self.telecom or self.location is not None or self.serviceProviderOrganization is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT240003UV02.ServiceDeliveryLocation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT240003UV02.ServiceDeliveryLocation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT240003UV02.ServiceDeliveryLocation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT240003UV02.ServiceDeliveryLocation'): if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT240003UV02.ServiceDeliveryLocation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for addr_ in self.addr: addr_.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.location is not None: self.location.export(outfile, level, namespace_, name_='location', pretty_print=pretty_print) if self.serviceProviderOrganization is not None: self.serviceProviderOrganization.export(outfile, level, namespace_, name_='serviceProviderOrganization', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassServiceDeliveryLocation(self.classCode) # validate type RoleClassServiceDeliveryLocation
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr.append(obj_) obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'location': obj_ = COCT_MT710000UV07_Place.factory() obj_.build(child_) self.location = obj_ obj_.original_tagname_ = 'location' elif nodeName_ == 'serviceProviderOrganization': obj_ = COCT_MT150003UV03_Organization.factory() obj_.build(child_) self.serviceProviderOrganization = obj_ obj_.original_tagname_ = 'serviceProviderOrganization'
# end class COCT_MT240003UV02_ServiceDeliveryLocation
[docs]class COCT_MT710000UV07_LocatedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, realmCode=None, typeId=None, templateId=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT710000UV07_LocatedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT710000UV07_LocatedEntity.subclass: return COCT_MT710000UV07_LocatedEntity.subclass(*args_, **kwargs_) else: return COCT_MT710000UV07_LocatedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassLocatedEntity(self, value): # Validate type RoleClassLocatedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['LOCE', 'STOR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassLocatedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassLocatedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassLocatedEntity_patterns_, ))
validate_RoleClassLocatedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.subjectOf is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.LocatedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT710000UV07.LocatedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT710000UV07.LocatedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT710000UV07.LocatedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.LocatedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.subjectOf is not None: self.subjectOf.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassLocatedEntity(self.classCode) # validate type RoleClassLocatedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'subjectOf': obj_ = COCT_MT710000UV07_Subject7.factory() obj_.build(child_) self.subjectOf = obj_ obj_.original_tagname_ = 'subjectOf'
# end class COCT_MT710000UV07_LocatedEntity
[docs]class COCT_MT710000UV07_LocatedEntityHasParts(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, locatedPlace=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.locatedPlace = locatedPlace
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT710000UV07_LocatedEntityHasParts) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT710000UV07_LocatedEntityHasParts.subclass: return COCT_MT710000UV07_LocatedEntityHasParts.subclass(*args_, **kwargs_) else: return COCT_MT710000UV07_LocatedEntityHasParts(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_locatedPlace(self): return self.locatedPlace
[docs] def set_locatedPlace(self, locatedPlace): self.locatedPlace = locatedPlace
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassLocatedEntity(self, value): # Validate type RoleClassLocatedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['LOCE', 'STOR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassLocatedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassLocatedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassLocatedEntity_patterns_, ))
validate_RoleClassLocatedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.locatedPlace is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.LocatedEntityHasParts', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT710000UV07.LocatedEntityHasParts') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT710000UV07.LocatedEntityHasParts', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT710000UV07.LocatedEntityHasParts'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.LocatedEntityHasParts', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.locatedPlace is not None: self.locatedPlace.export(outfile, level, namespace_, name_='locatedPlace', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassLocatedEntity(self.classCode) # validate type RoleClassLocatedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'locatedPlace': obj_ = COCT_MT710000UV07_Place.factory() obj_.build(child_) self.locatedPlace = obj_ obj_.original_tagname_ = 'locatedPlace'
# end class COCT_MT710000UV07_LocatedEntityHasParts
[docs]class COCT_MT710000UV07_LocatedEntityPartOf(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, realmCode=None, typeId=None, templateId=None, id=None, location=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.location = location
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT710000UV07_LocatedEntityPartOf) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT710000UV07_LocatedEntityPartOf.subclass: return COCT_MT710000UV07_LocatedEntityPartOf.subclass(*args_, **kwargs_) else: return COCT_MT710000UV07_LocatedEntityPartOf(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_location(self): return self.location
[docs] def set_location(self, location): self.location = location
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassLocatedEntity(self, value): # Validate type RoleClassLocatedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['LOCE', 'STOR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassLocatedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassLocatedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassLocatedEntity_patterns_, ))
validate_RoleClassLocatedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.location is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.LocatedEntityPartOf', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT710000UV07.LocatedEntityPartOf') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT710000UV07.LocatedEntityPartOf', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT710000UV07.LocatedEntityPartOf'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.LocatedEntityPartOf', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.location is not None: self.location.export(outfile, level, namespace_, name_='location', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassLocatedEntity(self.classCode) # validate type RoleClassLocatedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'location': obj_ = COCT_MT710000UV07_Place.factory() obj_.build(child_) self.location = obj_ obj_.original_tagname_ = 'location'
# end class COCT_MT710000UV07_LocatedEntityPartOf
[docs]class COCT_MT710000UV07_Place(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode=None, determinerCode=None, realmCode=None, typeId=None, templateId=None, id=None, code=None, name=None, desc=None, addr=None, directionsText=None, positionText=None, asLocatedEntityPartOf=None, locatedEntity=None, locatedEntityHasParts=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code if name is None: self.name = [] else: self.name = name self.desc = desc self.addr = addr self.directionsText = directionsText self.positionText = positionText if asLocatedEntityPartOf is None: self.asLocatedEntityPartOf = [] else: self.asLocatedEntityPartOf = asLocatedEntityPartOf self.locatedEntity = locatedEntity if locatedEntityHasParts is None: self.locatedEntityHasParts = [] else: self.locatedEntityHasParts = locatedEntityHasParts
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT710000UV07_Place) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT710000UV07_Place.subclass: return COCT_MT710000UV07_Place.subclass(*args_, **kwargs_) else: return COCT_MT710000UV07_Place(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def add_name(self, value): self.name.append(value)
[docs] def insert_name_at(self, index, value): self.name.insert(index, value)
[docs] def replace_name_at(self, index, value): self.name[index] = value
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_directionsText(self): return self.directionsText
[docs] def set_directionsText(self, directionsText): self.directionsText = directionsText
[docs] def get_positionText(self): return self.positionText
[docs] def set_positionText(self, positionText): self.positionText = positionText
[docs] def get_asLocatedEntityPartOf(self): return self.asLocatedEntityPartOf
[docs] def set_asLocatedEntityPartOf(self, asLocatedEntityPartOf): self.asLocatedEntityPartOf = asLocatedEntityPartOf
[docs] def add_asLocatedEntityPartOf(self, value): self.asLocatedEntityPartOf.append(value)
[docs] def insert_asLocatedEntityPartOf_at(self, index, value): self.asLocatedEntityPartOf.insert(index, value)
[docs] def replace_asLocatedEntityPartOf_at(self, index, value): self.asLocatedEntityPartOf[index] = value
[docs] def get_locatedEntity(self): return self.locatedEntity
[docs] def set_locatedEntity(self, locatedEntity): self.locatedEntity = locatedEntity
[docs] def get_locatedEntityHasParts(self): return self.locatedEntityHasParts
[docs] def set_locatedEntityHasParts(self, locatedEntityHasParts): self.locatedEntityHasParts = locatedEntityHasParts
[docs] def add_locatedEntityHasParts(self, value): self.locatedEntityHasParts.append(value)
[docs] def insert_locatedEntityHasParts_at(self, index, value): self.locatedEntityHasParts.insert(index, value)
[docs] def replace_locatedEntityHasParts_at(self, index, value): self.locatedEntityHasParts[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassPlace(self, value): # Validate type EntityClassPlace, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PLC', 'CITY', 'COUNTRY', 'COUNTY', 'PROVINCE'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPlace' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPlace_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPlace_patterns_, ))
validate_EntityClassPlace_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.name or self.desc is not None or self.addr is not None or self.directionsText is not None or self.positionText is not None or self.asLocatedEntityPartOf or self.locatedEntity is not None or self.locatedEntityHasParts ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.Place', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT710000UV07.Place') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT710000UV07.Place', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT710000UV07.Place'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode is not None and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.Place', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) for name_ in self.name: name_.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) if self.directionsText is not None: self.directionsText.export(outfile, level, namespace_, name_='directionsText', pretty_print=pretty_print) if self.positionText is not None: self.positionText.export(outfile, level, namespace_, name_='positionText', pretty_print=pretty_print) for asLocatedEntityPartOf_ in self.asLocatedEntityPartOf: asLocatedEntityPartOf_.export(outfile, level, namespace_, name_='asLocatedEntityPartOf', pretty_print=pretty_print) if self.locatedEntity is not None: self.locatedEntity.export(outfile, level, namespace_, name_='locatedEntity', pretty_print=pretty_print) for locatedEntityHasParts_ in self.locatedEntityHasParts: locatedEntityHasParts_.export(outfile, level, namespace_, name_='locatedEntityHasParts', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPlace(self.classCode) # validate type EntityClassPlace value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': class_obj_ = self.get_class_obj_(child_, EN) obj_ = class_obj_.factory() obj_.build(child_) self.name.append(obj_) obj_.original_tagname_ = 'name' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'directionsText': obj_ = ED.factory() obj_.build(child_) self.directionsText = obj_ obj_.original_tagname_ = 'directionsText' elif nodeName_ == 'positionText': obj_ = ED.factory() obj_.build(child_) self.positionText = obj_ obj_.original_tagname_ = 'positionText' elif nodeName_ == 'asLocatedEntityPartOf': obj_ = COCT_MT710000UV07_LocatedEntityPartOf.factory() obj_.build(child_) self.asLocatedEntityPartOf.append(obj_) obj_.original_tagname_ = 'asLocatedEntityPartOf' elif nodeName_ == 'locatedEntity': obj_ = COCT_MT710000UV07_LocatedEntity.factory() obj_.build(child_) self.locatedEntity = obj_ obj_.original_tagname_ = 'locatedEntity' elif nodeName_ == 'locatedEntityHasParts': obj_ = COCT_MT710000UV07_LocatedEntityHasParts.factory() obj_.build(child_) self.locatedEntityHasParts.append(obj_) obj_.original_tagname_ = 'locatedEntityHasParts'
# end class COCT_MT710000UV07_Place
[docs]class COCT_MT710000UV07_Subject7(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode=None, realmCode=None, typeId=None, templateId=None, position=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.position = position
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, COCT_MT710000UV07_Subject7) if subclass is not None: return subclass(*args_, **kwargs_) if COCT_MT710000UV07_Subject7.subclass: return COCT_MT710000UV07_Subject7.subclass(*args_, **kwargs_) else: return COCT_MT710000UV07_Subject7(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_position(self): return self.position
[docs] def set_position(self, position): self.position = position
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.position is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.Subject7', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='COCT_MT710000UV07.Subject7') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='COCT_MT710000UV07.Subject7', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='COCT_MT710000UV07.Subject7'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='COCT_MT710000UV07.Subject7', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.position is not None: self.position.export(outfile, level, namespace_, name_='position', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'position': obj_ = COCT_MT960000UV05_Position.factory() obj_.build(child_) self.position = obj_ obj_.original_tagname_ = 'position'
# end class COCT_MT710000UV07_Subject7
[docs]class POCP_MT030300UV_ActDefinition(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ACT', moodCode='DEF', realmCode=None, typeId=None, templateId=None, code=None, text=None, effectiveTime=None, product=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.moodCode = _cast(None, moodCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.text = text self.effectiveTime = effectiveTime if product is None: self.product = [] else: self.product = product if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_ActDefinition) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_ActDefinition.subclass: return POCP_MT030300UV_ActDefinition.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_ActDefinition(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_text(self): return self.text
[docs] def set_text(self, text): self.text = text
[docs] def get_effectiveTime(self): return self.effectiveTime
[docs] def set_effectiveTime(self, effectiveTime): self.effectiveTime = effectiveTime
[docs] def get_product(self): return self.product
[docs] def set_product(self, product): self.product = product
[docs] def add_product(self, value): self.product.append(value)
[docs] def insert_product_at(self, index, value): self.product.insert(index, value)
[docs] def replace_product_at(self, index, value): self.product[index] = value
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_moodCode(self): return self.moodCode
[docs] def set_moodCode(self, moodCode): self.moodCode = moodCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActClassRoot(self, value): # Validate type ActClassRoot, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ACT', 'COMPOSITION', 'DOC', 'DOCCLIN', 'CDALVLONE', 'CONTAINER', 'CATEGORY', 'DOCBODY', 'DOCSECT', 'TOPIC', 'EXTRACT', 'EHR', 'FOLDER', 'GROUPER', 'CLUSTER', 'ACCM', 'ACCT', 'ACSN', 'ADJUD', 'CACT', 'ACTN', 'INFO', 'STC', 'CNTRCT', 'FCNTRCT', 'COV', 'CONC', 'HCASE', 'OUTBR', 'CONS', 'CONTREG', 'CTTEVENT', 'DISPACT', 'EXPOS', 'AEXPOS', 'TEXPOS', 'INC', 'INFRM', 'INVE', 'LIST', 'MPROT', 'OBS', 'ROIBND', 'ROIOVL', 'LLD', 'PRN', 'RLD', 'SFWL', 'SIT', 'STN', 'SUP', 'RTRD', 'TRD', 'ALRT', 'BATTERY', 'CLNTRL', 'CNOD', 'COND', 'CASE', 'OUTB', 'DGIMG', 'GEN', 'DETPOL', 'EXP', 'LOC', 'PHN', 'POL', 'SEQ', 'SEQVAR', 'INVSTG', 'OBSSER', 'OBSCOR', 'POS', 'POSACC', 'POSCOORD', 'SPCOBS', 'VERIF', 'PCPR', 'ENC', 'POLICY', 'JURISPOL', 'ORGPOL', 'SCOPOL', 'STDPOL', 'PROC', 'SBADM', 'SBEXT', 'SPECCOLLECT', 'REG', 'REV', 'SPCTRT', 'SPLY', 'DIET', 'STORE', 'SUBST', 'TRFR', 'TRNS', 'XACT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActClassRoot' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActClassRoot_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActClassRoot_patterns_, ))
validate_ActClassRoot_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActMoodDefinition(self, value): # Validate type ActMoodDefinition, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActMoodDefinition' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActMoodDefinition_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActMoodDefinition_patterns_, ))
validate_ActMoodDefinition_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.text is not None or self.effectiveTime is not None or self.product or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.ActDefinition', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.ActDefinition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.ActDefinition', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.ActDefinition'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ACT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.moodCode != "DEF" and 'moodCode' not in already_processed: already_processed.add('moodCode') outfile.write(' moodCode=%s' % (quote_attrib(self.moodCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.ActDefinition', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.text is not None: self.text.export(outfile, level, namespace_, name_='text', pretty_print=pretty_print) if self.effectiveTime is not None: self.effectiveTime.export(outfile, level, namespace_, name_='effectiveTime', pretty_print=pretty_print) for product_ in self.product: product_.export(outfile, level, namespace_, name_='product', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_ActClassRoot(self.classCode) # validate type ActClassRoot value = find_attr_value_('moodCode', node) if value is not None and 'moodCode' not in already_processed: already_processed.add('moodCode') self.moodCode = value self.validate_ActMoodDefinition(self.moodCode) # validate type ActMoodDefinition
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'text': obj_ = ED.factory() obj_.build(child_) self.text = obj_ obj_.original_tagname_ = 'text' elif nodeName_ == 'effectiveTime': obj_ = IVL_TS.factory() obj_.build(child_) self.effectiveTime = obj_ obj_.original_tagname_ = 'effectiveTime' elif nodeName_ == 'product': obj_ = POCP_MT030300UV_Product.factory() obj_.build(child_) self.product.append(obj_) obj_.original_tagname_ = 'product' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030300UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT030300UV_ActDefinition
[docs]class POCP_MT030300UV_AssignedEntity(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ASSIGNED', realmCode=None, typeId=None, templateId=None, code=None, confidentialityCode=None, assignedOrganization=None, subjectOf=None, performance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.confidentialityCode = confidentialityCode self.assignedOrganization = assignedOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if performance is None: self.performance = [] else: self.performance = performance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_AssignedEntity) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_AssignedEntity.subclass: return POCP_MT030300UV_AssignedEntity.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_AssignedEntity(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_assignedOrganization(self): return self.assignedOrganization
[docs] def set_assignedOrganization(self, assignedOrganization): self.assignedOrganization = assignedOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_performance(self): return self.performance
[docs] def set_performance(self, performance): self.performance = performance
[docs] def add_performance(self, value): self.performance.append(value)
[docs] def insert_performance_at(self, index, value): self.performance.insert(index, value)
[docs] def replace_performance_at(self, index, value): self.performance[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.confidentialityCode is not None or self.assignedOrganization is not None or self.subjectOf or self.performance ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.AssignedEntity', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.AssignedEntity') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.AssignedEntity', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.AssignedEntity'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ASSIGNED" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.AssignedEntity', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.assignedOrganization is not None: self.assignedOrganization.export(outfile, level, namespace_, name_='assignedOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for performance_ in self.performance: performance_.export(outfile, level, namespace_, name_='performance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'assignedOrganization': obj_ = POCP_MT030300UV_Organization.factory() obj_.build(child_) self.assignedOrganization = obj_ obj_.original_tagname_ = 'assignedOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030300UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'performance': obj_ = POCP_MT030300UV_PrimaryPerformer.factory() obj_.build(child_) self.performance.append(obj_) obj_.original_tagname_ = 'performance'
# end class POCP_MT030300UV_AssignedEntity
[docs]class POCP_MT030300UV_AssignedEntity3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ASSIGNED', realmCode=None, typeId=None, templateId=None, code=None, confidentialityCode=None, representedOrganization=None, subjectOf=None, performance=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.confidentialityCode = confidentialityCode self.representedOrganization = representedOrganization if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf if performance is None: self.performance = [] else: self.performance = performance
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_AssignedEntity3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_AssignedEntity3.subclass: return POCP_MT030300UV_AssignedEntity3.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_AssignedEntity3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_representedOrganization(self): return self.representedOrganization
[docs] def set_representedOrganization(self, representedOrganization): self.representedOrganization = representedOrganization
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_performance(self): return self.performance
[docs] def set_performance(self, performance): self.performance = performance
[docs] def add_performance(self, value): self.performance.append(value)
[docs] def insert_performance_at(self, index, value): self.performance.insert(index, value)
[docs] def replace_performance_at(self, index, value): self.performance[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassAssignedEntity(self, value): # Validate type RoleClassAssignedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASSIGNED', 'COMPAR', 'CON', 'ECON', 'NOK', 'SGNOFF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassAssignedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassAssignedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassAssignedEntity_patterns_, ))
validate_RoleClassAssignedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.confidentialityCode is not None or self.representedOrganization is not None or self.subjectOf or self.performance ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.AssignedEntity3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.AssignedEntity3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.AssignedEntity3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.AssignedEntity3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ASSIGNED" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.AssignedEntity3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.representedOrganization is not None: self.representedOrganization.export(outfile, level, namespace_, name_='representedOrganization', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print) for performance_ in self.performance: performance_.export(outfile, level, namespace_, name_='performance', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassAssignedEntity(self.classCode) # validate type RoleClassAssignedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'representedOrganization': obj_ = POCP_MT030300UV_Organization.factory() obj_.build(child_) self.representedOrganization = obj_ obj_.original_tagname_ = 'representedOrganization' elif nodeName_ == 'subjectOf': obj_ = POCP_MT030300UV_Subject2.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf' elif nodeName_ == 'performance': obj_ = POCP_MT030300UV_PrimaryPerformer.factory() obj_.build(child_) self.performance.append(obj_) obj_.original_tagname_ = 'performance'
# end class POCP_MT030300UV_AssignedEntity3
[docs]class POCP_MT030300UV_ContactParty(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CON', realmCode=None, typeId=None, templateId=None, code=None, name=None, addr=None, telecom=None, confidentialityCode=None, contactPerson=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.name = name self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom self.confidentialityCode = confidentialityCode self.contactPerson = contactPerson
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_ContactParty) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_ContactParty.subclass: return POCP_MT030300UV_ContactParty.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_ContactParty(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_confidentialityCode(self): return self.confidentialityCode
[docs] def set_confidentialityCode(self, confidentialityCode): self.confidentialityCode = confidentialityCode
[docs] def get_contactPerson(self): return self.contactPerson
[docs] def set_contactPerson(self, contactPerson): self.contactPerson = contactPerson
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContact(self, value): # Validate type RoleClassContact, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CON', 'ECON', 'NOK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContact' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContact_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContact_patterns_, ))
validate_RoleClassContact_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.name is not None or self.addr is not None or self.telecom or self.confidentialityCode is not None or self.contactPerson is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.ContactParty', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.ContactParty') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.ContactParty', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.ContactParty'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CON" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.ContactParty', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.confidentialityCode is not None: self.confidentialityCode.export(outfile, level, namespace_, name_='confidentialityCode', pretty_print=pretty_print) if self.contactPerson is not None: self.contactPerson.export(outfile, level, namespace_, name_='contactPerson', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContact(self.classCode) # validate type RoleClassContact
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'confidentialityCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.confidentialityCode = obj_ obj_.original_tagname_ = 'confidentialityCode' elif nodeName_ == 'contactPerson': obj_ = POCP_MT030300UV_Person.factory() obj_.build(child_) self.contactPerson = obj_ obj_.original_tagname_ = 'contactPerson'
# end class POCP_MT030300UV_ContactParty
[docs]class POCP_MT030300UV_ManufacturedProduct3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MANU', realmCode=None, typeId=None, templateId=None, id=None, manufacturedMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.manufacturedMaterialKind = manufacturedMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_ManufacturedProduct3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_ManufacturedProduct3.subclass: return POCP_MT030300UV_ManufacturedProduct3.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_ManufacturedProduct3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_manufacturedMaterialKind(self): return self.manufacturedMaterialKind
[docs] def set_manufacturedMaterialKind(self, manufacturedMaterialKind): self.manufacturedMaterialKind = manufacturedMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassManufacturedProduct(self, value): # Validate type RoleClassManufacturedProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MANU', 'THER'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassManufacturedProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassManufacturedProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassManufacturedProduct_patterns_, ))
validate_RoleClassManufacturedProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.manufacturedMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.ManufacturedProduct3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.ManufacturedProduct3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.ManufacturedProduct3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.ManufacturedProduct3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MANU" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.ManufacturedProduct3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.manufacturedMaterialKind is not None: self.manufacturedMaterialKind.export(outfile, level, namespace_, name_='manufacturedMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassManufacturedProduct(self.classCode) # validate type RoleClassManufacturedProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'manufacturedMaterialKind': obj_ = POCP_MT010400UV_MaterialKind.factory() obj_.build(child_) self.manufacturedMaterialKind = obj_ obj_.original_tagname_ = 'manufacturedMaterialKind'
# end class POCP_MT030300UV_ManufacturedProduct3
[docs]class POCP_MT030300UV_Organization(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None, telecom=None, addr=None, assignedEntity1=None, asNamedEntity=None, contactParty=None, assignedEntity2=None, otherLocation=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.name = name if telecom is None: self.telecom = [] else: self.telecom = telecom self.addr = addr if assignedEntity1 is None: self.assignedEntity1 = [] else: self.assignedEntity1 = assignedEntity1 if asNamedEntity is None: self.asNamedEntity = [] else: self.asNamedEntity = asNamedEntity if contactParty is None: self.contactParty = [] else: self.contactParty = contactParty if assignedEntity2 is None: self.assignedEntity2 = [] else: self.assignedEntity2 = assignedEntity2 if otherLocation is None: self.otherLocation = [] else: self.otherLocation = otherLocation
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_Organization) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_Organization.subclass: return POCP_MT030300UV_Organization.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_Organization(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_assignedEntity1(self): return self.assignedEntity1
[docs] def set_assignedEntity1(self, assignedEntity1): self.assignedEntity1 = assignedEntity1
[docs] def add_assignedEntity1(self, value): self.assignedEntity1.append(value)
[docs] def insert_assignedEntity1_at(self, index, value): self.assignedEntity1.insert(index, value)
[docs] def replace_assignedEntity1_at(self, index, value): self.assignedEntity1[index] = value
[docs] def get_asNamedEntity(self): return self.asNamedEntity
[docs] def set_asNamedEntity(self, asNamedEntity): self.asNamedEntity = asNamedEntity
[docs] def add_asNamedEntity(self, value): self.asNamedEntity.append(value)
[docs] def insert_asNamedEntity_at(self, index, value): self.asNamedEntity.insert(index, value)
[docs] def replace_asNamedEntity_at(self, index, value): self.asNamedEntity[index] = value
[docs] def get_contactParty(self): return self.contactParty
[docs] def set_contactParty(self, contactParty): self.contactParty = contactParty
[docs] def add_contactParty(self, value): self.contactParty.append(value)
[docs] def insert_contactParty_at(self, index, value): self.contactParty.insert(index, value)
[docs] def replace_contactParty_at(self, index, value): self.contactParty[index] = value
[docs] def get_assignedEntity2(self): return self.assignedEntity2
[docs] def set_assignedEntity2(self, assignedEntity2): self.assignedEntity2 = assignedEntity2
[docs] def add_assignedEntity2(self, value): self.assignedEntity2.append(value)
[docs] def insert_assignedEntity2_at(self, index, value): self.assignedEntity2.insert(index, value)
[docs] def replace_assignedEntity2_at(self, index, value): self.assignedEntity2[index] = value
[docs] def get_otherLocation(self): return self.otherLocation
[docs] def set_otherLocation(self, otherLocation): self.otherLocation = otherLocation
[docs] def add_otherLocation(self, value): self.otherLocation.append(value)
[docs] def insert_otherLocation_at(self, index, value): self.otherLocation.insert(index, value)
[docs] def replace_otherLocation_at(self, index, value): self.otherLocation[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.name is not None or self.telecom or self.addr is not None or self.assignedEntity1 or self.asNamedEntity or self.contactParty or self.assignedEntity2 or self.otherLocation ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Organization', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.Organization') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.Organization', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.Organization'): if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Organization', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for assignedEntity1_ in self.assignedEntity1: assignedEntity1_.export(outfile, level, namespace_, name_='assignedEntity1', pretty_print=pretty_print) for asNamedEntity_ in self.asNamedEntity: asNamedEntity_.export(outfile, level, namespace_, name_='asNamedEntity', pretty_print=pretty_print) for contactParty_ in self.contactParty: contactParty_.export(outfile, level, namespace_, name_='contactParty', pretty_print=pretty_print) for assignedEntity2_ in self.assignedEntity2: assignedEntity2_.export(outfile, level, namespace_, name_='assignedEntity2', pretty_print=pretty_print) for otherLocation_ in self.otherLocation: otherLocation_.export(outfile, level, namespace_, name_='otherLocation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'assignedEntity1': obj_ = POCP_MT030300UV_AssignedEntity3.factory() obj_.build(child_) self.assignedEntity1.append(obj_) obj_.original_tagname_ = 'assignedEntity1' elif nodeName_ == 'asNamedEntity': obj_ = POCP_MT000100UV_NamedEntity.factory() obj_.build(child_) self.asNamedEntity.append(obj_) obj_.original_tagname_ = 'asNamedEntity' elif nodeName_ == 'contactParty': obj_ = POCP_MT030300UV_ContactParty.factory() obj_.build(child_) self.contactParty.append(obj_) obj_.original_tagname_ = 'contactParty' elif nodeName_ == 'assignedEntity2': obj_ = POCP_MT030300UV_AssignedEntity.factory() obj_.build(child_) self.assignedEntity2.append(obj_) obj_.original_tagname_ = 'assignedEntity2' elif nodeName_ == 'otherLocation': obj_ = POCP_MT030300UV_OtherLocation.factory() obj_.build(child_) self.otherLocation.append(obj_) obj_.original_tagname_ = 'otherLocation'
# end class POCP_MT030300UV_Organization
[docs]class POCP_MT030300UV_OtherLocation(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='SDLOC', realmCode=None, typeId=None, templateId=None, code=None, addr=None, telecom=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.code = code self.addr = addr if telecom is None: self.telecom = [] else: self.telecom = telecom
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_OtherLocation) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_OtherLocation.subclass: return POCP_MT030300UV_OtherLocation.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_OtherLocation(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_addr(self): return self.addr
[docs] def set_addr(self, addr): self.addr = addr
[docs] def get_telecom(self): return self.telecom
[docs] def set_telecom(self, telecom): self.telecom = telecom
[docs] def add_telecom(self, value): self.telecom.append(value)
[docs] def insert_telecom_at(self, index, value): self.telecom.insert(index, value)
[docs] def replace_telecom_at(self, index, value): self.telecom[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassServiceDeliveryLocation(self, value): # Validate type RoleClassServiceDeliveryLocation, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SDLOC', 'DSDLOC', 'ISDLOC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassServiceDeliveryLocation' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassServiceDeliveryLocation_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassServiceDeliveryLocation_patterns_, ))
validate_RoleClassServiceDeliveryLocation_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.code is not None or self.addr is not None or self.telecom ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.OtherLocation', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.OtherLocation') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.OtherLocation', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.OtherLocation'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "SDLOC" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.OtherLocation', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.addr is not None: self.addr.export(outfile, level, namespace_, name_='addr', pretty_print=pretty_print) for telecom_ in self.telecom: telecom_.export(outfile, level, namespace_, name_='telecom', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassServiceDeliveryLocation(self.classCode) # validate type RoleClassServiceDeliveryLocation
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'addr': obj_ = AD.factory() obj_.build(child_) self.addr = obj_ obj_.original_tagname_ = 'addr' elif nodeName_ == 'telecom': obj_ = TEL.factory() obj_.build(child_) self.telecom.append(obj_) obj_.original_tagname_ = 'telecom'
# end class POCP_MT030300UV_OtherLocation
[docs]class POCP_MT030300UV_Person(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='PSN', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, name=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_Person) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_Person.subclass: return POCP_MT030300UV_Person.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_Person(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_EntityClassPerson(self, value): # Validate type EntityClassPerson, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PSN'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassPerson' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassPerson_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassPerson_patterns_, ))
validate_EntityClassPerson_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Person', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.Person') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.Person', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.Person'): if self.classCode != "PSN" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Person', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassPerson(self.classCode) # validate type EntityClassPerson value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'name': obj_ = PN.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT030300UV_Person
[docs]class POCP_MT030300UV_PrimaryPerformer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PPRF', realmCode=None, typeId=None, templateId=None, actDefinition=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.actDefinition = actDefinition
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_PrimaryPerformer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_PrimaryPerformer.subclass: return POCP_MT030300UV_PrimaryPerformer.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_PrimaryPerformer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_actDefinition(self): return self.actDefinition
[docs] def set_actDefinition(self, actDefinition): self.actDefinition = actDefinition
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationPrimaryPerformer(self, value): # Validate type ParticipationPrimaryPerformer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PPRF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationPrimaryPerformer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationPrimaryPerformer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationPrimaryPerformer_patterns_, ))
validate_ParticipationPrimaryPerformer_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.actDefinition is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.PrimaryPerformer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.PrimaryPerformer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.PrimaryPerformer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.PrimaryPerformer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PPRF" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.PrimaryPerformer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.actDefinition is not None: self.actDefinition.export(outfile, level, namespace_, name_='actDefinition', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationPrimaryPerformer(self.typeCode) # validate type ParticipationPrimaryPerformer
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'actDefinition': obj_ = POCP_MT030300UV_ActDefinition.factory() obj_.build(child_) self.actDefinition = obj_ obj_.original_tagname_ = 'actDefinition'
# end class POCP_MT030300UV_PrimaryPerformer
[docs]class POCP_MT030300UV_Product(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='PRD', realmCode=None, typeId=None, templateId=None, manufacturedProduct=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.manufacturedProduct = manufacturedProduct
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_Product) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_Product.subclass: return POCP_MT030300UV_Product.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_Product(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_manufacturedProduct(self): return self.manufacturedProduct
[docs] def set_manufacturedProduct(self, manufacturedProduct): self.manufacturedProduct = manufacturedProduct
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationProduct(self, value): # Validate type ParticipationProduct, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PRD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationProduct' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationProduct_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationProduct_patterns_, ))
validate_ParticipationProduct_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.manufacturedProduct is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Product', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.Product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.Product', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.Product'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "PRD" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Product', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.manufacturedProduct is not None: self.manufacturedProduct.export(outfile, level, namespace_, name_='manufacturedProduct', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationProduct(self.typeCode) # validate type ParticipationProduct
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'manufacturedProduct': obj_ = POCP_MT030300UV_ManufacturedProduct3.factory() obj_.build(child_) self.manufacturedProduct = obj_ obj_.original_tagname_ = 'manufacturedProduct'
# end class POCP_MT030300UV_Product
[docs]class POCP_MT030300UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SUBJ', realmCode=None, typeId=None, templateId=None, approval=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.approval = approval
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_Subject.subclass: return POCP_MT030300UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_approval(self): return self.approval
[docs] def set_approval(self, approval): self.approval = approval
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ActRelationshipHasSubject(self, value): # Validate type ActRelationshipHasSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SUBJ', 'QUALF'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ActRelationshipHasSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ActRelationshipHasSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ActRelationshipHasSubject_patterns_, ))
validate_ActRelationshipHasSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.approval is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SUBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.approval is not None: self.approval.export(outfile, level, namespace_, name_='approval', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ActRelationshipHasSubject(self.typeCode) # validate type ActRelationshipHasSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'approval': obj_ = POCP_MT050700UV_Approval.factory() obj_.build(child_) self.approval = obj_ obj_.original_tagname_ = 'approval'
# end class POCP_MT030300UV_Subject
[docs]class POCP_MT030300UV_Subject2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, position=None, characteristic=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.position = position self.characteristic = characteristic
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT030300UV_Subject2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT030300UV_Subject2.subclass: return POCP_MT030300UV_Subject2.subclass(*args_, **kwargs_) else: return POCP_MT030300UV_Subject2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_position(self): return self.position
[docs] def set_position(self, position): self.position = position
[docs] def get_characteristic(self): return self.characteristic
[docs] def set_characteristic(self, characteristic): self.characteristic = characteristic
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.position is not None or self.characteristic is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Subject2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT030300UV.Subject2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT030300UV.Subject2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT030300UV.Subject2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT030300UV.Subject2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.position is not None: self.position.export(outfile, level, namespace_, name_='position', pretty_print=pretty_print) if self.characteristic is not None: self.characteristic.export(outfile, level, namespace_, name_='characteristic', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'position': obj_ = COCT_MT960000UV05_Position.factory() obj_.build(child_) self.position = obj_ obj_.original_tagname_ = 'position' elif nodeName_ == 'characteristic': obj_ = POCP_MT050500UV_Characteristic.factory() obj_.build(child_) self.characteristic = obj_ obj_.original_tagname_ = 'characteristic'
# end class POCP_MT030300UV_Subject2
[docs]class POCP_MT020200UV_Container(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, code=None, desc=None, formCode=None, capacityQuantity=None, asContent=None, asInstanceOfKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.code = code self.desc = desc self.formCode = formCode self.capacityQuantity = capacityQuantity self.asContent = asContent self.asInstanceOfKind = asInstanceOfKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Container) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Container.subclass: return POCP_MT020200UV_Container.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Container(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_formCode(self): return self.formCode
[docs] def set_formCode(self, formCode): self.formCode = formCode
[docs] def get_capacityQuantity(self): return self.capacityQuantity
[docs] def set_capacityQuantity(self, capacityQuantity): self.capacityQuantity = capacityQuantity
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def get_asInstanceOfKind(self): return self.asInstanceOfKind
[docs] def set_asInstanceOfKind(self, asInstanceOfKind): self.asInstanceOfKind = asInstanceOfKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassContainer(self, value): # Validate type EntityClassContainer, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT', 'HOLD'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassContainer' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassContainer_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassContainer_patterns_, ))
validate_EntityClassContainer_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.code is not None or self.desc is not None or self.formCode is not None or self.capacityQuantity is not None or self.asContent is not None or self.asInstanceOfKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Container', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Container') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Container', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Container'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Container', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.formCode is not None: self.formCode.export(outfile, level, namespace_, name_='formCode', pretty_print=pretty_print) if self.capacityQuantity is not None: self.capacityQuantity.export(outfile, level, namespace_, name_='capacityQuantity', pretty_print=pretty_print) if self.asContent is not None: self.asContent.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) if self.asInstanceOfKind is not None: self.asInstanceOfKind.export(outfile, level, namespace_, name_='asInstanceOfKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassContainer(self.classCode) # validate type EntityClassContainer value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'formCode': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.formCode = obj_ obj_.original_tagname_ = 'formCode' elif nodeName_ == 'capacityQuantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.capacityQuantity = obj_ obj_.original_tagname_ = 'capacityQuantity' elif nodeName_ == 'asContent': obj_ = POCP_MT020200UV_Content3.factory() obj_.build(child_) self.asContent = obj_ obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asInstanceOfKind': obj_ = POCP_MT020200UV_InstanceOfKind2.factory() obj_.build(child_) self.asInstanceOfKind = obj_ obj_.original_tagname_ = 'asInstanceOfKind'
# end class POCP_MT020200UV_Container
[docs]class POCP_MT020200UV_Content2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, quantity=None, container=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.container = container if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Content2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Content2.subclass: return POCP_MT020200UV_Content2.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Content2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_container(self): return self.container
[docs] def set_container(self, container): self.container = container
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.container is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Content2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Content2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Content2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Content2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Content2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.container is not None: self.container.export(outfile, level, namespace_, name_='container', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'container': obj_ = POCP_MT020200UV_Container.factory() obj_.build(child_) self.container = obj_ obj_.original_tagname_ = 'container' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020200UV_Content2
[docs]class POCP_MT020200UV_Content3(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='CONT', realmCode=None, typeId=None, templateId=None, container=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.container = container if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Content3) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Content3.subclass: return POCP_MT020200UV_Content3.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Content3(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_container(self): return self.container
[docs] def set_container(self, container): self.container = container
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassContent(self, value): # Validate type RoleClassContent, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CONT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassContent' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassContent_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassContent_patterns_, ))
validate_RoleClassContent_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.container is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Content3', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Content3') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Content3', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Content3'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "CONT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Content3', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.container is not None: self.container.export(outfile, level, namespace_, name_='container', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassContent(self.classCode) # validate type RoleClassContent
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'container': obj_ = POCP_MT020200UV_Container.factory() obj_.build(child_) self.container = obj_ obj_.original_tagname_ = 'container' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020200UV_Content3
[docs]class POCP_MT020200UV_DeviceInstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='DEV', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, quantity=None, desc=None, existenceTime=None, expirationTime=None, manufacturerModelName=None, softwareName=None, asIdentifiedItem=None, asContent=None, asMember=None, asInstanceOfKind=None, part=None, ingredient=None, member=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.quantity = quantity self.desc = desc self.existenceTime = existenceTime self.expirationTime = expirationTime self.manufacturerModelName = manufacturerModelName self.softwareName = softwareName if asIdentifiedItem is None: self.asIdentifiedItem = [] else: self.asIdentifiedItem = asIdentifiedItem self.asContent = asContent self.asMember = asMember self.asInstanceOfKind = asInstanceOfKind if part is None: self.part = [] else: self.part = part if ingredient is None: self.ingredient = [] else: self.ingredient = ingredient if member is None: self.member = [] else: self.member = member
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_DeviceInstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_DeviceInstance.subclass: return POCP_MT020200UV_DeviceInstance.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_DeviceInstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_existenceTime(self): return self.existenceTime
[docs] def set_existenceTime(self, existenceTime): self.existenceTime = existenceTime
[docs] def get_expirationTime(self): return self.expirationTime
[docs] def set_expirationTime(self, expirationTime): self.expirationTime = expirationTime
[docs] def get_manufacturerModelName(self): return self.manufacturerModelName
[docs] def set_manufacturerModelName(self, manufacturerModelName): self.manufacturerModelName = manufacturerModelName
[docs] def get_softwareName(self): return self.softwareName
[docs] def set_softwareName(self, softwareName): self.softwareName = softwareName
[docs] def get_asIdentifiedItem(self): return self.asIdentifiedItem
[docs] def set_asIdentifiedItem(self, asIdentifiedItem): self.asIdentifiedItem = asIdentifiedItem
[docs] def add_asIdentifiedItem(self, value): self.asIdentifiedItem.append(value)
[docs] def insert_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem.insert(index, value)
[docs] def replace_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def get_asMember(self): return self.asMember
[docs] def set_asMember(self, asMember): self.asMember = asMember
[docs] def get_asInstanceOfKind(self): return self.asInstanceOfKind
[docs] def set_asInstanceOfKind(self, asInstanceOfKind): self.asInstanceOfKind = asInstanceOfKind
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def add_ingredient(self, value): self.ingredient.append(value)
[docs] def insert_ingredient_at(self, index, value): self.ingredient.insert(index, value)
[docs] def replace_ingredient_at(self, index, value): self.ingredient[index] = value
[docs] def get_member(self): return self.member
[docs] def set_member(self, member): self.member = member
[docs] def add_member(self, value): self.member.append(value)
[docs] def insert_member_at(self, index, value): self.member.insert(index, value)
[docs] def replace_member_at(self, index, value): self.member[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassDevice(self, value): # Validate type EntityClassDevice, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassDevice' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassDevice_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassDevice_patterns_, ))
validate_EntityClassDevice_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.quantity is not None or self.desc is not None or self.existenceTime is not None or self.expirationTime is not None or self.manufacturerModelName is not None or self.softwareName is not None or self.asIdentifiedItem or self.asContent is not None or self.asMember is not None or self.asInstanceOfKind is not None or self.part or self.ingredient or self.member ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.DeviceInstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.DeviceInstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.DeviceInstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.DeviceInstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "DEV" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.DeviceInstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.existenceTime is not None: self.existenceTime.export(outfile, level, namespace_, name_='existenceTime', pretty_print=pretty_print) if self.expirationTime is not None: self.expirationTime.export(outfile, level, namespace_, name_='expirationTime', pretty_print=pretty_print) if self.manufacturerModelName is not None: self.manufacturerModelName.export(outfile, level, namespace_, name_='manufacturerModelName', pretty_print=pretty_print) if self.softwareName is not None: self.softwareName.export(outfile, level, namespace_, name_='softwareName', pretty_print=pretty_print) for asIdentifiedItem_ in self.asIdentifiedItem: asIdentifiedItem_.export(outfile, level, namespace_, name_='asIdentifiedItem', pretty_print=pretty_print) if self.asContent is not None: self.asContent.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) if self.asMember is not None: self.asMember.export(outfile, level, namespace_, name_='asMember', pretty_print=pretty_print) if self.asInstanceOfKind is not None: self.asInstanceOfKind.export(outfile, level, namespace_, name_='asInstanceOfKind', pretty_print=pretty_print) for part_ in self.part: part_.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) for ingredient_ in self.ingredient: ingredient_.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) for member_ in self.member: member_.export(outfile, level, namespace_, name_='member', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassDevice(self.classCode) # validate type EntityClassDevice value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'existenceTime': obj_ = IVL_TS.factory() obj_.build(child_) self.existenceTime = obj_ obj_.original_tagname_ = 'existenceTime' elif nodeName_ == 'expirationTime': obj_ = IVL_TS.factory() obj_.build(child_) self.expirationTime = obj_ obj_.original_tagname_ = 'expirationTime' elif nodeName_ == 'manufacturerModelName': class_obj_ = self.get_class_obj_(child_, SC) obj_ = class_obj_.factory() obj_.build(child_) self.manufacturerModelName = obj_ obj_.original_tagname_ = 'manufacturerModelName' elif nodeName_ == 'softwareName': class_obj_ = self.get_class_obj_(child_, SC) obj_ = class_obj_.factory() obj_.build(child_) self.softwareName = obj_ obj_.original_tagname_ = 'softwareName' elif nodeName_ == 'asIdentifiedItem': obj_ = POCP_MT020200UV_IdentifiedItem.factory() obj_.build(child_) self.asIdentifiedItem.append(obj_) obj_.original_tagname_ = 'asIdentifiedItem' elif nodeName_ == 'asContent': obj_ = POCP_MT020200UV_Content2.factory() obj_.build(child_) self.asContent = obj_ obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asMember': obj_ = POCP_MT020200UV_Member.factory() obj_.build(child_) self.asMember = obj_ obj_.original_tagname_ = 'asMember' elif nodeName_ == 'asInstanceOfKind': obj_ = POCP_MT020200UV_InstanceOfKind2.factory() obj_.build(child_) self.asInstanceOfKind = obj_ obj_.original_tagname_ = 'asInstanceOfKind' elif nodeName_ == 'part': obj_ = POCP_MT020200UV_Part.factory() obj_.build(child_) self.part.append(obj_) obj_.original_tagname_ = 'part' elif nodeName_ == 'ingredient': obj_ = POCP_MT020200UV_Ingredient1.factory() obj_.build(child_) self.ingredient.append(obj_) obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'member': obj_ = POCP_MT020200UV_Member1.factory() obj_.build(child_) self.member.append(obj_) obj_.original_tagname_ = 'member'
# end class POCP_MT020200UV_DeviceInstance
[docs]class POCP_MT020200UV_IdentifiedItem(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='IDENT', realmCode=None, typeId=None, templateId=None, id=None, code=None, assigningProductIdentifierIssuer=None, assigningOrganization1=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.code = code self.assigningProductIdentifierIssuer = assigningProductIdentifierIssuer self.assigningOrganization1 = assigningOrganization1
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_IdentifiedItem) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_IdentifiedItem.subclass: return POCP_MT020200UV_IdentifiedItem.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_IdentifiedItem(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_code(self): return self.code
[docs] def set_code(self, code): self.code = code
[docs] def get_assigningProductIdentifierIssuer(self): return self.assigningProductIdentifierIssuer
[docs] def set_assigningProductIdentifierIssuer(self, assigningProductIdentifierIssuer): self.assigningProductIdentifierIssuer = assigningProductIdentifierIssuer
[docs] def get_assigningOrganization1(self): return self.assigningOrganization1
[docs] def set_assigningOrganization1(self, assigningOrganization1): self.assigningOrganization1 = assigningOrganization1
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIdentifiedEntity(self, value): # Validate type RoleClassIdentifiedEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['IDENT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIdentifiedEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIdentifiedEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIdentifiedEntity_patterns_, ))
validate_RoleClassIdentifiedEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.code is not None or self.assigningProductIdentifierIssuer is not None or self.assigningOrganization1 is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.IdentifiedItem', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.IdentifiedItem') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.IdentifiedItem', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.IdentifiedItem'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "IDENT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.IdentifiedItem', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.code is not None: self.code.export(outfile, level, namespace_, name_='code', pretty_print=pretty_print) if self.assigningProductIdentifierIssuer is not None: self.assigningProductIdentifierIssuer.export(outfile, level, namespace_, name_='assigningProductIdentifierIssuer', pretty_print=pretty_print) if self.assigningOrganization1 is not None: self.assigningOrganization1.export(outfile, level, namespace_, name_='assigningOrganization1', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIdentifiedEntity(self.classCode) # validate type RoleClassIdentifiedEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'code': class_obj_ = self.get_class_obj_(child_, CD) obj_ = class_obj_.factory() obj_.build(child_) self.code = obj_ obj_.original_tagname_ = 'code' elif nodeName_ == 'assigningProductIdentifierIssuer': obj_ = POCP_MT020200UV_ProductIdentifierIssuer.factory() obj_.build(child_) self.assigningProductIdentifierIssuer = obj_ obj_.original_tagname_ = 'assigningProductIdentifierIssuer' elif nodeName_ == 'assigningOrganization1': obj_ = POCP_MT030200UV_Organization.factory() obj_.build(child_) self.assigningOrganization1 = obj_ obj_.original_tagname_ = 'assigningOrganization1'
# end class POCP_MT020200UV_IdentifiedItem
[docs]class POCP_MT020200UV_Ingredient1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='INGR', realmCode=None, typeId=None, templateId=None, quantity=None, ingredientProductInstance=None, ingredientDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.ingredientProductInstance = ingredientProductInstance self.ingredientDeviceInstance = ingredientDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Ingredient1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Ingredient1.subclass: return POCP_MT020200UV_Ingredient1.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Ingredient1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_ingredientProductInstance(self): return self.ingredientProductInstance
[docs] def set_ingredientProductInstance(self, ingredientProductInstance): self.ingredientProductInstance = ingredientProductInstance
[docs] def get_ingredientDeviceInstance(self): return self.ingredientDeviceInstance
[docs] def set_ingredientDeviceInstance(self, ingredientDeviceInstance): self.ingredientDeviceInstance = ingredientDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassIngredientEntity(self, value): # Validate type RoleClassIngredientEntity, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INGR', 'ACTI', 'ACTIB', 'ACTIM', 'ACTIR', 'ADJV', 'ADTV', 'BASE', 'CNTM', 'IACT', 'COLR', 'FLVR', 'PRSV', 'STBL', 'MECH'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassIngredientEntity' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassIngredientEntity_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassIngredientEntity_patterns_, ))
validate_RoleClassIngredientEntity_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.ingredientProductInstance is not None or self.ingredientDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Ingredient1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Ingredient1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Ingredient1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Ingredient1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "INGR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Ingredient1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.ingredientProductInstance is not None: self.ingredientProductInstance.export(outfile, level, namespace_, name_='ingredientProductInstance', pretty_print=pretty_print) if self.ingredientDeviceInstance is not None: self.ingredientDeviceInstance.export(outfile, level, namespace_, name_='ingredientDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassIngredientEntity(self.classCode) # validate type RoleClassIngredientEntity
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'ingredientProductInstance': obj_ = POCP_MT020200UV_ProductInstance.factory() obj_.build(child_) self.ingredientProductInstance = obj_ obj_.original_tagname_ = 'ingredientProductInstance' elif nodeName_ == 'ingredientDeviceInstance': obj_ = POCP_MT020200UV_DeviceInstance.factory() obj_.build(child_) self.ingredientDeviceInstance = obj_ obj_.original_tagname_ = 'ingredientDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020200UV_Ingredient1
[docs]class POCP_MT020200UV_InstanceOfKind(GeneratedsSuper): subclass = None superclass = None def __init__(self, classCode='INST', realmCode=None, typeId=None, templateId=None, quantity=None, productInstance=None, deviceInstance=None, kindOfProduct=None, subjectOf=None): self.original_tagname_ = None self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.productInstance = productInstance self.deviceInstance = deviceInstance self.kindOfProduct = kindOfProduct if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_InstanceOfKind) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_InstanceOfKind.subclass: return POCP_MT020200UV_InstanceOfKind.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_InstanceOfKind(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_productInstance(self): return self.productInstance
[docs] def set_productInstance(self, productInstance): self.productInstance = productInstance
[docs] def get_deviceInstance(self): return self.deviceInstance
[docs] def set_deviceInstance(self, deviceInstance): self.deviceInstance = deviceInstance
[docs] def get_kindOfProduct(self): return self.kindOfProduct
[docs] def set_kindOfProduct(self, kindOfProduct): self.kindOfProduct = kindOfProduct
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_RoleClassInstance(self, value): # Validate type RoleClassInstance, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INST'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassInstance' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassInstance_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassInstance_patterns_, ))
validate_RoleClassInstance_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.productInstance is not None or self.deviceInstance is not None or self.kindOfProduct is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.InstanceOfKind', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.InstanceOfKind') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.InstanceOfKind', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.InstanceOfKind'): if self.classCode != "INST" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.InstanceOfKind', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.productInstance is not None: self.productInstance.export(outfile, level, namespace_, name_='productInstance', pretty_print=pretty_print) if self.deviceInstance is not None: self.deviceInstance.export(outfile, level, namespace_, name_='deviceInstance', pretty_print=pretty_print) if self.kindOfProduct is not None: self.kindOfProduct.export(outfile, level, namespace_, name_='kindOfProduct', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassInstance(self.classCode) # validate type RoleClassInstance
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': obj_ = RTO_PQ_PQ.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'productInstance': obj_ = POCP_MT020200UV_ProductInstance.factory() obj_.build(child_) self.productInstance = obj_ obj_.original_tagname_ = 'productInstance' elif nodeName_ == 'deviceInstance': obj_ = POCP_MT020200UV_DeviceInstance.factory() obj_.build(child_) self.deviceInstance = obj_ obj_.original_tagname_ = 'deviceInstance' elif nodeName_ == 'kindOfProduct': obj_ = POCP_MT010200UV_Product.factory() obj_.build(child_) self.kindOfProduct = obj_ obj_.original_tagname_ = 'kindOfProduct' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020200UV_InstanceOfKind
[docs]class POCP_MT020200UV_InstanceOfKind2(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='INST', realmCode=None, typeId=None, templateId=None, kindOfMaterialKind=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.kindOfMaterialKind = kindOfMaterialKind
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_InstanceOfKind2) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_InstanceOfKind2.subclass: return POCP_MT020200UV_InstanceOfKind2.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_InstanceOfKind2(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_kindOfMaterialKind(self): return self.kindOfMaterialKind
[docs] def set_kindOfMaterialKind(self, kindOfMaterialKind): self.kindOfMaterialKind = kindOfMaterialKind
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassInstance(self, value): # Validate type RoleClassInstance, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INST'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassInstance' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassInstance_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassInstance_patterns_, ))
validate_RoleClassInstance_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.kindOfMaterialKind is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.InstanceOfKind2', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.InstanceOfKind2') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.InstanceOfKind2', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.InstanceOfKind2'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "INST" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.InstanceOfKind2', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.kindOfMaterialKind is not None: self.kindOfMaterialKind.export(outfile, level, namespace_, name_='kindOfMaterialKind', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassInstance(self.classCode) # validate type RoleClassInstance
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'kindOfMaterialKind': obj_ = POCP_MT010400UV_MaterialKind.factory() obj_.build(child_) self.kindOfMaterialKind = obj_ obj_.original_tagname_ = 'kindOfMaterialKind'
# end class POCP_MT020200UV_InstanceOfKind2
[docs]class POCP_MT020200UV_Member(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MBR', realmCode=None, typeId=None, templateId=None, groupProductInstance=None, groupDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.groupProductInstance = groupProductInstance self.groupDeviceInstance = groupDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Member) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Member.subclass: return POCP_MT020200UV_Member.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Member(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_groupProductInstance(self): return self.groupProductInstance
[docs] def set_groupProductInstance(self, groupProductInstance): self.groupProductInstance = groupProductInstance
[docs] def get_groupDeviceInstance(self): return self.groupDeviceInstance
[docs] def set_groupDeviceInstance(self, groupDeviceInstance): self.groupDeviceInstance = groupDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassMember(self, value): # Validate type RoleClassMember, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MBR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassMember' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassMember_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassMember_patterns_, ))
validate_RoleClassMember_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.groupProductInstance is not None or self.groupDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Member', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Member') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Member', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Member'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MBR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Member', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.groupProductInstance is not None: self.groupProductInstance.export(outfile, level, namespace_, name_='groupProductInstance', pretty_print=pretty_print) if self.groupDeviceInstance is not None: self.groupDeviceInstance.export(outfile, level, namespace_, name_='groupDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassMember(self.classCode) # validate type RoleClassMember
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'groupProductInstance': obj_ = POCP_MT020200UV_ProductInstance.factory() obj_.build(child_) self.groupProductInstance = obj_ obj_.original_tagname_ = 'groupProductInstance' elif nodeName_ == 'groupDeviceInstance': obj_ = POCP_MT020200UV_DeviceInstance.factory() obj_.build(child_) self.groupDeviceInstance = obj_ obj_.original_tagname_ = 'groupDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020200UV_Member
[docs]class POCP_MT020200UV_Member1(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MBR', realmCode=None, typeId=None, templateId=None, memberProductInstance=None, memberDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.memberProductInstance = memberProductInstance self.memberDeviceInstance = memberDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Member1) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Member1.subclass: return POCP_MT020200UV_Member1.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Member1(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_memberProductInstance(self): return self.memberProductInstance
[docs] def set_memberProductInstance(self, memberProductInstance): self.memberProductInstance = memberProductInstance
[docs] def get_memberDeviceInstance(self): return self.memberDeviceInstance
[docs] def set_memberDeviceInstance(self, memberDeviceInstance): self.memberDeviceInstance = memberDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassMember(self, value): # Validate type RoleClassMember, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MBR'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassMember' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassMember_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassMember_patterns_, ))
validate_RoleClassMember_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.memberProductInstance is not None or self.memberDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Member1', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Member1') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Member1', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Member1'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MBR" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Member1', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.memberProductInstance is not None: self.memberProductInstance.export(outfile, level, namespace_, name_='memberProductInstance', pretty_print=pretty_print) if self.memberDeviceInstance is not None: self.memberDeviceInstance.export(outfile, level, namespace_, name_='memberDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassMember(self.classCode) # validate type RoleClassMember
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'memberProductInstance': obj_ = POCP_MT020200UV_ProductInstance.factory() obj_.build(child_) self.memberProductInstance = obj_ obj_.original_tagname_ = 'memberProductInstance' elif nodeName_ == 'memberDeviceInstance': obj_ = POCP_MT020200UV_DeviceInstance.factory() obj_.build(child_) self.memberDeviceInstance = obj_ obj_.original_tagname_ = 'memberDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020200UV_Member1
[docs]class POCP_MT020200UV_Part(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='PART', realmCode=None, typeId=None, templateId=None, partProductInstance=None, partDeviceInstance=None, subjectOf=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.partProductInstance = partProductInstance self.partDeviceInstance = partDeviceInstance if subjectOf is None: self.subjectOf = [] else: self.subjectOf = subjectOf
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Part) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Part.subclass: return POCP_MT020200UV_Part.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Part(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_partProductInstance(self): return self.partProductInstance
[docs] def set_partProductInstance(self, partProductInstance): self.partProductInstance = partProductInstance
[docs] def get_partDeviceInstance(self): return self.partDeviceInstance
[docs] def set_partDeviceInstance(self, partDeviceInstance): self.partDeviceInstance = partDeviceInstance
[docs] def get_subjectOf(self): return self.subjectOf
[docs] def set_subjectOf(self, subjectOf): self.subjectOf = subjectOf
[docs] def add_subjectOf(self, value): self.subjectOf.append(value)
[docs] def insert_subjectOf_at(self, index, value): self.subjectOf.insert(index, value)
[docs] def replace_subjectOf_at(self, index, value): self.subjectOf[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_RoleClassPart(self, value): # Validate type RoleClassPart, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['PART', 'ACTM'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on RoleClassPart' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_RoleClassPart_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_RoleClassPart_patterns_, ))
validate_RoleClassPart_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.partProductInstance is not None or self.partDeviceInstance is not None or self.subjectOf ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Part', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Part') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Part', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Part'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "PART" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Part', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.partProductInstance is not None: self.partProductInstance.export(outfile, level, namespace_, name_='partProductInstance', pretty_print=pretty_print) if self.partDeviceInstance is not None: self.partDeviceInstance.export(outfile, level, namespace_, name_='partDeviceInstance', pretty_print=pretty_print) for subjectOf_ in self.subjectOf: subjectOf_.export(outfile, level, namespace_, name_='subjectOf', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_RoleClassPart(self.classCode) # validate type RoleClassPart
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'partProductInstance': obj_ = POCP_MT020200UV_ProductInstance.factory() obj_.build(child_) self.partProductInstance = obj_ obj_.original_tagname_ = 'partProductInstance' elif nodeName_ == 'partDeviceInstance': obj_ = POCP_MT020200UV_DeviceInstance.factory() obj_.build(child_) self.partDeviceInstance = obj_ obj_.original_tagname_ = 'partDeviceInstance' elif nodeName_ == 'subjectOf': obj_ = POCP_MT020200UV_Subject.factory() obj_.build(child_) self.subjectOf.append(obj_) obj_.original_tagname_ = 'subjectOf'
# end class POCP_MT020200UV_Part
[docs]class POCP_MT020200UV_ProductIdentifierIssuer(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='ORG', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, name=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId if id is None: self.id = [] else: self.id = id self.name = name
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_ProductIdentifierIssuer) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_ProductIdentifierIssuer.subclass: return POCP_MT020200UV_ProductIdentifierIssuer.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_ProductIdentifierIssuer(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def add_id(self, value): self.id.append(value)
[docs] def insert_id_at(self, index, value): self.id.insert(index, value)
[docs] def replace_id_at(self, index, value): self.id[index] = value
[docs] def get_name(self): return self.name
[docs] def set_name(self, name): self.name = name
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassOrganization(self, value): # Validate type EntityClassOrganization, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ORG', 'PUB', 'STATE', 'NAT'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassOrganization' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassOrganization_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassOrganization_patterns_, ))
validate_EntityClassOrganization_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id or self.name is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.ProductIdentifierIssuer', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.ProductIdentifierIssuer') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.ProductIdentifierIssuer', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.ProductIdentifierIssuer'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "ORG" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.ProductIdentifierIssuer', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) for id_ in self.id: id_.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.name is not None: self.name.export(outfile, level, namespace_, name_='name', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassOrganization(self.classCode) # validate type EntityClassOrganization value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id.append(obj_) obj_.original_tagname_ = 'id' elif nodeName_ == 'name': obj_ = ON.factory() obj_.build(child_) self.name = obj_ obj_.original_tagname_ = 'name'
# end class POCP_MT020200UV_ProductIdentifierIssuer
[docs]class POCP_MT020200UV_ProductInstance(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, classCode='MMAT', determinerCode='INSTANCE', realmCode=None, typeId=None, templateId=None, id=None, quantity=None, desc=None, existenceTime=None, expirationTime=None, stabilityTime=None, asIdentifiedItem=None, asContent=None, asMember=None, asInstanceOfKind=None, part=None, ingredient=None, member=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.classCode = _cast(None, classCode) self.determinerCode = _cast(None, determinerCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.id = id self.quantity = quantity self.desc = desc self.existenceTime = existenceTime self.expirationTime = expirationTime self.stabilityTime = stabilityTime if asIdentifiedItem is None: self.asIdentifiedItem = [] else: self.asIdentifiedItem = asIdentifiedItem self.asContent = asContent self.asMember = asMember self.asInstanceOfKind = asInstanceOfKind if part is None: self.part = [] else: self.part = part if ingredient is None: self.ingredient = [] else: self.ingredient = ingredient if member is None: self.member = [] else: self.member = member
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_ProductInstance) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_ProductInstance.subclass: return POCP_MT020200UV_ProductInstance.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_ProductInstance(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_id(self): return self.id
[docs] def set_id(self, id): self.id = id
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_desc(self): return self.desc
[docs] def set_desc(self, desc): self.desc = desc
[docs] def get_existenceTime(self): return self.existenceTime
[docs] def set_existenceTime(self, existenceTime): self.existenceTime = existenceTime
[docs] def get_expirationTime(self): return self.expirationTime
[docs] def set_expirationTime(self, expirationTime): self.expirationTime = expirationTime
[docs] def get_stabilityTime(self): return self.stabilityTime
[docs] def set_stabilityTime(self, stabilityTime): self.stabilityTime = stabilityTime
[docs] def get_asIdentifiedItem(self): return self.asIdentifiedItem
[docs] def set_asIdentifiedItem(self, asIdentifiedItem): self.asIdentifiedItem = asIdentifiedItem
[docs] def add_asIdentifiedItem(self, value): self.asIdentifiedItem.append(value)
[docs] def insert_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem.insert(index, value)
[docs] def replace_asIdentifiedItem_at(self, index, value): self.asIdentifiedItem[index] = value
[docs] def get_asContent(self): return self.asContent
[docs] def set_asContent(self, asContent): self.asContent = asContent
[docs] def get_asMember(self): return self.asMember
[docs] def set_asMember(self, asMember): self.asMember = asMember
[docs] def get_asInstanceOfKind(self): return self.asInstanceOfKind
[docs] def set_asInstanceOfKind(self, asInstanceOfKind): self.asInstanceOfKind = asInstanceOfKind
[docs] def get_part(self): return self.part
[docs] def set_part(self, part): self.part = part
[docs] def add_part(self, value): self.part.append(value)
[docs] def insert_part_at(self, index, value): self.part.insert(index, value)
[docs] def replace_part_at(self, index, value): self.part[index] = value
[docs] def get_ingredient(self): return self.ingredient
[docs] def set_ingredient(self, ingredient): self.ingredient = ingredient
[docs] def add_ingredient(self, value): self.ingredient.append(value)
[docs] def insert_ingredient_at(self, index, value): self.ingredient.insert(index, value)
[docs] def replace_ingredient_at(self, index, value): self.ingredient[index] = value
[docs] def get_member(self): return self.member
[docs] def set_member(self, member): self.member = member
[docs] def add_member(self, value): self.member.append(value)
[docs] def insert_member_at(self, index, value): self.member.insert(index, value)
[docs] def replace_member_at(self, index, value): self.member[index] = value
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_classCode(self): return self.classCode
[docs] def set_classCode(self, classCode): self.classCode = classCode
[docs] def get_determinerCode(self): return self.determinerCode
[docs] def set_determinerCode(self, determinerCode): self.determinerCode = determinerCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityClassManufacturedMaterial(self, value): # Validate type EntityClassManufacturedMaterial, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['MMAT', 'CONT', 'HOLD', 'DEV', 'CER', 'MODDV'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityClassManufacturedMaterial' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityClassManufacturedMaterial_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityClassManufacturedMaterial_patterns_, ))
validate_EntityClassManufacturedMaterial_patterns_ = [['^[^\\s]+$']]
[docs] def validate_EntityDeterminerSpecific(self, value): # Validate type EntityDeterminerSpecific, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['INSTANCE', 'GROUP'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on EntityDeterminerSpecific' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_EntityDeterminerSpecific_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_EntityDeterminerSpecific_patterns_, ))
validate_EntityDeterminerSpecific_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.id is not None or self.quantity is not None or self.desc is not None or self.existenceTime is not None or self.expirationTime is not None or self.stabilityTime is not None or self.asIdentifiedItem or self.asContent is not None or self.asMember is not None or self.asInstanceOfKind is not None or self.part or self.ingredient or self.member ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.ProductInstance', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.ProductInstance') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.ProductInstance', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.ProductInstance'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.classCode != "MMAT" and 'classCode' not in already_processed: already_processed.add('classCode') outfile.write(' classCode=%s' % (quote_attrib(self.classCode), )) if self.determinerCode != "INSTANCE" and 'determinerCode' not in already_processed: already_processed.add('determinerCode') outfile.write(' determinerCode=%s' % (quote_attrib(self.determinerCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.ProductInstance', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.id is not None: self.id.export(outfile, level, namespace_, name_='id', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.desc is not None: self.desc.export(outfile, level, namespace_, name_='desc', pretty_print=pretty_print) if self.existenceTime is not None: self.existenceTime.export(outfile, level, namespace_, name_='existenceTime', pretty_print=pretty_print) if self.expirationTime is not None: self.expirationTime.export(outfile, level, namespace_, name_='expirationTime', pretty_print=pretty_print) if self.stabilityTime is not None: self.stabilityTime.export(outfile, level, namespace_, name_='stabilityTime', pretty_print=pretty_print) for asIdentifiedItem_ in self.asIdentifiedItem: asIdentifiedItem_.export(outfile, level, namespace_, name_='asIdentifiedItem', pretty_print=pretty_print) if self.asContent is not None: self.asContent.export(outfile, level, namespace_, name_='asContent', pretty_print=pretty_print) if self.asMember is not None: self.asMember.export(outfile, level, namespace_, name_='asMember', pretty_print=pretty_print) if self.asInstanceOfKind is not None: self.asInstanceOfKind.export(outfile, level, namespace_, name_='asInstanceOfKind', pretty_print=pretty_print) for part_ in self.part: part_.export(outfile, level, namespace_, name_='part', pretty_print=pretty_print) for ingredient_ in self.ingredient: ingredient_.export(outfile, level, namespace_, name_='ingredient', pretty_print=pretty_print) for member_ in self.member: member_.export(outfile, level, namespace_, name_='member', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('classCode', node) if value is not None and 'classCode' not in already_processed: already_processed.add('classCode') self.classCode = value self.validate_EntityClassManufacturedMaterial(self.classCode) # validate type EntityClassManufacturedMaterial value = find_attr_value_('determinerCode', node) if value is not None and 'determinerCode' not in already_processed: already_processed.add('determinerCode') self.determinerCode = value self.validate_EntityDeterminerSpecific(self.determinerCode) # validate type EntityDeterminerSpecific
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'id': obj_ = II.factory() obj_.build(child_) self.id = obj_ obj_.original_tagname_ = 'id' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'desc': obj_ = ED.factory() obj_.build(child_) self.desc = obj_ obj_.original_tagname_ = 'desc' elif nodeName_ == 'existenceTime': obj_ = IVL_TS.factory() obj_.build(child_) self.existenceTime = obj_ obj_.original_tagname_ = 'existenceTime' elif nodeName_ == 'expirationTime': obj_ = IVL_TS.factory() obj_.build(child_) self.expirationTime = obj_ obj_.original_tagname_ = 'expirationTime' elif nodeName_ == 'stabilityTime': obj_ = IVL_TS.factory() obj_.build(child_) self.stabilityTime = obj_ obj_.original_tagname_ = 'stabilityTime' elif nodeName_ == 'asIdentifiedItem': obj_ = POCP_MT020200UV_IdentifiedItem.factory() obj_.build(child_) self.asIdentifiedItem.append(obj_) obj_.original_tagname_ = 'asIdentifiedItem' elif nodeName_ == 'asContent': obj_ = POCP_MT020200UV_Content2.factory() obj_.build(child_) self.asContent = obj_ obj_.original_tagname_ = 'asContent' elif nodeName_ == 'asMember': obj_ = POCP_MT020200UV_Member.factory() obj_.build(child_) self.asMember = obj_ obj_.original_tagname_ = 'asMember' elif nodeName_ == 'asInstanceOfKind': obj_ = POCP_MT020200UV_InstanceOfKind2.factory() obj_.build(child_) self.asInstanceOfKind = obj_ obj_.original_tagname_ = 'asInstanceOfKind' elif nodeName_ == 'part': obj_ = POCP_MT020200UV_Part.factory() obj_.build(child_) self.part.append(obj_) obj_.original_tagname_ = 'part' elif nodeName_ == 'ingredient': obj_ = POCP_MT020200UV_Ingredient1.factory() obj_.build(child_) self.ingredient.append(obj_) obj_.original_tagname_ = 'ingredient' elif nodeName_ == 'member': obj_ = POCP_MT020200UV_Member1.factory() obj_.build(child_) self.member.append(obj_) obj_.original_tagname_ = 'member'
# end class POCP_MT020200UV_ProductInstance
[docs]class POCP_MT020200UV_Subject(GeneratedsSuper): subclass = None superclass = None def __init__(self, nullFlavor=None, typeCode='SBJ', realmCode=None, typeId=None, templateId=None, quantity=None, productEvent=None, observationEvent=None, transportationEvent=None): self.original_tagname_ = None self.nullFlavor = _cast(None, nullFlavor) self.typeCode = _cast(None, typeCode) if realmCode is None: self.realmCode = [] else: self.realmCode = realmCode self.typeId = typeId if templateId is None: self.templateId = [] else: self.templateId = templateId self.quantity = quantity self.productEvent = productEvent self.observationEvent = observationEvent self.transportationEvent = transportationEvent
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, POCP_MT020200UV_Subject) if subclass is not None: return subclass(*args_, **kwargs_) if POCP_MT020200UV_Subject.subclass: return POCP_MT020200UV_Subject.subclass(*args_, **kwargs_) else: return POCP_MT020200UV_Subject(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_realmCode(self): return self.realmCode
[docs] def set_realmCode(self, realmCode): self.realmCode = realmCode
[docs] def add_realmCode(self, value): self.realmCode.append(value)
[docs] def insert_realmCode_at(self, index, value): self.realmCode.insert(index, value)
[docs] def replace_realmCode_at(self, index, value): self.realmCode[index] = value
[docs] def get_typeId(self): return self.typeId
[docs] def set_typeId(self, typeId): self.typeId = typeId
[docs] def get_templateId(self): return self.templateId
[docs] def set_templateId(self, templateId): self.templateId = templateId
[docs] def add_templateId(self, value): self.templateId.append(value)
[docs] def insert_templateId_at(self, index, value): self.templateId.insert(index, value)
[docs] def replace_templateId_at(self, index, value): self.templateId[index] = value
[docs] def get_quantity(self): return self.quantity
[docs] def set_quantity(self, quantity): self.quantity = quantity
[docs] def get_productEvent(self): return self.productEvent
[docs] def set_productEvent(self, productEvent): self.productEvent = productEvent
[docs] def get_observationEvent(self): return self.observationEvent
[docs] def set_observationEvent(self, observationEvent): self.observationEvent = observationEvent
[docs] def get_transportationEvent(self): return self.transportationEvent
[docs] def set_transportationEvent(self, transportationEvent): self.transportationEvent = transportationEvent
[docs] def get_nullFlavor(self): return self.nullFlavor
[docs] def set_nullFlavor(self, nullFlavor): self.nullFlavor = nullFlavor
[docs] def get_typeCode(self): return self.typeCode
[docs] def set_typeCode(self, typeCode): self.typeCode = typeCode
[docs] def validate_NullFlavor(self, value): # Validate type NullFlavor, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['ASKU', 'DER', 'INV', 'MSK', 'NA', 'NASK', 'NAV', 'NI', 'NINF', 'OTH', 'PINF', 'QS', 'TRC', 'UNC', 'UNK'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on NullFlavor' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_NullFlavor_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_NullFlavor_patterns_, ))
validate_NullFlavor_patterns_ = [['^[^\\s]+$']]
[docs] def validate_ParticipationTargetSubject(self, value): # Validate type ParticipationTargetSubject, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['SBJ', 'SPC'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ParticipationTargetSubject' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ParticipationTargetSubject_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ParticipationTargetSubject_patterns_, ))
validate_ParticipationTargetSubject_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.realmCode or self.typeId is not None or self.templateId or self.quantity is not None or self.productEvent is not None or self.observationEvent is not None or self.transportationEvent is not None ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Subject', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='POCP_MT020200UV.Subject') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='POCP_MT020200UV.Subject', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='POCP_MT020200UV.Subject'): if self.nullFlavor is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') outfile.write(' nullFlavor=%s' % (quote_attrib(self.nullFlavor), )) if self.typeCode != "SBJ" and 'typeCode' not in already_processed: already_processed.add('typeCode') outfile.write(' typeCode=%s' % (quote_attrib(self.typeCode), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='POCP_MT020200UV.Subject', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for realmCode_ in self.realmCode: realmCode_.export(outfile, level, namespace_, name_='realmCode', pretty_print=pretty_print) if self.typeId is not None: self.typeId.export(outfile, level, namespace_, name_='typeId', pretty_print=pretty_print) for templateId_ in self.templateId: templateId_.export(outfile, level, namespace_, name_='templateId', pretty_print=pretty_print) if self.quantity is not None: self.quantity.export(outfile, level, namespace_, name_='quantity', pretty_print=pretty_print) if self.productEvent is not None: self.productEvent.export(outfile, level, namespace_, name_='productEvent', pretty_print=pretty_print) if self.observationEvent is not None: self.observationEvent.export(outfile, level, namespace_, name_='observationEvent', pretty_print=pretty_print) if self.transportationEvent is not None: self.transportationEvent.export(outfile, level, namespace_, name_='transportationEvent', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('nullFlavor', node) if value is not None and 'nullFlavor' not in already_processed: already_processed.add('nullFlavor') self.nullFlavor = value self.validate_NullFlavor(self.nullFlavor) # validate type NullFlavor value = find_attr_value_('typeCode', node) if value is not None and 'typeCode' not in already_processed: already_processed.add('typeCode') self.typeCode = value self.validate_ParticipationTargetSubject(self.typeCode) # validate type ParticipationTargetSubject
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'realmCode': obj_ = CS.factory() obj_.build(child_) self.realmCode.append(obj_) obj_.original_tagname_ = 'realmCode' elif nodeName_ == 'typeId': obj_ = II.factory() obj_.build(child_) self.typeId = obj_ obj_.original_tagname_ = 'typeId' elif nodeName_ == 'templateId': obj_ = II.factory() obj_.build(child_) self.templateId.append(obj_) obj_.original_tagname_ = 'templateId' elif nodeName_ == 'quantity': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.quantity = obj_ obj_.original_tagname_ = 'quantity' elif nodeName_ == 'productEvent': obj_ = POCP_MT040100UV_ProductEvent.factory() obj_.build(child_) self.productEvent = obj_ obj_.original_tagname_ = 'productEvent' elif nodeName_ == 'observationEvent': obj_ = POCP_MT040100UV_ObservationEvent.factory() obj_.build(child_) self.observationEvent = obj_ obj_.original_tagname_ = 'observationEvent' elif nodeName_ == 'transportationEvent': obj_ = POCP_MT040100UV_TransportationEvent.factory() obj_.build(child_) self.transportationEvent = obj_ obj_.original_tagname_ = 'transportationEvent'
# end class POCP_MT020200UV_Subject
[docs]class RTO(RTO_QTY_QTY): """A quantity constructed as the quotient of a numerator quantity divided by a denominator quantity. Common factors in the numerator and denominator are not automatically cancelled out. supports titers (e.g., "1:128") and other quantities produced by laboratories that truly represent ratios. Ratios are not simply "structured numerics", particularly blood pressure measurements (e.g. "120/60") are not ratios. In many cases REAL should be used instead of .""" subclass = None superclass = RTO_QTY_QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, numerator=None, denominator=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(RTO, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, numerator, denominator, valueOf_, mixedclass_, content_, ) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, RTO) if subclass is not None: return subclass(*args_, **kwargs_) if RTO.subclass: return RTO.subclass(*args_, **kwargs_) else: return RTO(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(RTO, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='RTO', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='RTO') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='RTO', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='RTO'): super(RTO, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RTO')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='RTO', fromsubclass_=False, pretty_print=True): super(RTO, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(RTO, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(RTO, self).buildChildren(child_, node, nodeName_, True) pass
# end class RTO
[docs]class TS(QTY): """A quantity specifying a point on the axis of natural time. A point in time is most often represented as a calendar expression.""" subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, valueOf_, mixedclass_, content_, extensiontype_, ) self.value = _cast(None, value) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, TS) if subclass is not None: return subclass(*args_, **kwargs_) if TS.subclass: return TS.subclass(*args_, **kwargs_) else: return TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_value(self): return self.value
[docs] def set_value(self, value): self.value = value
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_ts(self, value): # Validate type ts, a restriction on xs:string. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_ts_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ts_patterns_, ))
validate_ts_patterns_ = [['^[0-9]{1,8}$|^([0-9]{9,14}$|^[0-9]{14,14}\\.[0-9]+)([+\\-][0-9]{1,4})?$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TS'): super(TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='TS') if self.value is not None and 'value' not in already_processed: already_processed.add('value') outfile.write(' value=%s' % (quote_attrib(self.value), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='TS', fromsubclass_=False, pretty_print=True): super(TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('value', node) if value is not None and 'value' not in already_processed: already_processed.add('value') self.value = value self.validate_ts(self.value) # validate type ts value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(TS, self).buildChildren(child_, node, nodeName_, True) pass
# end class TS
[docs]class URXB_PQ(PQ): """Specifies whether the limit is included in the uncertain range (range is closed) or excluded from the uncertain range (range is open).""" subclass = None superclass = PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, inclusive='true'): self.original_tagname_ = None super(URXB_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, ) self.inclusive = _cast(None, inclusive)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, URXB_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if URXB_PQ.subclass: return URXB_PQ.subclass(*args_, **kwargs_) else: return URXB_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(URXB_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='URXB_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='URXB_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='URXB_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='URXB_PQ'): super(URXB_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='URXB_PQ') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='URXB_PQ', fromsubclass_=False, pretty_print=True): super(URXB_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(URXB_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(URXB_PQ, self).buildChildren(child_, node, nodeName_, True) pass
# end class URXB_PQ
[docs]class UVP_PQ(PQ): """The probability assigned to the value, a decimal number between 0 (very uncertain) and 1 (certain).""" subclass = None superclass = PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, probability=None, extensiontype_=None): self.original_tagname_ = None super(UVP_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, extensiontype_, ) self.probability = _cast(float, probability) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, UVP_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if UVP_PQ.subclass: return UVP_PQ.subclass(*args_, **kwargs_) else: return UVP_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_probability(self): return self.probability
[docs] def set_probability(self, probability): self.probability = probability
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self): if ( super(UVP_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='UVP_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='UVP_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='UVP_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UVP_PQ'): super(UVP_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='UVP_PQ') if self.probability is not None and 'probability' not in already_processed: already_processed.add('probability') outfile.write(' probability="%s"' % self.gds_format_float(self.probability, input_name='probability')) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='UVP_PQ', fromsubclass_=False, pretty_print=True): super(UVP_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('probability', node) if value is not None and 'probability' not in already_processed: already_processed.add('probability') try: self.probability = float(value) except ValueError as exp: raise ValueError('Bad float/double attribute (probability): %s' % exp) value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(UVP_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(UVP_PQ, self).buildChildren(child_, node, nodeName_, True) pass
# end class UVP_PQ
[docs]class EXPR_PQ(PQ): subclass = None superclass = PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, expression=None): self.original_tagname_ = None super(EXPR_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, ) self.expression = expression
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, EXPR_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if EXPR_PQ.subclass: return EXPR_PQ.subclass(*args_, **kwargs_) else: return EXPR_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_expression(self): return self.expression
[docs] def set_expression(self, expression): self.expression = expression
[docs] def hasContent_(self): if ( self.expression is not None or super(EXPR_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='EXPR_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='EXPR_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='EXPR_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EXPR_PQ'): super(EXPR_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EXPR_PQ')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='EXPR_PQ', fromsubclass_=False, pretty_print=True): super(EXPR_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.expression is not None: self.expression.export(outfile, level, namespace_, name_='expression', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(EXPR_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'expression': obj_ = ED.factory() obj_.build(child_) self.expression = obj_ obj_.original_tagname_ = 'expression' super(EXPR_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class EXPR_PQ
[docs]class UVP_TS(TS): """The probability assigned to the value, a decimal number between 0 (very uncertain) and 1 (certain).""" subclass = None superclass = TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, probability=None): self.original_tagname_ = None super(UVP_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, ) self.probability = _cast(None, probability)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, UVP_TS) if subclass is not None: return subclass(*args_, **kwargs_) if UVP_TS.subclass: return UVP_TS.subclass(*args_, **kwargs_) else: return UVP_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_probability(self): return self.probability
[docs] def set_probability(self, probability): self.probability = probability
[docs] def validate_probability(self, value): # Validate type probability, a restriction on xs:double. if value is not None and Validate_simpletypes_: if value < 0.0: warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on probability' % {"value" : value} ) if value > 1.0: warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on probability' % {"value" : value} )
[docs] def hasContent_(self): if ( super(UVP_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='UVP_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='UVP_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='UVP_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='UVP_TS'): super(UVP_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='UVP_TS') if self.probability is not None and 'probability' not in already_processed: already_processed.add('probability') outfile.write(' probability=%s' % (quote_attrib(self.probability), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='UVP_TS', fromsubclass_=False, pretty_print=True): super(UVP_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('probability', node) if value is not None and 'probability' not in already_processed: already_processed.add('probability') try: self.probability = float(value) except ValueError as exp: raise ValueError('Bad float/double attribute (probability): %s' % exp) self.validate_probability(self.probability) # validate type probability super(UVP_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(UVP_TS, self).buildChildren(child_, node, nodeName_, True) pass
# end class UVP_TS
[docs]class RTO_MO_PQ(QTY): subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, numerator=None, denominator=None): self.original_tagname_ = None super(RTO_MO_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, ) self.numerator = numerator self.denominator = denominator
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, RTO_MO_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if RTO_MO_PQ.subclass: return RTO_MO_PQ.subclass(*args_, **kwargs_) else: return RTO_MO_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_numerator(self): return self.numerator
[docs] def set_numerator(self, numerator): self.numerator = numerator
[docs] def get_denominator(self): return self.denominator
[docs] def set_denominator(self, denominator): self.denominator = denominator
[docs] def hasContent_(self): if ( self.numerator is not None or self.denominator is not None or super(RTO_MO_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='RTO_MO_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_MO_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='RTO_MO_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='RTO_MO_PQ'): super(RTO_MO_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_MO_PQ')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='RTO_MO_PQ', fromsubclass_=False, pretty_print=True): super(RTO_MO_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.numerator is not None: self.numerator.export(outfile, level, namespace_, name_='numerator', pretty_print=pretty_print) if self.denominator is not None: self.denominator.export(outfile, level, namespace_, name_='denominator', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(RTO_MO_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'numerator': class_obj_ = self.get_class_obj_(child_, MO) obj_ = class_obj_.factory() obj_.build(child_) self.numerator = obj_ obj_.original_tagname_ = 'numerator' elif nodeName_ == 'denominator': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.denominator = obj_ obj_.original_tagname_ = 'denominator' super(RTO_MO_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class RTO_MO_PQ
[docs]class RTO_PQ_PQ(QTY): subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, numerator=None, denominator=None): self.original_tagname_ = None super(RTO_PQ_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, ) self.numerator = numerator self.denominator = denominator
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, RTO_PQ_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if RTO_PQ_PQ.subclass: return RTO_PQ_PQ.subclass(*args_, **kwargs_) else: return RTO_PQ_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_numerator(self): return self.numerator
[docs] def set_numerator(self, numerator): self.numerator = numerator
[docs] def get_denominator(self): return self.denominator
[docs] def set_denominator(self, denominator): self.denominator = denominator
[docs] def hasContent_(self): if ( self.numerator is not None or self.denominator is not None or super(RTO_PQ_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='RTO_PQ_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_PQ_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='RTO_PQ_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='RTO_PQ_PQ'): super(RTO_PQ_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_PQ_PQ')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='RTO_PQ_PQ', fromsubclass_=False, pretty_print=True): super(RTO_PQ_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.numerator is not None: self.numerator.export(outfile, level, namespace_, name_='numerator', pretty_print=pretty_print) if self.denominator is not None: self.denominator.export(outfile, level, namespace_, name_='denominator', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(RTO_PQ_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'numerator': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.numerator = obj_ obj_.original_tagname_ = 'numerator' elif nodeName_ == 'denominator': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.denominator = obj_ obj_.original_tagname_ = 'denominator' super(RTO_PQ_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class RTO_PQ_PQ
[docs]class RTO_INT_PQ(QTY): subclass = None superclass = QTY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, numerator=None, denominator=None): self.original_tagname_ = None super(RTO_INT_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, ) self.numerator = numerator self.denominator = denominator
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, RTO_INT_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if RTO_INT_PQ.subclass: return RTO_INT_PQ.subclass(*args_, **kwargs_) else: return RTO_INT_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_numerator(self): return self.numerator
[docs] def set_numerator(self, numerator): self.numerator = numerator
[docs] def get_denominator(self): return self.denominator
[docs] def set_denominator(self, denominator): self.denominator = denominator
[docs] def hasContent_(self): if ( self.numerator is not None or self.denominator is not None or super(RTO_INT_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='RTO_INT_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_INT_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='RTO_INT_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='RTO_INT_PQ'): super(RTO_INT_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='RTO_INT_PQ')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='RTO_INT_PQ', fromsubclass_=False, pretty_print=True): super(RTO_INT_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.numerator is not None: self.numerator.export(outfile, level, namespace_, name_='numerator', pretty_print=pretty_print) if self.denominator is not None: self.denominator.export(outfile, level, namespace_, name_='denominator', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(RTO_INT_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'numerator': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.numerator = obj_ obj_.original_tagname_ = 'numerator' elif nodeName_ == 'denominator': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.denominator = obj_ obj_.original_tagname_ = 'denominator' super(RTO_INT_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class RTO_INT_PQ
[docs]class GLIST_PQ(ANY): """If non-NULL, specifies that the sequence alternates, i.e., after this many increments, the sequence item values roll over to start from the initial sequence item value. For example, the sequence (1; 2; 3; 1; 2; 3; 1; 2; 3; ...) has period 3; also the sequence (1; 1; 2; 2; 3; 3; 1; 1; 2; 2; 3; 3; ...) has period 3 too. The integer by which the index for the sequence is divided, effectively the number of times the sequence generates the same sequence item value before incrementing to the next sequence item value. For example, to generate the sequence (1; 1; 1; 2; 2; 2; 3; 3; 3; ...) the denominator is 3.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, period=None, denominator=None, head=None, increment=None): self.original_tagname_ = None super(GLIST_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, ) self.period = _cast(None, period) self.denominator = _cast(None, denominator) self.head = head self.increment = increment
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, GLIST_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if GLIST_PQ.subclass: return GLIST_PQ.subclass(*args_, **kwargs_) else: return GLIST_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_head(self): return self.head
[docs] def set_head(self, head): self.head = head
[docs] def get_increment(self): return self.increment
[docs] def set_increment(self, increment): self.increment = increment
[docs] def get_period(self): return self.period
[docs] def set_period(self, period): self.period = period
[docs] def get_denominator(self): return self.denominator
[docs] def set_denominator(self, denominator): self.denominator = denominator
[docs] def validate_int(self, value): # Validate type int, a restriction on xs:integer. if value is not None and Validate_simpletypes_: pass
[docs] def hasContent_(self): if ( self.head is not None or self.increment is not None or super(GLIST_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='GLIST_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='GLIST_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='GLIST_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='GLIST_PQ'): super(GLIST_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='GLIST_PQ') if self.period is not None and 'period' not in already_processed: already_processed.add('period') outfile.write(' period=%s' % (quote_attrib(self.period), )) if self.denominator is not None and 'denominator' not in already_processed: already_processed.add('denominator') outfile.write(' denominator=%s' % (quote_attrib(self.denominator), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='GLIST_PQ', fromsubclass_=False, pretty_print=True): super(GLIST_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.head is not None: self.head.export(outfile, level, namespace_, name_='head', pretty_print=pretty_print) if self.increment is not None: self.increment.export(outfile, level, namespace_, name_='increment', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('period', node) if value is not None and 'period' not in already_processed: already_processed.add('period') try: self.period = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.period) # validate type int value = find_attr_value_('denominator', node) if value is not None and 'denominator' not in already_processed: already_processed.add('denominator') try: self.denominator = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.denominator) # validate type int super(GLIST_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'head': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.head = obj_ obj_.original_tagname_ = 'head' elif nodeName_ == 'increment': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.increment = obj_ obj_.original_tagname_ = 'increment' super(GLIST_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class GLIST_PQ
[docs]class GLIST_TS(ANY): """If non-NULL, specifies that the sequence alternates, i.e., after this many increments, the sequence item values roll over to start from the initial sequence item value. For example, the sequence (1; 2; 3; 1; 2; 3; 1; 2; 3; ...) has period 3; also the sequence (1; 1; 2; 2; 3; 3; 1; 1; 2; 2; 3; 3; ...) has period 3 too. The integer by which the index for the sequence is divided, effectively the number of times the sequence generates the same sequence item value before incrementing to the next sequence item value. For example, to generate the sequence (1; 1; 1; 2; 2; 2; 3; 3; 3; ...) the denominator is 3.""" subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, period=None, denominator=None, head=None, increment=None): self.original_tagname_ = None super(GLIST_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, ) self.period = _cast(None, period) self.denominator = _cast(None, denominator) self.head = head self.increment = increment
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, GLIST_TS) if subclass is not None: return subclass(*args_, **kwargs_) if GLIST_TS.subclass: return GLIST_TS.subclass(*args_, **kwargs_) else: return GLIST_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_head(self): return self.head
[docs] def set_head(self, head): self.head = head
[docs] def get_increment(self): return self.increment
[docs] def set_increment(self, increment): self.increment = increment
[docs] def get_period(self): return self.period
[docs] def set_period(self, period): self.period = period
[docs] def get_denominator(self): return self.denominator
[docs] def set_denominator(self, denominator): self.denominator = denominator
[docs] def validate_int(self, value): # Validate type int, a restriction on xs:integer. if value is not None and Validate_simpletypes_: pass
[docs] def hasContent_(self): if ( self.head is not None or self.increment is not None or super(GLIST_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='GLIST_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='GLIST_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='GLIST_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='GLIST_TS'): super(GLIST_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='GLIST_TS') if self.period is not None and 'period' not in already_processed: already_processed.add('period') outfile.write(' period=%s' % (quote_attrib(self.period), )) if self.denominator is not None and 'denominator' not in already_processed: already_processed.add('denominator') outfile.write(' denominator=%s' % (quote_attrib(self.denominator), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='GLIST_TS', fromsubclass_=False, pretty_print=True): super(GLIST_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.head is not None: self.head.export(outfile, level, namespace_, name_='head', pretty_print=pretty_print) if self.increment is not None: self.increment.export(outfile, level, namespace_, name_='increment', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('period', node) if value is not None and 'period' not in already_processed: already_processed.add('period') try: self.period = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.period) # validate type int value = find_attr_value_('denominator', node) if value is not None and 'denominator' not in already_processed: already_processed.add('denominator') try: self.denominator = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.denominator) # validate type int super(GLIST_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'head': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.head = obj_ obj_.original_tagname_ = 'head' elif nodeName_ == 'increment': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.increment = obj_ obj_.original_tagname_ = 'increment' super(GLIST_TS, self).buildChildren(child_, node, nodeName_, True)
# end class GLIST_TS
[docs]class SLIST_TS(ANY): subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, origin=None, scale=None, digits=None): self.original_tagname_ = None super(SLIST_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, ) self.origin = origin self.scale = scale self.digits = digits self.validate_list_int(self.digits)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SLIST_TS) if subclass is not None: return subclass(*args_, **kwargs_) if SLIST_TS.subclass: return SLIST_TS.subclass(*args_, **kwargs_) else: return SLIST_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_origin(self): return self.origin
[docs] def set_origin(self, origin): self.origin = origin
[docs] def get_scale(self): return self.scale
[docs] def set_scale(self, scale): self.scale = scale
[docs] def get_digits(self): return self.digits
[docs] def set_digits(self, digits): self.digits = digits
[docs] def validate_list_int(self, value): # Validate type list_int, a restriction on int. pass
[docs] def hasContent_(self): if ( self.origin is not None or self.scale is not None or self.digits is not None or super(SLIST_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SLIST_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SLIST_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SLIST_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SLIST_TS'): super(SLIST_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SLIST_TS')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SLIST_TS', fromsubclass_=False, pretty_print=True): super(SLIST_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.origin is not None: self.origin.export(outfile, level, namespace_, name_='origin', pretty_print=pretty_print) if self.scale is not None: self.scale.export(outfile, level, namespace_, name_='scale', pretty_print=pretty_print) if self.digits is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdigits>%s</%sdigits>%s' % (namespace_, self.gds_format_integer_list(self.digits, input_name='digits'), namespace_, eol_))
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(SLIST_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'origin': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.origin = obj_ obj_.original_tagname_ = 'origin' elif nodeName_ == 'scale': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.scale = obj_ obj_.original_tagname_ = 'scale' elif nodeName_ == 'digits': digits_ = child_.text digits_ = self.gds_validate_integer_list(digits_, node, 'digits') self.digits = digits_ # validate type list_int self.validate_list_int(self.digits) super(SLIST_TS, self).buildChildren(child_, node, nodeName_, True)
# end class SLIST_TS
[docs]class SLIST_PQ(ANY): subclass = None superclass = ANY def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, origin=None, scale=None, digits=None): self.original_tagname_ = None super(SLIST_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, ) self.origin = origin self.scale = scale self.digits = digits self.validate_list_int(self.digits)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SLIST_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if SLIST_PQ.subclass: return SLIST_PQ.subclass(*args_, **kwargs_) else: return SLIST_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_origin(self): return self.origin
[docs] def set_origin(self, origin): self.origin = origin
[docs] def get_scale(self): return self.scale
[docs] def set_scale(self, scale): self.scale = scale
[docs] def get_digits(self): return self.digits
[docs] def set_digits(self, digits): self.digits = digits
[docs] def validate_list_int(self, value): # Validate type list_int, a restriction on int. pass
[docs] def hasContent_(self): if ( self.origin is not None or self.scale is not None or self.digits is not None or super(SLIST_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SLIST_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SLIST_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SLIST_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SLIST_PQ'): super(SLIST_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SLIST_PQ')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SLIST_PQ', fromsubclass_=False, pretty_print=True): super(SLIST_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.origin is not None: self.origin.export(outfile, level, namespace_, name_='origin', pretty_print=pretty_print) if self.scale is not None: self.scale.export(outfile, level, namespace_, name_='scale', pretty_print=pretty_print) if self.digits is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdigits>%s</%sdigits>%s' % (namespace_, self.gds_format_integer_list(self.digits, input_name='digits'), namespace_, eol_))
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(SLIST_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'origin': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.origin = obj_ obj_.original_tagname_ = 'origin' elif nodeName_ == 'scale': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.scale = obj_ obj_.original_tagname_ = 'scale' elif nodeName_ == 'digits': digits_ = child_.text digits_ = self.gds_validate_integer_list(digits_, node, 'digits') self.digits = digits_ # validate type list_int self.validate_list_int(self.digits) super(SLIST_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class SLIST_PQ
[docs]class BXIT_CD(CD): """The quantity in which the bag item occurs in its containing bag. The root of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc. The Extension of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc.""" subclass = None superclass = CD def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None, qty='1', controlInformationRoot=None, controlInformationExtension=None): self.original_tagname_ = None super(BXIT_CD, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, ) self.qty = _cast(None, qty) self.controlInformationRoot = _cast(None, controlInformationRoot) self.controlInformationExtension = _cast(None, controlInformationExtension)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, BXIT_CD) if subclass is not None: return subclass(*args_, **kwargs_) if BXIT_CD.subclass: return BXIT_CD.subclass(*args_, **kwargs_) else: return BXIT_CD(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_qty(self): return self.qty
[docs] def set_qty(self, qty): self.qty = qty
[docs] def get_controlInformationRoot(self): return self.controlInformationRoot
[docs] def set_controlInformationRoot(self, controlInformationRoot): self.controlInformationRoot = controlInformationRoot
[docs] def get_controlInformationExtension(self): return self.controlInformationExtension
[docs] def set_controlInformationExtension(self, controlInformationExtension): self.controlInformationExtension = controlInformationExtension
[docs] def validate_int(self, value): # Validate type int, a restriction on xs:integer. if value is not None and Validate_simpletypes_: pass
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( super(BXIT_CD, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='BXIT_CD', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='BXIT_CD') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='BXIT_CD', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='BXIT_CD'): super(BXIT_CD, self).exportAttributes(outfile, level, already_processed, namespace_, name_='BXIT_CD') if self.qty != 1 and 'qty' not in already_processed: already_processed.add('qty') outfile.write(' qty=%s' % (quote_attrib(self.qty), )) if self.controlInformationRoot is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') outfile.write(' controlInformationRoot=%s' % (quote_attrib(self.controlInformationRoot), )) if self.controlInformationExtension is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') outfile.write(' controlInformationExtension=%s' % (quote_attrib(self.controlInformationExtension), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='BXIT_CD', fromsubclass_=False, pretty_print=True): super(BXIT_CD, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('qty', node) if value is not None and 'qty' not in already_processed: already_processed.add('qty') try: self.qty = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.qty) # validate type int value = find_attr_value_('controlInformationRoot', node) if value is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') self.controlInformationRoot = value self.validate_uid(self.controlInformationRoot) # validate type uid value = find_attr_value_('controlInformationExtension', node) if value is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') self.controlInformationExtension = value self.validate_st(self.controlInformationExtension) # validate type st super(BXIT_CD, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(BXIT_CD, self).buildChildren(child_, node, nodeName_, True) pass
# end class BXIT_CD
[docs]class HXIT_CE(CE): """The root of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc. The Extension of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc.""" subclass = None superclass = CE def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None, controlInformationRoot=None, controlInformationExtension=None, validTime=None): self.original_tagname_ = None super(HXIT_CE, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, ) self.controlInformationRoot = _cast(None, controlInformationRoot) self.controlInformationExtension = _cast(None, controlInformationExtension) self.validTime = validTime
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, HXIT_CE) if subclass is not None: return subclass(*args_, **kwargs_) if HXIT_CE.subclass: return HXIT_CE.subclass(*args_, **kwargs_) else: return HXIT_CE(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_validTime(self): return self.validTime
[docs] def set_validTime(self, validTime): self.validTime = validTime
[docs] def get_controlInformationRoot(self): return self.controlInformationRoot
[docs] def set_controlInformationRoot(self, controlInformationRoot): self.controlInformationRoot = controlInformationRoot
[docs] def get_controlInformationExtension(self): return self.controlInformationExtension
[docs] def set_controlInformationExtension(self, controlInformationExtension): self.controlInformationExtension = controlInformationExtension
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.validTime is not None or super(HXIT_CE, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='HXIT_CE', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='HXIT_CE') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='HXIT_CE', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='HXIT_CE'): super(HXIT_CE, self).exportAttributes(outfile, level, already_processed, namespace_, name_='HXIT_CE') if self.controlInformationRoot is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') outfile.write(' controlInformationRoot=%s' % (quote_attrib(self.controlInformationRoot), )) if self.controlInformationExtension is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') outfile.write(' controlInformationExtension=%s' % (quote_attrib(self.controlInformationExtension), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='HXIT_CE', fromsubclass_=False, pretty_print=True): super(HXIT_CE, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.validTime is not None: self.validTime.export(outfile, level, namespace_, name_='validTime', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('controlInformationRoot', node) if value is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') self.controlInformationRoot = value self.validate_uid(self.controlInformationRoot) # validate type uid value = find_attr_value_('controlInformationExtension', node) if value is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') self.controlInformationExtension = value self.validate_st(self.controlInformationExtension) # validate type st super(HXIT_CE, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'validTime': obj_ = IVL_TS.factory() obj_.build(child_) self.validTime = obj_ obj_.original_tagname_ = 'validTime' super(HXIT_CE, self).buildChildren(child_, node, nodeName_, True)
# end class HXIT_CE
[docs]class HXIT_PQ(PQ): """The root of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc. The Extension of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc.""" subclass = None superclass = PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, controlInformationRoot=None, controlInformationExtension=None, validTime=None): self.original_tagname_ = None super(HXIT_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, ) self.controlInformationRoot = _cast(None, controlInformationRoot) self.controlInformationExtension = _cast(None, controlInformationExtension) self.validTime = validTime
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, HXIT_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if HXIT_PQ.subclass: return HXIT_PQ.subclass(*args_, **kwargs_) else: return HXIT_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_validTime(self): return self.validTime
[docs] def set_validTime(self, validTime): self.validTime = validTime
[docs] def get_controlInformationRoot(self): return self.controlInformationRoot
[docs] def set_controlInformationRoot(self, controlInformationRoot): self.controlInformationRoot = controlInformationRoot
[docs] def get_controlInformationExtension(self): return self.controlInformationExtension
[docs] def set_controlInformationExtension(self, controlInformationExtension): self.controlInformationExtension = controlInformationExtension
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( self.validTime is not None or super(HXIT_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='HXIT_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='HXIT_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='HXIT_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='HXIT_PQ'): super(HXIT_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='HXIT_PQ') if self.controlInformationRoot is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') outfile.write(' controlInformationRoot=%s' % (quote_attrib(self.controlInformationRoot), )) if self.controlInformationExtension is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') outfile.write(' controlInformationExtension=%s' % (quote_attrib(self.controlInformationExtension), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='HXIT_PQ', fromsubclass_=False, pretty_print=True): super(HXIT_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.validTime is not None: self.validTime.export(outfile, level, namespace_, name_='validTime', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('controlInformationRoot', node) if value is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') self.controlInformationRoot = value self.validate_uid(self.controlInformationRoot) # validate type uid value = find_attr_value_('controlInformationExtension', node) if value is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') self.controlInformationExtension = value self.validate_st(self.controlInformationExtension) # validate type st super(HXIT_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'validTime': obj_ = IVL_TS.factory() obj_.build(child_) self.validTime = obj_ obj_.original_tagname_ = 'validTime' super(HXIT_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class HXIT_PQ
[docs]class IVXB_MO(MO): """Specifies whether the limit is included in the interval (interval is closed) or excluded from the interval (interval is open).""" subclass = None superclass = MO def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, currency=None, inclusive='true'): self.original_tagname_ = None super(IVXB_MO, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, currency, ) self.inclusive = _cast(None, inclusive)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVXB_MO) if subclass is not None: return subclass(*args_, **kwargs_) if IVXB_MO.subclass: return IVXB_MO.subclass(*args_, **kwargs_) else: return IVXB_MO(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(IVXB_MO, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVXB_MO', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_MO') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVXB_MO', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVXB_MO'): super(IVXB_MO, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_MO') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVXB_MO', fromsubclass_=False, pretty_print=True): super(IVXB_MO, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(IVXB_MO, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(IVXB_MO, self).buildChildren(child_, node, nodeName_, True) pass
# end class IVXB_MO
[docs]class IVXB_REAL(REAL): """Specifies whether the limit is included in the interval (interval is closed) or excluded from the interval (interval is open).""" subclass = None superclass = REAL def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, inclusive='true'): self.original_tagname_ = None super(IVXB_REAL, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, ) self.inclusive = _cast(None, inclusive)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVXB_REAL) if subclass is not None: return subclass(*args_, **kwargs_) if IVXB_REAL.subclass: return IVXB_REAL.subclass(*args_, **kwargs_) else: return IVXB_REAL(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(IVXB_REAL, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVXB_REAL', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_REAL') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVXB_REAL', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVXB_REAL'): super(IVXB_REAL, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_REAL') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVXB_REAL', fromsubclass_=False, pretty_print=True): super(IVXB_REAL, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(IVXB_REAL, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(IVXB_REAL, self).buildChildren(child_, node, nodeName_, True) pass
# end class IVXB_REAL
[docs]class IVXB_INT(INT): """Specifies whether the limit is included in the interval (interval is closed) or excluded from the interval (interval is open).""" subclass = None superclass = INT def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, inclusive='true'): self.original_tagname_ = None super(IVXB_INT, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, ) self.inclusive = _cast(None, inclusive)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVXB_INT) if subclass is not None: return subclass(*args_, **kwargs_) if IVXB_INT.subclass: return IVXB_INT.subclass(*args_, **kwargs_) else: return IVXB_INT(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(IVXB_INT, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVXB_INT', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_INT') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVXB_INT', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVXB_INT'): super(IVXB_INT, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_INT') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVXB_INT', fromsubclass_=False, pretty_print=True): super(IVXB_INT, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(IVXB_INT, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(IVXB_INT, self).buildChildren(child_, node, nodeName_, True) pass
# end class IVXB_INT
[docs]class SXCM_REAL(REAL): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = REAL def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', extensiontype_=None): self.original_tagname_ = None super(SXCM_REAL, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, extensiontype_, ) self.operator = _cast(None, operator) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_REAL) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_REAL.subclass: return SXCM_REAL.subclass(*args_, **kwargs_) else: return SXCM_REAL(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(SXCM_REAL, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_REAL', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_REAL') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_REAL', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_REAL'): super(SXCM_REAL, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_REAL') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_REAL', fromsubclass_=False, pretty_print=True): super(SXCM_REAL, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SXCM_REAL, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(SXCM_REAL, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_REAL
[docs]class SXCM_INT(INT): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = INT def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', extensiontype_=None): self.original_tagname_ = None super(SXCM_INT, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, extensiontype_, ) self.operator = _cast(None, operator) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_INT) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_INT.subclass: return SXCM_INT.subclass(*args_, **kwargs_) else: return SXCM_INT(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(SXCM_INT, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_INT', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_INT') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_INT', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_INT'): super(SXCM_INT, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_INT') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_INT', fromsubclass_=False, pretty_print=True): super(SXCM_INT, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SXCM_INT, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(SXCM_INT, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_INT
[docs]class SXCM_MO(MO): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = MO def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, currency=None, operator='I', extensiontype_=None): self.original_tagname_ = None super(SXCM_MO, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, currency, extensiontype_, ) self.operator = _cast(None, operator) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_MO) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_MO.subclass: return SXCM_MO.subclass(*args_, **kwargs_) else: return SXCM_MO(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(SXCM_MO, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_MO', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_MO') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_MO', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_MO'): super(SXCM_MO, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_MO') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_MO', fromsubclass_=False, pretty_print=True): super(SXCM_MO, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SXCM_MO, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(SXCM_MO, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_MO
[docs]class SXCM_CD(CD): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = CD def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, code=None, codeSystem=None, codeSystemName=None, codeSystemVersion=None, displayName=None, valueSet=None, valueSetVersion=None, codingRationale=None, originalText=None, qualifier=None, translation=None, operator='I'): self.original_tagname_ = None super(SXCM_CD, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, code, codeSystem, codeSystemName, codeSystemVersion, displayName, valueSet, valueSetVersion, codingRationale, originalText, qualifier, translation, ) self.operator = _cast(None, operator)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_CD) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_CD.subclass: return SXCM_CD.subclass(*args_, **kwargs_) else: return SXCM_CD(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(SXCM_CD, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_CD', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_CD') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_CD', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_CD'): super(SXCM_CD, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_CD') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_CD', fromsubclass_=False, pretty_print=True): super(SXCM_CD, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator super(SXCM_CD, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(SXCM_CD, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_CD
[docs]class PPD_PQ(PQ): """A code specifying the type of probability distribution. Possible values are as shown in the attached table. The NULL value (unknown) for the type code indicates that the probability distribution type is unknown. In that case, the standard deviation has the meaning of an informal guess.""" subclass = None superclass = PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, distributionType=None, standardDeviation=None, extensiontype_=None): self.original_tagname_ = None super(PPD_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, extensiontype_, ) self.distributionType = _cast(None, distributionType) self.standardDeviation = standardDeviation self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PPD_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if PPD_PQ.subclass: return PPD_PQ.subclass(*args_, **kwargs_) else: return PPD_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_standardDeviation(self): return self.standardDeviation
[docs] def set_standardDeviation(self, standardDeviation): self.standardDeviation = standardDeviation
[docs] def get_distributionType(self): return self.distributionType
[docs] def set_distributionType(self, distributionType): self.distributionType = distributionType
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_ProbabilityDistributionType(self, value): # Validate type ProbabilityDistributionType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['B', 'E', 'F', 'G', 'LN', 'N', 'T', 'U', 'X2'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ProbabilityDistributionType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ProbabilityDistributionType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ProbabilityDistributionType_patterns_, ))
validate_ProbabilityDistributionType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.standardDeviation is not None or super(PPD_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PPD_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PPD_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PPD_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PPD_PQ'): super(PPD_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PPD_PQ') if self.distributionType is not None and 'distributionType' not in already_processed: already_processed.add('distributionType') outfile.write(' distributionType=%s' % (quote_attrib(self.distributionType), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PPD_PQ', fromsubclass_=False, pretty_print=True): super(PPD_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.standardDeviation is not None: self.standardDeviation.export(outfile, level, namespace_, name_='standardDeviation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('distributionType', node) if value is not None and 'distributionType' not in already_processed: already_processed.add('distributionType') self.distributionType = value self.validate_ProbabilityDistributionType(self.distributionType) # validate type ProbabilityDistributionType value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(PPD_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'standardDeviation': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.standardDeviation = obj_ obj_.original_tagname_ = 'standardDeviation' super(PPD_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class PPD_PQ
[docs]class PPD_TS(TS): """A code specifying the type of probability distribution. Possible values are as shown in the attached table. The NULL value (unknown) for the type code indicates that the probability distribution type is unknown. In that case, the standard deviation has the meaning of an informal guess.""" subclass = None superclass = TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, distributionType=None, standardDeviation=None, extensiontype_=None): self.original_tagname_ = None super(PPD_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, extensiontype_, ) self.distributionType = _cast(None, distributionType) self.standardDeviation = standardDeviation self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PPD_TS) if subclass is not None: return subclass(*args_, **kwargs_) if PPD_TS.subclass: return PPD_TS.subclass(*args_, **kwargs_) else: return PPD_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_standardDeviation(self): return self.standardDeviation
[docs] def set_standardDeviation(self, standardDeviation): self.standardDeviation = standardDeviation
[docs] def get_distributionType(self): return self.distributionType
[docs] def set_distributionType(self, distributionType): self.distributionType = distributionType
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_ProbabilityDistributionType(self, value): # Validate type ProbabilityDistributionType, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['B', 'E', 'F', 'G', 'LN', 'N', 'T', 'U', 'X2'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on ProbabilityDistributionType' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_ProbabilityDistributionType_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_ProbabilityDistributionType_patterns_, ))
validate_ProbabilityDistributionType_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( self.standardDeviation is not None or super(PPD_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PPD_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PPD_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PPD_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PPD_TS'): super(PPD_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PPD_TS') if self.distributionType is not None and 'distributionType' not in already_processed: already_processed.add('distributionType') outfile.write(' distributionType=%s' % (quote_attrib(self.distributionType), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PPD_TS', fromsubclass_=False, pretty_print=True): super(PPD_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.standardDeviation is not None: self.standardDeviation.export(outfile, level, namespace_, name_='standardDeviation', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('distributionType', node) if value is not None and 'distributionType' not in already_processed: already_processed.add('distributionType') self.distributionType = value self.validate_ProbabilityDistributionType(self.distributionType) # validate type ProbabilityDistributionType value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(PPD_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'standardDeviation': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.standardDeviation = obj_ obj_.original_tagname_ = 'standardDeviation' super(PPD_TS, self).buildChildren(child_, node, nodeName_, True)
# end class PPD_TS
[docs]class IVXB_PQ(PQ): """Specifies whether the limit is included in the interval (interval is closed) or excluded from the interval (interval is open).""" subclass = None superclass = PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, inclusive='true'): self.original_tagname_ = None super(IVXB_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, ) self.inclusive = _cast(None, inclusive)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVXB_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if IVXB_PQ.subclass: return IVXB_PQ.subclass(*args_, **kwargs_) else: return IVXB_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(IVXB_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVXB_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVXB_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVXB_PQ'): super(IVXB_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_PQ') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVXB_PQ', fromsubclass_=False, pretty_print=True): super(IVXB_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(IVXB_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(IVXB_PQ, self).buildChildren(child_, node, nodeName_, True) pass
# end class IVXB_PQ
[docs]class SXCM_PQ(PQ): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, operator='I', extensiontype_=None): self.original_tagname_ = None super(SXCM_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, extensiontype_, ) self.operator = _cast(None, operator) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_PQ.subclass: return SXCM_PQ.subclass(*args_, **kwargs_) else: return SXCM_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(SXCM_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_PQ'): super(SXCM_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_PQ') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_PQ', fromsubclass_=False, pretty_print=True): super(SXCM_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SXCM_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(SXCM_PQ, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_PQ
[docs]class IVL_PQ(SXCM_PQ): subclass = None superclass = SXCM_PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, operator='I', low=None, high=None, width=None, center=None, any=None, extensiontype_=None): self.original_tagname_ = None super(IVL_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, operator, extensiontype_, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width self.any = any self.width = width self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVL_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if IVL_PQ.subclass: return IVL_PQ.subclass(*args_, **kwargs_) else: return IVL_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_any(self): return self.any
[docs] def set_any(self, any): self.any = any
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or self.any is not None or self.width is not None or super(IVL_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVL_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVL_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVL_PQ'): super(IVL_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_PQ') if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVL_PQ', fromsubclass_=False, pretty_print=True): super(IVL_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.low is not None: self.low.export(outfile, level, namespace_, name_='low', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.center is not None: self.center.export(outfile, level, namespace_, name_='center', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.any is not None: self.any.export(outfile, level, namespace_, name_='any', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(IVL_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = IVXB_PQ.factory() obj_.build(child_) self.low = obj_ obj_.original_tagname_ = 'low' elif nodeName_ == 'high': obj_ = IVXB_PQ.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'high': obj_ = IVXB_PQ.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.center = obj_ obj_.original_tagname_ = 'center' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'any': class_obj_ = self.get_class_obj_(child_, TS) obj_ = class_obj_.factory() obj_.build(child_) self.any = obj_ obj_.original_tagname_ = 'any' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' super(IVL_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class IVL_PQ
[docs]class IVXB_TS(TS): """Specifies whether the limit is included in the interval (interval is closed) or excluded from the interval (interval is open).""" subclass = None superclass = TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, inclusive='true', valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(IVXB_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, valueOf_, mixedclass_, content_, ) self.inclusive = _cast(None, inclusive) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVXB_TS) if subclass is not None: return subclass(*args_, **kwargs_) if IVXB_TS.subclass: return IVXB_TS.subclass(*args_, **kwargs_) else: return IVXB_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(IVXB_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVXB_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVXB_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVXB_TS'): super(IVXB_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_TS') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVXB_TS', fromsubclass_=False, pretty_print=True): super(IVXB_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(IVXB_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(IVXB_TS, self).buildChildren(child_, node, nodeName_, True) pass
# end class IVXB_TS
[docs]class SXCM_TS(TS): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', valueOf_=None, mixedclass_=None, content_=None, extensiontype_=None): self.original_tagname_ = None super(SXCM_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, valueOf_, mixedclass_, content_, extensiontype_, ) self.operator = _cast(None, operator) self.valueOf_ = valueOf_ self.extensiontype_ = extensiontype_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_TS) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_TS.subclass: return SXCM_TS.subclass(*args_, **kwargs_) else: return SXCM_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(SXCM_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_TS'): super(SXCM_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_TS') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_TS', fromsubclass_=False, pretty_print=True): super(SXCM_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SXCM_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(SXCM_TS, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_TS
[docs]class URG_PQ(UVP_PQ): subclass = None superclass = UVP_PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, probability=None, low=None, high=None, width=None, center=None): self.original_tagname_ = None super(URG_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, probability, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, URG_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if URG_PQ.subclass: return URG_PQ.subclass(*args_, **kwargs_) else: return URG_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or super(URG_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='URG_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='URG_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='URG_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='URG_PQ'): super(URG_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='URG_PQ')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='URG_PQ', fromsubclass_=False, pretty_print=True): super(URG_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.low is not None: self.low.export(outfile, level, namespace_, name_='low', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.center is not None: self.center.export(outfile, level, namespace_, name_='center', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(URG_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = URXB_PQ.factory() obj_.build(child_) self.low = obj_ obj_.original_tagname_ = 'low' elif nodeName_ == 'high': obj_ = URXB_PQ.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'high': obj_ = URXB_PQ.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.center = obj_ obj_.original_tagname_ = 'center' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' super(URG_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class URG_PQ
[docs]class BXIT_IVL_PQ(IVL_PQ): """The quantity in which the bag item occurs in its containing bag. The root of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc. The Extension of the ControlAct associated with setting the data type to its specified value. By referencing a particular ControlAct, the property links to all of the information surrounding that ControlAct, such as who made the change, when it was made, why it was made, what system originated the change, etc.""" subclass = None superclass = IVL_PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, operator='I', low=None, high=None, width=None, center=None, any=None, qty='1', controlInformationRoot=None, controlInformationExtension=None): self.original_tagname_ = None super(BXIT_IVL_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, operator, low, high, width, center, any, ) self.qty = _cast(None, qty) self.controlInformationRoot = _cast(None, controlInformationRoot) self.controlInformationExtension = _cast(None, controlInformationExtension)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, BXIT_IVL_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if BXIT_IVL_PQ.subclass: return BXIT_IVL_PQ.subclass(*args_, **kwargs_) else: return BXIT_IVL_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_qty(self): return self.qty
[docs] def set_qty(self, qty): self.qty = qty
[docs] def get_controlInformationRoot(self): return self.controlInformationRoot
[docs] def set_controlInformationRoot(self, controlInformationRoot): self.controlInformationRoot = controlInformationRoot
[docs] def get_controlInformationExtension(self): return self.controlInformationExtension
[docs] def set_controlInformationExtension(self, controlInformationExtension): self.controlInformationExtension = controlInformationExtension
[docs] def validate_int(self, value): # Validate type int, a restriction on xs:integer. if value is not None and Validate_simpletypes_: pass
[docs] def validate_uid(self, value): # Validate type uid, a restriction on None. pass
[docs] def validate_st(self, value): # Validate type st, a restriction on xs:string. if value is not None and Validate_simpletypes_: if len(value) < 1: warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on st' % {"value" : value.encode("utf-8")} )
[docs] def hasContent_(self): if ( super(BXIT_IVL_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='BXIT_IVL_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='BXIT_IVL_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='BXIT_IVL_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='BXIT_IVL_PQ'): super(BXIT_IVL_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='BXIT_IVL_PQ') if self.qty != 1 and 'qty' not in already_processed: already_processed.add('qty') outfile.write(' qty=%s' % (quote_attrib(self.qty), )) if self.controlInformationRoot is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') outfile.write(' controlInformationRoot=%s' % (quote_attrib(self.controlInformationRoot), )) if self.controlInformationExtension is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') outfile.write(' controlInformationExtension=%s' % (quote_attrib(self.controlInformationExtension), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='BXIT_IVL_PQ', fromsubclass_=False, pretty_print=True): super(BXIT_IVL_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('qty', node) if value is not None and 'qty' not in already_processed: already_processed.add('qty') try: self.qty = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.qty) # validate type int value = find_attr_value_('controlInformationRoot', node) if value is not None and 'controlInformationRoot' not in already_processed: already_processed.add('controlInformationRoot') self.controlInformationRoot = value self.validate_uid(self.controlInformationRoot) # validate type uid value = find_attr_value_('controlInformationExtension', node) if value is not None and 'controlInformationExtension' not in already_processed: already_processed.add('controlInformationExtension') self.controlInformationExtension = value self.validate_st(self.controlInformationExtension) # validate type st super(BXIT_IVL_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(BXIT_IVL_PQ, self).buildChildren(child_, node, nodeName_, True) pass
# end class BXIT_IVL_PQ
[docs]class IVL_MO(SXCM_MO): subclass = None superclass = SXCM_MO def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, currency=None, operator='I', low=None, high=None, width=None, center=None, any=None): self.original_tagname_ = None super(IVL_MO, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, currency, operator, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width self.any = any self.width = width
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVL_MO) if subclass is not None: return subclass(*args_, **kwargs_) if IVL_MO.subclass: return IVL_MO.subclass(*args_, **kwargs_) else: return IVL_MO(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_any(self): return self.any
[docs] def set_any(self, any): self.any = any
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or self.any is not None or self.width is not None or super(IVL_MO, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVL_MO', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_MO') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVL_MO', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVL_MO'): super(IVL_MO, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_MO')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVL_MO', fromsubclass_=False, pretty_print=True): super(IVL_MO, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.low is not None: self.low.export(outfile, level, namespace_, name_='low', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.center is not None: self.center.export(outfile, level, namespace_, name_='center', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.any is not None: self.any.export(outfile, level, namespace_, name_='any', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(IVL_MO, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = IVXB_MO.factory() obj_.build(child_) self.low = obj_ obj_.original_tagname_ = 'low' elif nodeName_ == 'high': obj_ = IVXB_MO.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, MO) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'high': obj_ = IVXB_MO.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, MO) obj_ = class_obj_.factory() obj_.build(child_) self.center = obj_ obj_.original_tagname_ = 'center' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, MO) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'any': class_obj_ = self.get_class_obj_(child_, MO) obj_ = class_obj_.factory() obj_.build(child_) self.any = obj_ obj_.original_tagname_ = 'any' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, MO) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' super(IVL_MO, self).buildChildren(child_, node, nodeName_, True)
# end class IVL_MO
[docs]class IVL_REAL(SXCM_REAL): subclass = None superclass = SXCM_REAL def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', low=None, high=None, width=None, center=None, any=None): self.original_tagname_ = None super(IVL_REAL, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, operator, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width self.any = any self.width = width
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVL_REAL) if subclass is not None: return subclass(*args_, **kwargs_) if IVL_REAL.subclass: return IVL_REAL.subclass(*args_, **kwargs_) else: return IVL_REAL(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_any(self): return self.any
[docs] def set_any(self, any): self.any = any
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or self.any is not None or self.width is not None or super(IVL_REAL, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVL_REAL', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_REAL') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVL_REAL', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVL_REAL'): super(IVL_REAL, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_REAL')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVL_REAL', fromsubclass_=False, pretty_print=True): super(IVL_REAL, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.low is not None: self.low.export(outfile, level, namespace_, name_='low', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.center is not None: self.center.export(outfile, level, namespace_, name_='center', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.any is not None: self.any.export(outfile, level, namespace_, name_='any', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(IVL_REAL, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = IVXB_REAL.factory() obj_.build(child_) self.low = obj_ obj_.original_tagname_ = 'low' elif nodeName_ == 'high': obj_ = IVXB_REAL.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'high': obj_ = IVXB_REAL.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.center = obj_ obj_.original_tagname_ = 'center' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'any': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.any = obj_ obj_.original_tagname_ = 'any' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, REAL) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' super(IVL_REAL, self).buildChildren(child_, node, nodeName_, True)
# end class IVL_REAL
[docs]class IVL_INT(SXCM_INT): subclass = None superclass = SXCM_INT def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', low=None, high=None, width=None, center=None, any=None): self.original_tagname_ = None super(IVL_INT, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, operator, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width self.any = any self.width = width
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVL_INT) if subclass is not None: return subclass(*args_, **kwargs_) if IVL_INT.subclass: return IVL_INT.subclass(*args_, **kwargs_) else: return IVL_INT(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_any(self): return self.any
[docs] def set_any(self, any): self.any = any
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or self.any is not None or self.width is not None or super(IVL_INT, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVL_INT', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_INT') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVL_INT', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVL_INT'): super(IVL_INT, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_INT')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVL_INT', fromsubclass_=False, pretty_print=True): super(IVL_INT, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.low is not None: self.low.export(outfile, level, namespace_, name_='low', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.center is not None: self.center.export(outfile, level, namespace_, name_='center', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.any is not None: self.any.export(outfile, level, namespace_, name_='any', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(IVL_INT, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = IVXB_INT.factory() obj_.build(child_) self.low = obj_ obj_.original_tagname_ = 'low' elif nodeName_ == 'high': obj_ = IVXB_INT.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'high': obj_ = IVXB_INT.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.center = obj_ obj_.original_tagname_ = 'center' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'any': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.any = obj_ obj_.original_tagname_ = 'any' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, INT) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' super(IVL_INT, self).buildChildren(child_, node, nodeName_, True)
# end class IVL_INT
[docs]class SXPR_TS(SXCM_TS): subclass = None superclass = SXCM_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', comp=None): self.original_tagname_ = None super(SXPR_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, operator, ) if comp is None: self.comp = [] else: self.comp = comp
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXPR_TS) if subclass is not None: return subclass(*args_, **kwargs_) if SXPR_TS.subclass: return SXPR_TS.subclass(*args_, **kwargs_) else: return SXPR_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_comp(self): return self.comp
[docs] def set_comp(self, comp): self.comp = comp
[docs] def add_comp(self, value): self.comp.append(value)
[docs] def insert_comp_at(self, index, value): self.comp.insert(index, value)
[docs] def replace_comp_at(self, index, value): self.comp[index] = value
[docs] def hasContent_(self): if ( self.comp or super(SXPR_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXPR_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXPR_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXPR_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXPR_TS'): super(SXPR_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXPR_TS')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXPR_TS', fromsubclass_=False, pretty_print=True): super(SXPR_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' for comp_ in self.comp: comp_.export(outfile, level, namespace_, name_='comp', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(SXPR_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'comp': class_obj_ = self.get_class_obj_(child_, SXCM_TS) obj_ = class_obj_.factory() obj_.build(child_) self.comp.append(obj_) obj_.original_tagname_ = 'comp' super(SXPR_TS, self).buildChildren(child_, node, nodeName_, True)
# end class SXPR_TS
[docs]class IVXB_PPD_PQ(PPD_PQ): """Specifies whether the limit is included in the interval (interval is closed) or excluded from the interval (interval is open).""" subclass = None superclass = PPD_PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, distributionType=None, standardDeviation=None, inclusive='true'): self.original_tagname_ = None super(IVXB_PPD_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, distributionType, standardDeviation, ) self.inclusive = _cast(None, inclusive)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVXB_PPD_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if IVXB_PPD_PQ.subclass: return IVXB_PPD_PQ.subclass(*args_, **kwargs_) else: return IVXB_PPD_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(IVXB_PPD_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVXB_PPD_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_PPD_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVXB_PPD_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVXB_PPD_PQ'): super(IVXB_PPD_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_PPD_PQ') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVXB_PPD_PQ', fromsubclass_=False, pretty_print=True): super(IVXB_PPD_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(IVXB_PPD_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(IVXB_PPD_PQ, self).buildChildren(child_, node, nodeName_, True) pass
# end class IVXB_PPD_PQ
[docs]class SXCM_PPD_PQ(PPD_PQ): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = PPD_PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, distributionType=None, standardDeviation=None, operator='I', extensiontype_=None): self.original_tagname_ = None super(SXCM_PPD_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, distributionType, standardDeviation, extensiontype_, ) self.operator = _cast(None, operator) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_PPD_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_PPD_PQ.subclass: return SXCM_PPD_PQ.subclass(*args_, **kwargs_) else: return SXCM_PPD_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(SXCM_PPD_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_PPD_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_PPD_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_PPD_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_PPD_PQ'): super(SXCM_PPD_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_PPD_PQ') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_PPD_PQ', fromsubclass_=False, pretty_print=True): super(SXCM_PPD_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SXCM_PPD_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(SXCM_PPD_PQ, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_PPD_PQ
[docs]class IVL_PPD_PQ(SXCM_PPD_PQ): subclass = None superclass = SXCM_PPD_PQ def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, unit='1', codingRationale=None, translation=None, distributionType=None, standardDeviation=None, operator='I', low=None, high=None, width=None, center=None, any=None): self.original_tagname_ = None super(IVL_PPD_PQ, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, unit, codingRationale, translation, distributionType, standardDeviation, operator, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width self.any = any self.width = width
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVL_PPD_PQ) if subclass is not None: return subclass(*args_, **kwargs_) if IVL_PPD_PQ.subclass: return IVL_PPD_PQ.subclass(*args_, **kwargs_) else: return IVL_PPD_PQ(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_any(self): return self.any
[docs] def set_any(self, any): self.any = any
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or self.any is not None or self.width is not None or super(IVL_PPD_PQ, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVL_PPD_PQ', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_PPD_PQ') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVL_PPD_PQ', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVL_PPD_PQ'): super(IVL_PPD_PQ, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_PPD_PQ')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVL_PPD_PQ', fromsubclass_=False, pretty_print=True): super(IVL_PPD_PQ, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.low is not None: self.low.export(outfile, level, namespace_, name_='low', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.center is not None: self.center.export(outfile, level, namespace_, name_='center', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.any is not None: self.any.export(outfile, level, namespace_, name_='any', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(IVL_PPD_PQ, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = IVXB_PPD_PQ.factory() obj_.build(child_) self.low = obj_ obj_.original_tagname_ = 'low' elif nodeName_ == 'high': obj_ = IVXB_PPD_PQ.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'high': obj_ = IVXB_PPD_PQ.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.center = obj_ obj_.original_tagname_ = 'center' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'any': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.any = obj_ obj_.original_tagname_ = 'any' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' super(IVL_PPD_PQ, self).buildChildren(child_, node, nodeName_, True)
# end class IVL_PPD_PQ
[docs]class IVXB_PPD_TS(PPD_TS): """Specifies whether the limit is included in the interval (interval is closed) or excluded from the interval (interval is open).""" subclass = None superclass = PPD_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, distributionType=None, standardDeviation=None, inclusive='true'): self.original_tagname_ = None super(IVXB_PPD_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, distributionType, standardDeviation, ) self.inclusive = _cast(None, inclusive)
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVXB_PPD_TS) if subclass is not None: return subclass(*args_, **kwargs_) if IVXB_PPD_TS.subclass: return IVXB_PPD_TS.subclass(*args_, **kwargs_) else: return IVXB_PPD_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_inclusive(self): return self.inclusive
[docs] def set_inclusive(self, inclusive): self.inclusive = inclusive
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def hasContent_(self): if ( super(IVXB_PPD_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVXB_PPD_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_PPD_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVXB_PPD_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVXB_PPD_TS'): super(IVXB_PPD_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVXB_PPD_TS') if not self.inclusive and 'inclusive' not in already_processed: already_processed.add('inclusive') outfile.write(' inclusive=%s' % (quote_attrib(self.inclusive), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVXB_PPD_TS', fromsubclass_=False, pretty_print=True): super(IVXB_PPD_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('inclusive', node) if value is not None and 'inclusive' not in already_processed: already_processed.add('inclusive') if value in ('true', '1'): self.inclusive = True elif value in ('false', '0'): self.inclusive = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.inclusive) # validate type bl super(IVXB_PPD_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(IVXB_PPD_TS, self).buildChildren(child_, node, nodeName_, True) pass
# end class IVXB_PPD_TS
[docs]class SXCM_PPD_TS(PPD_TS): """A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.""" subclass = None superclass = PPD_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, distributionType=None, standardDeviation=None, operator='I', extensiontype_=None): self.original_tagname_ = None super(SXCM_PPD_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, distributionType, standardDeviation, extensiontype_, ) self.operator = _cast(None, operator) self.extensiontype_ = extensiontype_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, SXCM_PPD_TS) if subclass is not None: return subclass(*args_, **kwargs_) if SXCM_PPD_TS.subclass: return SXCM_PPD_TS.subclass(*args_, **kwargs_) else: return SXCM_PPD_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_operator(self): return self.operator
[docs] def set_operator(self, operator): self.operator = operator
[docs] def get_extensiontype_(self): return self.extensiontype_
[docs] def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
[docs] def validate_SetOperator(self, value): # Validate type SetOperator, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['A', 'E', 'H', 'I', 'P'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on SetOperator' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_SetOperator_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_SetOperator_patterns_, ))
validate_SetOperator_patterns_ = [['^[^\\s]+$']]
[docs] def hasContent_(self): if ( super(SXCM_PPD_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='SXCM_PPD_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_PPD_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='SXCM_PPD_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SXCM_PPD_TS'): super(SXCM_PPD_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SXCM_PPD_TS') if self.operator != "I" and 'operator' not in already_processed: already_processed.add('operator') outfile.write(' operator=%s' % (quote_attrib(self.operator), )) if self.extensiontype_ is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') outfile.write(' xsi:type="%s"' % self.extensiontype_)
[docs] def exportChildren(self, outfile, level, namespace_='', name_='SXCM_PPD_TS', fromsubclass_=False, pretty_print=True): super(SXCM_PPD_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('operator', node) if value is not None and 'operator' not in already_processed: already_processed.add('operator') self.operator = value self.validate_SetOperator(self.operator) # validate type SetOperator value = find_attr_value_('xsi:type', node) if value is not None and 'xsi:type' not in already_processed: already_processed.add('xsi:type') self.extensiontype_ = value super(SXCM_PPD_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(SXCM_PPD_TS, self).buildChildren(child_, node, nodeName_, True) pass
# end class SXCM_PPD_TS
[docs]class PIVL_PPD_TS(SXCM_PPD_TS): """Note: because this type is defined as an extension of SXCM_T, all of the attributes and elements accepted for T are also accepted by this definition. However, they are NOT allowed by the normative description of this type. Unfortunately, we cannot write a general purpose schematron contraints to provide that extra validation, thus applications must be aware that instance (fragments) that pass validation with this might might still not be legal. Specifies if and how the repetitions are aligned to the cycles of the underlying calendar (e.g., to distinguish every 30 days from "the 5th of every month".) A non-aligned periodic interval recurs independently from the calendar. An aligned periodic interval is synchronized with the calendar. Indicates whether the exact timing is up to the party executing the schedule (e.g., to distinguish "every 8 hours" from "3 times a day".) The number of times the period repeats in total. If count is null, then the period repeats indefinitely both before and after the anchor implicit in the phase.""" subclass = None superclass = SXCM_PPD_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, distributionType=None, standardDeviation=None, operator='I', alignment=None, institutionSpecified='false', count=None, phase=None, period=None, frequency=None): self.original_tagname_ = None super(PIVL_PPD_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, distributionType, standardDeviation, operator, ) self.alignment = _cast(None, alignment) self.institutionSpecified = _cast(None, institutionSpecified) self.count = _cast(None, count) self.phase = phase self.period = period self.frequency = frequency
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PIVL_PPD_TS) if subclass is not None: return subclass(*args_, **kwargs_) if PIVL_PPD_TS.subclass: return PIVL_PPD_TS.subclass(*args_, **kwargs_) else: return PIVL_PPD_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_phase(self): return self.phase
[docs] def set_phase(self, phase): self.phase = phase
[docs] def get_period(self): return self.period
[docs] def set_period(self, period): self.period = period
[docs] def get_frequency(self): return self.frequency
[docs] def set_frequency(self, frequency): self.frequency = frequency
[docs] def get_alignment(self): return self.alignment
[docs] def set_alignment(self, alignment): self.alignment = alignment
[docs] def get_institutionSpecified(self): return self.institutionSpecified
[docs] def set_institutionSpecified(self, institutionSpecified): self.institutionSpecified = institutionSpecified
[docs] def get_count(self): return self.count
[docs] def set_count(self, count): self.count = count
[docs] def validate_CalendarCycle(self, value): # Validate type CalendarCycle, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CD', 'CH', 'CM', 'CN', 'CS', 'CW', 'CY', 'D', 'DM', 'DW', 'DY', 'H', 'HD', 'J', 'M', 'MY', 'N', 'NH', 'S', 'SN', 'W', 'WM', 'WY', 'Y'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on CalendarCycle' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_CalendarCycle_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_CalendarCycle_patterns_, ))
validate_CalendarCycle_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def validate_int(self, value): # Validate type int, a restriction on xs:integer. if value is not None and Validate_simpletypes_: pass
[docs] def hasContent_(self): if ( self.phase is not None or self.period is not None or self.frequency is not None or super(PIVL_PPD_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PIVL_PPD_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PIVL_PPD_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PIVL_PPD_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PIVL_PPD_TS'): super(PIVL_PPD_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PIVL_PPD_TS') if self.alignment is not None and 'alignment' not in already_processed: already_processed.add('alignment') outfile.write(' alignment=%s' % (quote_attrib(self.alignment), )) if self.institutionSpecified and 'institutionSpecified' not in already_processed: already_processed.add('institutionSpecified') outfile.write(' institutionSpecified=%s' % (quote_attrib(self.institutionSpecified), )) if self.count is not None and 'count' not in already_processed: already_processed.add('count') outfile.write(' count=%s' % (quote_attrib(self.count), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PIVL_PPD_TS', fromsubclass_=False, pretty_print=True): super(PIVL_PPD_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.phase is not None: self.phase.export(outfile, level, namespace_, name_='phase', pretty_print=pretty_print) if self.period is not None: self.period.export(outfile, level, namespace_, name_='period', pretty_print=pretty_print) if self.frequency is not None: self.frequency.export(outfile, level, namespace_, name_='frequency', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('alignment', node) if value is not None and 'alignment' not in already_processed: already_processed.add('alignment') self.alignment = value self.validate_CalendarCycle(self.alignment) # validate type CalendarCycle value = find_attr_value_('institutionSpecified', node) if value is not None and 'institutionSpecified' not in already_processed: already_processed.add('institutionSpecified') if value in ('true', '1'): self.institutionSpecified = True elif value in ('false', '0'): self.institutionSpecified = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.institutionSpecified) # validate type bl value = find_attr_value_('count', node) if value is not None and 'count' not in already_processed: already_processed.add('count') try: self.count = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.count) # validate type int super(PIVL_PPD_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'phase': obj_ = IVL_PPD_TS.factory() obj_.build(child_) self.phase = obj_ obj_.original_tagname_ = 'phase' elif nodeName_ == 'period': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.period = obj_ obj_.original_tagname_ = 'period' elif nodeName_ == 'frequency': obj_ = RTO_INT_PQ.factory() obj_.build(child_) self.frequency = obj_ obj_.original_tagname_ = 'frequency' super(PIVL_PPD_TS, self).buildChildren(child_, node, nodeName_, True)
# end class PIVL_PPD_TS
[docs]class EIVL_TS(SXCM_TS): """Note: because this type is defined as an extension of SXCM_T, all of the attributes and elements accepted for T are also accepted by this definition. However, they are NOT allowed by the normative description of this type. Unfortunately, we cannot write a general purpose schematron contraints to provide that extra validation, thus applications must be aware that instance (fragments) that pass validation with this might might still not be legal.""" subclass = None superclass = SXCM_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', event=None, offset=None): self.original_tagname_ = None super(EIVL_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, operator, ) self.event = event self.offset = offset
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, EIVL_TS) if subclass is not None: return subclass(*args_, **kwargs_) if EIVL_TS.subclass: return EIVL_TS.subclass(*args_, **kwargs_) else: return EIVL_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_event(self): return self.event
[docs] def set_event(self, event): self.event = event
[docs] def get_offset(self): return self.offset
[docs] def set_offset(self, offset): self.offset = offset
[docs] def hasContent_(self): if ( self.event is not None or self.offset is not None or super(EIVL_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='EIVL_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='EIVL_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='EIVL_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EIVL_TS'): super(EIVL_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EIVL_TS')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='EIVL_TS', fromsubclass_=False, pretty_print=True): super(EIVL_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.event is not None: self.event.export(outfile, level, namespace_, name_='event', pretty_print=pretty_print) if self.offset is not None: self.offset.export(outfile, level, namespace_, name_='offset', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(EIVL_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'event': obj_ = EIVL_event.factory() obj_.build(child_) self.event = obj_ obj_.original_tagname_ = 'event' elif nodeName_ == 'offset': class_obj_ = self.get_class_obj_(child_, IVL_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.offset = obj_ obj_.original_tagname_ = 'offset' super(EIVL_TS, self).buildChildren(child_, node, nodeName_, True)
# end class EIVL_TS
[docs]class PIVL_TS(SXCM_TS): """Note: because this type is defined as an extension of SXCM_T, all of the attributes and elements accepted for T are also accepted by this definition. However, they are NOT allowed by the normative description of this type. Unfortunately, we cannot write a general purpose schematron contraints to provide that extra validation, thus applications must be aware that instance (fragments) that pass validation with this might might still not be legal. Specifies if and how the repetitions are aligned to the cycles of the underlying calendar (e.g., to distinguish every 30 days from "the 5th of every month".) A non-aligned periodic interval recurs independently from the calendar. An aligned periodic interval is synchronized with the calendar. Indicates whether the exact timing is up to the party executing the schedule (e.g., to distinguish "every 8 hours" from "3 times a day".) The number of times the period repeats in total. If count is null, then the period repeats indefinitely both before and after the anchor implicit in the phase.""" subclass = None superclass = SXCM_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', alignment=None, institutionSpecified='false', count=None, phase=None, period=None, frequency=None): self.original_tagname_ = None super(PIVL_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, operator, ) self.alignment = _cast(None, alignment) self.institutionSpecified = _cast(None, institutionSpecified) self.count = _cast(None, count) self.phase = phase self.period = period self.frequency = frequency
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, PIVL_TS) if subclass is not None: return subclass(*args_, **kwargs_) if PIVL_TS.subclass: return PIVL_TS.subclass(*args_, **kwargs_) else: return PIVL_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_phase(self): return self.phase
[docs] def set_phase(self, phase): self.phase = phase
[docs] def get_period(self): return self.period
[docs] def set_period(self, period): self.period = period
[docs] def get_frequency(self): return self.frequency
[docs] def set_frequency(self, frequency): self.frequency = frequency
[docs] def get_alignment(self): return self.alignment
[docs] def set_alignment(self, alignment): self.alignment = alignment
[docs] def get_institutionSpecified(self): return self.institutionSpecified
[docs] def set_institutionSpecified(self, institutionSpecified): self.institutionSpecified = institutionSpecified
[docs] def get_count(self): return self.count
[docs] def set_count(self, count): self.count = count
[docs] def validate_CalendarCycle(self, value): # Validate type CalendarCycle, a restriction on cs. if value is not None and Validate_simpletypes_: value = str(value) enumerations = ['CD', 'CH', 'CM', 'CN', 'CS', 'CW', 'CY', 'D', 'DM', 'DW', 'DY', 'H', 'HD', 'J', 'M', 'MY', 'N', 'NH', 'S', 'SN', 'W', 'WM', 'WY', 'Y'] enumeration_respectee = False for enum in enumerations: if value == enum: enumeration_respectee = True break if not enumeration_respectee: warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on CalendarCycle' % {"value" : value.encode("utf-8")} ) if not self.gds_validate_simple_patterns( self.validate_CalendarCycle_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_CalendarCycle_patterns_, ))
validate_CalendarCycle_patterns_ = [['^[^\\s]+$']]
[docs] def validate_bl(self, value): # Validate type bl, a restriction on xs:boolean. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_bl_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_bl_patterns_, ))
validate_bl_patterns_ = [['^true$|^false$']]
[docs] def validate_int(self, value): # Validate type int, a restriction on xs:integer. if value is not None and Validate_simpletypes_: pass
[docs] def hasContent_(self): if ( self.phase is not None or self.period is not None or self.frequency is not None or super(PIVL_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='PIVL_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='PIVL_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='PIVL_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PIVL_TS'): super(PIVL_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PIVL_TS') if self.alignment is not None and 'alignment' not in already_processed: already_processed.add('alignment') outfile.write(' alignment=%s' % (quote_attrib(self.alignment), )) if self.institutionSpecified and 'institutionSpecified' not in already_processed: already_processed.add('institutionSpecified') outfile.write(' institutionSpecified=%s' % (quote_attrib(self.institutionSpecified), )) if self.count is not None and 'count' not in already_processed: already_processed.add('count') outfile.write(' count=%s' % (quote_attrib(self.count), ))
[docs] def exportChildren(self, outfile, level, namespace_='', name_='PIVL_TS', fromsubclass_=False, pretty_print=True): super(PIVL_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.phase is not None: self.phase.export(outfile, level, namespace_, name_='phase', pretty_print=pretty_print) if self.period is not None: self.period.export(outfile, level, namespace_, name_='period', pretty_print=pretty_print) if self.frequency is not None: self.frequency.export(outfile, level, namespace_, name_='frequency', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): value = find_attr_value_('alignment', node) if value is not None and 'alignment' not in already_processed: already_processed.add('alignment') self.alignment = value self.validate_CalendarCycle(self.alignment) # validate type CalendarCycle value = find_attr_value_('institutionSpecified', node) if value is not None and 'institutionSpecified' not in already_processed: already_processed.add('institutionSpecified') if value in ('true', '1'): self.institutionSpecified = True elif value in ('false', '0'): self.institutionSpecified = False else: raise_parse_error(node, 'Bad boolean attribute') self.validate_bl(self.institutionSpecified) # validate type bl value = find_attr_value_('count', node) if value is not None and 'count' not in already_processed: already_processed.add('count') try: self.count = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) self.validate_int(self.count) # validate type int super(PIVL_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'phase': obj_ = IVL_TS.factory() obj_.build(child_) self.phase = obj_ obj_.original_tagname_ = 'phase' elif nodeName_ == 'period': class_obj_ = self.get_class_obj_(child_, PQ) obj_ = class_obj_.factory() obj_.build(child_) self.period = obj_ obj_.original_tagname_ = 'period' elif nodeName_ == 'frequency': obj_ = RTO_INT_PQ.factory() obj_.build(child_) self.frequency = obj_ obj_.original_tagname_ = 'frequency' super(PIVL_TS, self).buildChildren(child_, node, nodeName_, True)
# end class PIVL_TS
[docs]class IVL_TS(SXCM_TS): subclass = None superclass = SXCM_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, operator='I', low=None, high=None, width=None, center=None, any=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None super(IVL_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, operator, valueOf_, mixedclass_, content_, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width self.any = any self.width = width self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVL_TS) if subclass is not None: return subclass(*args_, **kwargs_) if IVL_TS.subclass: return IVL_TS.subclass(*args_, **kwargs_) else: return IVL_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_any(self): return self.any
[docs] def set_any(self, any): self.any = any
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def get_valueOf_(self): return self.valueOf_
[docs] def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or self.any is not None or self.width is not None or 1 if type(self.valueOf_) in [int,float] else self.valueOf_ or super(IVL_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVL_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVL_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVL_TS'): super(IVL_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_TS')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVL_TS', fromsubclass_=False, pretty_print=True): super(IVL_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if not fromsubclass_: for item_ in self.content_: item_.export(outfile, level, item_.name, namespace_, pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(IVL_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = IVXB_TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'low', obj_) self.content_.append(obj_) if hasattr(self, 'add_low'): self.add_low(obj_.value) elif hasattr(self, 'set_low'): self.set_low(obj_.value) elif nodeName_ == 'high': obj_ = IVXB_TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'high', obj_) self.content_.append(obj_) if hasattr(self, 'add_high'): self.add_high(obj_.value) elif hasattr(self, 'set_high'): self.set_high(obj_.value) elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) class_obj_ = PQ.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'width', obj_) self.content_.append(obj_) if hasattr(self, 'add_width'): self.add_width(obj_.value) elif hasattr(self, 'set_width'): self.set_width(obj_.value) elif nodeName_ == 'high': obj_ = IVXB_TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'high', obj_) self.content_.append(obj_) if hasattr(self, 'add_high'): self.add_high(obj_.value) elif hasattr(self, 'set_high'): self.set_high(obj_.value) elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, TS) class_obj_ = TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'center', obj_) self.content_.append(obj_) if hasattr(self, 'add_center'): self.add_center(obj_.value) elif hasattr(self, 'set_center'): self.set_center(obj_.value) elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) class_obj_ = PQ.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'width', obj_) self.content_.append(obj_) if hasattr(self, 'add_width'): self.add_width(obj_.value) elif hasattr(self, 'set_width'): self.set_width(obj_.value) elif nodeName_ == 'any': class_obj_ = self.get_class_obj_(child_, TS) class_obj_ = TS.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'any', obj_) self.content_.append(obj_) if hasattr(self, 'add_any'): self.add_any(obj_.value) elif hasattr(self, 'set_any'): self.set_any(obj_.value) elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PQ) class_obj_ = PQ.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'width', obj_) self.content_.append(obj_) if hasattr(self, 'add_width'): self.add_width(obj_.value) elif hasattr(self, 'set_width'): self.set_width(obj_.value) if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(IVL_TS, self).buildChildren(child_, node, nodeName_, True)
# end class IVL_TS
[docs]class EIVL_PPD_TS(SXCM_PPD_TS): """Note: because this type is defined as an extension of SXCM_T, all of the attributes and elements accepted for T are also accepted by this definition. However, they are NOT allowed by the normative description of this type. Unfortunately, we cannot write a general purpose schematron contraints to provide that extra validation, thus applications must be aware that instance (fragments) that pass validation with this might might still not be legal.""" subclass = None superclass = SXCM_PPD_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, distributionType=None, standardDeviation=None, operator='I', event=None, offset=None): self.original_tagname_ = None super(EIVL_PPD_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, distributionType, standardDeviation, operator, ) self.event = event self.offset = offset
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, EIVL_PPD_TS) if subclass is not None: return subclass(*args_, **kwargs_) if EIVL_PPD_TS.subclass: return EIVL_PPD_TS.subclass(*args_, **kwargs_) else: return EIVL_PPD_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_event(self): return self.event
[docs] def set_event(self, event): self.event = event
[docs] def get_offset(self): return self.offset
[docs] def set_offset(self, offset): self.offset = offset
[docs] def hasContent_(self): if ( self.event is not None or self.offset is not None or super(EIVL_PPD_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='EIVL_PPD_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='EIVL_PPD_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='EIVL_PPD_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='EIVL_PPD_TS'): super(EIVL_PPD_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='EIVL_PPD_TS')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='EIVL_PPD_TS', fromsubclass_=False, pretty_print=True): super(EIVL_PPD_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.event is not None: self.event.export(outfile, level, namespace_, name_='event', pretty_print=pretty_print) if self.offset is not None: self.offset.export(outfile, level, namespace_, name_='offset', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(EIVL_PPD_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'event': obj_ = EIVL_event.factory() obj_.build(child_) self.event = obj_ obj_.original_tagname_ = 'event' elif nodeName_ == 'offset': obj_ = IVL_PPD_PQ.factory() obj_.build(child_) self.offset = obj_ obj_.original_tagname_ = 'offset' super(EIVL_PPD_TS, self).buildChildren(child_, node, nodeName_, True)
# end class EIVL_PPD_TS
[docs]class IVL_PPD_TS(SXCM_PPD_TS): subclass = None superclass = SXCM_PPD_TS def __init__(self, nullFlavor=None, collectionNullFlavor=None, flavorId=None, updateMode=None, originalText=None, value=None, distributionType=None, standardDeviation=None, operator='I', low=None, high=None, width=None, center=None, any=None): self.original_tagname_ = None super(IVL_PPD_TS, self).__init__(nullFlavor, collectionNullFlavor, flavorId, updateMode, originalText, value, distributionType, standardDeviation, operator, ) self.low = low self.high = high self.width = width self.high = high self.center = center self.width = width self.any = any self.width = width
[docs] def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, IVL_PPD_TS) if subclass is not None: return subclass(*args_, **kwargs_) if IVL_PPD_TS.subclass: return IVL_PPD_TS.subclass(*args_, **kwargs_) else: return IVL_PPD_TS(*args_, **kwargs_)
factory = staticmethod(factory)
[docs] def get_low(self): return self.low
[docs] def set_low(self, low): self.low = low
def get_high(self): return self.high def set_high(self, high): self.high = high def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_high(self): return self.high
[docs] def set_high(self, high): self.high = high
[docs] def get_center(self): return self.center
[docs] def set_center(self, center): self.center = center
def get_width(self): return self.width def set_width(self, width): self.width = width
[docs] def get_any(self): return self.any
[docs] def set_any(self, any): self.any = any
[docs] def get_width(self): return self.width
[docs] def set_width(self, width): self.width = width
[docs] def hasContent_(self): if ( self.low is not None or self.high is not None or self.width is not None or self.high is not None or self.center is not None or self.width is not None or self.any is not None or self.width is not None or super(IVL_PPD_TS, self).hasContent_() ): return True else: return False
[docs] def export(self, outfile, level, namespace_='', name_='IVL_PPD_TS', namespacedef_='', pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.original_tagname_ is not None: name_ = self.original_tagname_ showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_PPD_TS') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='IVL_PPD_TS', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, ))
[docs] def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IVL_PPD_TS'): super(IVL_PPD_TS, self).exportAttributes(outfile, level, already_processed, namespace_, name_='IVL_PPD_TS')
[docs] def exportChildren(self, outfile, level, namespace_='', name_='IVL_PPD_TS', fromsubclass_=False, pretty_print=True): super(IVL_PPD_TS, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print) if pretty_print: eol_ = '\n' else: eol_ = '' if self.low is not None: self.low.export(outfile, level, namespace_, name_='low', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.high is not None: self.high.export(outfile, level, namespace_, name_='high', pretty_print=pretty_print) if self.center is not None: self.center.export(outfile, level, namespace_, name_='center', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print) if self.any is not None: self.any.export(outfile, level, namespace_, name_='any', pretty_print=pretty_print) if self.width is not None: self.width.export(outfile, level, namespace_, name_='width', pretty_print=pretty_print)
[docs] def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) for child in node: nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] self.buildChildren(child, node, nodeName_) return self
[docs] def buildAttributes(self, node, attrs, already_processed): super(IVL_PPD_TS, self).buildAttributes(node, attrs, already_processed)
[docs] def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'low': obj_ = IVXB_PPD_TS.factory() obj_.build(child_) self.low = obj_ obj_.original_tagname_ = 'low' elif nodeName_ == 'high': obj_ = IVXB_PPD_TS.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'high': obj_ = IVXB_PPD_TS.factory() obj_.build(child_) self.high = obj_ obj_.original_tagname_ = 'high' elif nodeName_ == 'center': class_obj_ = self.get_class_obj_(child_, PPD_TS) obj_ = class_obj_.factory() obj_.build(child_) self.center = obj_ obj_.original_tagname_ = 'center' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' elif nodeName_ == 'any': class_obj_ = self.get_class_obj_(child_, PPD_TS) obj_ = class_obj_.factory() obj_.build(child_) self.any = obj_ obj_.original_tagname_ = 'any' elif nodeName_ == 'width': class_obj_ = self.get_class_obj_(child_, PPD_PQ) obj_ = class_obj_.factory() obj_.build(child_) self.width = obj_ obj_.original_tagname_ = 'width' super(IVL_PPD_TS, self).buildChildren(child_, node, nodeName_, True)
# end class IVL_PPD_TS GDSClassesMapping = { 'actCriterion': POCP_MT060100UV_ActCriterion, 'actDefinition': POCP_MT030300UV_ActDefinition, 'action': POCP_MT050100UV_Action, 'activeMoiety': POCP_MT081100UV_ActiveMoiety, 'activityTime': TS, 'additionalLocator': adxp_additionalLocator, 'addr': AD, 'addressLine': adxp_addressLine, 'administerableMaterial': POCP_MT010100UV_AdministerableMaterial, 'administrableMaterial': POCP_MT060100UV_AdministrableMaterial, 'administrableMaterialKind': POCP_MT010400UV_MaterialKind, 'administrableProduct': POCP_MT010100UV_Product, 'analyte': POCP_MT070100UV_Participant, 'any': TS, 'approachSiteCode': CD, 'approval': POCP_MT050700UV_Approval, 'asContent': POCP_MT020200UV_Content2, 'asEntityWithGeneric': POCP_MT010100UV_EntityWithGeneric, 'asEquivalentEntity': POCP_MT010100UV_EquivalentEntity, 'asEquivalentSubstance': POCP_MT082100UV_EquivalentSubstance, 'asIdentifiedEntity': POCP_MT010100UV_IdentifiedEntity, 'asIdentifiedItem': POCP_MT020200UV_IdentifiedItem, 'asInstanceOfKind': POCP_MT020200UV_InstanceOfKind2, 'asLocatedEntityPartOf': COCT_MT710000UV07_LocatedEntityPartOf, 'asManufacturedProduct': POCP_MT010100UV_ManufacturedProduct3, 'asMember': POCP_MT020200UV_Member, 'asNamedEntity': POCP_MT000100UV_NamedEntity, 'asPartOfAssembly': POCP_MT010100UV_PartOfAssembly, 'asSpecializedKind': POCP_MT010100UV_SpecializedKind, 'asTerritorialAuthority': POCP_MT082100UV_TerritorialAuthority1, 'assignedDevice': COCT_MT090303UV01_Device, 'assignedEntity': POCP_MT030100UV_AssignedEntity2, 'assignedEntity1': POCP_MT030300UV_AssignedEntity3, 'assignedEntity2': POCP_MT030300UV_AssignedEntity, 'assignedOrganization': POCP_MT030300UV_Organization, 'assignedPerson': COCT_MT090108UV_Person, 'assigningOrganization': POCP_MT030200UV_Organization, 'assigningOrganization1': POCP_MT030200UV_Organization, 'assigningProductIdentifierIssuer': POCP_MT020200UV_ProductIdentifierIssuer, 'assigningTerritory': POCP_MT082100UV_Territory, 'author': POCP_MT040100UV_Author, 'availabilityTime': TS, 'bibliographicDesignationText': ED, 'bond': POCP_MT082100UV_Bond, 'buildingNumberSuffix': adxp_buildingNumberSuffix, 'capTypeCode': CD, 'capacityQuantity': PQ, 'caption': StrucDoc_Caption, 'careOf': adxp_careOf, 'causeOf': POCP_MT060100UV_CauseOf, 'censusTract': adxp_censusTract, 'center': TS, 'characteristic': POCP_MT050500UV_Characteristic, 'checkpointCode': CS, 'city': adxp_city, 'code': CD, 'col': StrucDoc_Col, 'colgroup': StrucDoc_Colgroup, 'comment': PORP_MT050032UV_Comment, 'comp': SXCM_TS, 'component': POCP_MT070200UV_Component1, 'component1': COCT_MT960000UV05_Component1, 'component2': COCT_MT960000UV05_Component2, 'componentOf': POCP_MT040100UV_Component, 'confidentialityCode': CD, 'consequenceObservation': POCP_MT060100UV_ConsequenceObservation, 'consumable': POCP_MT010100UV_Consumable2, 'consumedIn': POCP_MT010100UV_Consumable1, 'contactParty': POCP_MT030300UV_ContactParty, 'contactPerson': POCP_MT030300UV_Person, 'container': POCP_MT020200UV_Container, 'containerPackagedProduct': POCP_MT010100UV_PackagedProduct, 'content': StrucDoc_Content, 'content1': POCP_MT010100UV_Content1, 'content11': POCP_MT010600UV_Content1, 'content2': POCP_MT010100UV_Content, 'controlVariable': POCP_MT070200UV_ControlVariable1, 'country': adxp_country, 'county': adxp_county, 'coverage': POCP_MT050100UV_Coverage, 'custodian': POCP_MT050100UV_Custodian, 'deceasedInd': BL, 'definingMaterialKind': POCP_MT010100UV_MaterialKind, 'definingSubstance': POCP_MT082100UV_Substance, 'delimiter': enxp_delimiter, 'deliveryAddressLine': adxp_deliveryAddressLine, 'deliveryInstallationArea': adxp_deliveryInstallationArea, 'deliveryInstallationQualifier': adxp_deliveryInstallationQualifier, 'deliveryInstallationType': adxp_deliveryInstallationType, 'deliveryMode': adxp_deliveryMode, 'deliveryModeIdentifier': adxp_deliveryModeIdentifier, 'denominator': QTY, 'derivation': POCP_MT080200UV_Derivation, 'derivationProcess': POCP_MT082100UV_DerivationProcess, 'derivedFrom': POCP_MT070100UV_DerivedFrom, 'desc': ED, 'destination': POCP_MT040100UV_Destination, 'device': POCP_MT070200UV_Device2, 'deviceInstance': POCP_MT020200UV_DeviceInstance, 'deviceObservation': POCP_MT070200UV_DeviceObservation, 'deviceOf': POCP_MT010100UV_Device, 'deviceSetting': POCP_MT070200UV_DeviceSetting, 'directTarget': POCP_MT080200UV_DirectTarget, 'direction': adxp_direction, 'directionsText': ED, 'distalMoiety': POCP_MT082100UV_Moiety1, 'document': POCP_MT050100UV_Document, 'documentReference': POCP_MT060100UV_DocumentReference, 'doseQuantity': URG_PQ, 'effect': POCP_MT060100UV_Effect, 'effectiveTime': IVL_TS, 'environmentEntity': POCP_MT080200UV_Entity, 'environmentOrganismStrain': POCP_MT080200UV_OrganismStrain, 'event': EIVL_event, 'excerpt': PORP_MT050032UV_ExcerptFrom, 'existenceTime': IVL_TS, 'expirationTime': IVL_TS, 'expression': ED, 'family': enxp_family, 'footnote': StrucDoc_Footnote, 'footnoteRef': StrucDoc_FootnoteRef, 'formCode': CD, 'frequency': POCP_MT060100UV_Frequency, 'functionCode': CD, 'generalization': POCP_MT070100UV_Generalization, 'generalizedMaterialKind': POCP_MT010100UV_MaterialKind, 'generalizedSpecies': POCP_MT080200UV_Species, 'genericMedicine': POCP_MT010100UV_GenericMedicine, 'given': enxp_given, 'goal': POCP_MT060100UV_Goal, 'governingAgency': POCP_MT050700UV_Agency, 'governingOrganization': POCP_MT082100UV_Organization, 'groupDeviceInstance': POCP_MT020200UV_DeviceInstance, 'groupProductInstance': POCP_MT020200UV_ProductInstance, 'handlingCode': CD, 'head': PQ, 'high': IVXB_TS, 'highlight': PORP_MT050032UV_Highlight, 'holder': POCP_MT050700UV_Holder, 'houseNumber': adxp_houseNumber, 'houseNumberNumeric': adxp_houseNumberNumeric, 'id': II, 'identifiedSubstance': POCP_MT082100UV_IdentifiedSubstance, 'inboundRelationship': POCP_MT050700UV_SourceOf2, 'increment': PQ, 'indicationObservationCriterion': POCP_MT060100UV_IndicationObservationCriterion, 'indirectTargetOf': POCP_MT010100UV_IndirectTarget, 'ingredient': POCP_MT020200UV_Ingredient1, 'ingredientDeviceInstance': POCP_MT020200UV_DeviceInstance, 'ingredientOfProduct': POCP_MT010200UV_Product, 'ingredientProductInstance': POCP_MT020200UV_ProductInstance, 'ingredientSubstance': POCP_MT081100UV_Substance, 'instanceOfKind': POCP_MT020100UV_InstanceOfKind1, 'interaction': POCP_MT082100UV_Interaction, 'interactor': POCP_MT082100UV_Interactor, 'interactsIn': POCP_MT082100UV_Interactor3, 'interpretationCode': CD, 'intersection': adxp_intersection, 'interventionProcedure': POCP_MT070200UV_InterventionProcedure, 'issue': POCP_MT060100UV_Issue, 'item': StrucDoc_Item, 'joinCode': CS, 'kindOfMaterialKind': POCP_MT010400UV_MaterialKind, 'kindOfProduct': POCP_MT010200UV_Product, 'languageCode': CD, 'legalAuthenticator': PORP_MT050032UV_LegalAuthenticator, 'linkHtml': StrucDoc_LinkHtml, 'list': StrucDoc_List, 'localVariableName': ST, 'locatedEntity': COCT_MT710000UV07_LocatedEntity, 'locatedEntityHasParts': COCT_MT710000UV07_LocatedEntityHasParts, 'locatedPlace': COCT_MT710000UV07_Place, 'location': COCT_MT710000UV07_Place, 'low': IVXB_TS, 'maintenanceGoal': POCP_MT060100UV_MaintenanceGoal, 'manifestationOf': POCP_MT070100UV_ManifestationOf, 'manufacturedMaterialKind': POCP_MT010400UV_MaterialKind, 'manufacturedProduct': POCP_MT030300UV_ManufacturedProduct3, 'manufacturedProduct1': POCP_MT010100UV_ManufacturedProduct2, 'manufacturedProduct2': POCP_MT010100UV_ManufacturedProduct3, 'manufacturedProduct21': POCP_MT010600UV_ManufacturedProduct2, 'manufacturedProduct3': POCP_MT010100UV_ManufacturedProduct, 'manufacturerModelName': SC, 'manufacturerOrganization': POCP_MT030200UV_Organization, 'marketingAct': POCP_MT050100UV_MarketingAct, 'maxDoseQuantity': RTO_PQ_PQ, 'member': POCP_MT020200UV_Member1, 'memberDeviceInstance': POCP_MT020200UV_DeviceInstance, 'memberProductInstance': POCP_MT020200UV_ProductInstance, 'methodCode': CD, 'mitigatedBy': POCP_MT060100UV_Mitigates, 'moiety': POCP_MT082100UV_Moiety2, 'monitoringObservation': POCP_MT060100UV_MonitoringObservation, 'monitoringProgram': POCP_MT050100UV_MonitoringProgram, 'name': ON, 'netAmt': MO, 'nonXMLBody': PORP_MT050032UV_NonXMLBody, 'noteText': ED, 'numerator': QTY, 'observation': POCP_MT070100UV_Observation, 'observationCriterion': POCP_MT070100UV_ObservationCriterion, 'observationDefinition': POCP_MT060100UV_ObservationDefinition, 'observationEvent': POCP_MT040100UV_ObservationEvent, 'observationGoal': POCP_MT050100UV_ObservationGoal, 'observationMedia': PORP_MT050032UV_ObservationMedia, 'offset': IVL_PPD_PQ, 'origin': POCP_MT040100UV_Origin, 'originalText': ED, 'otherLocation': POCP_MT030300UV_OtherLocation, 'outboundRelationship': POCP_MT050700UV_SourceOf, 'paragraph': StrucDoc_Paragraph, 'part': POCP_MT020200UV_Part, 'partDeviceInstance': POCP_MT020200UV_DeviceInstance, 'partMoiety': POCP_MT082100UV_Moiety1, 'partProduct': POCP_MT010100UV_Product, 'partProductInstance': POCP_MT020200UV_ProductInstance, 'participation': POCP_MT060100UV_Participant, 'patientObservation': POCP_MT070200UV_PatientObservation, 'pauseQuantity': PQ, 'performance': POCP_MT030300UV_PrimaryPerformer, 'performer': POCP_MT040100UV_Performer, 'period': PPD_PQ, 'pertinentInformation': POCP_MT050700UV_PertinentInformation, 'phase': IVL_PPD_TS, 'playingOrganization': POCP_MT030200UV_Organization, 'policy': POCP_MT050100UV_Policy, 'position': COCT_MT960000UV05_Position, 'positionAccuracy': COCT_MT960000UV05_PositionAccuracy, 'positionCoordinate': COCT_MT960000UV05_PositionCoordinate, 'positionNumber': INT, 'positionText': ED, 'postBox': adxp_postBox, 'postalCode': adxp_postalCode, 'potentialSupply': POCP_MT010100UV_PotentialSupply, 'precinct': adxp_precinct, 'precondition': POCP_MT060100UV_Precondition, 'prefix': enxp_prefix, 'presentSubstance': POCP_MT080200UV_PresentSubstance, 'presentSubstance2': POCP_MT082100UV_Substance, 'primaryPerformer': POCP_MT010100UV_PrimaryPerformer, 'priorityNumber': INT, 'procedureCriterion': POCP_MT060100UV_ProcedureCriterion, 'processStep': POCP_MT090100UV_ProcessStep, 'product': POCP_MT030300UV_Product, 'productEvent': POCP_MT040100UV_ProductEvent, 'productInstance': POCP_MT020200UV_ProductInstance, 'productOf': POCP_MT010100UV_Product3, 'protocol': POCP_MT060100UV_Protocol, 'qualifier': CR, 'quantity': PQ, 'rateQuantity': URG_PQ, 'realmCode': CS, 'reason': POCP_MT060100UV_Reason, 'reasonCode': CD, 'reconstitution': POCP_MT010100UV_Reconstitution, 'reference': TEL, 'referenceRange': POCP_MT070100UV_ReferenceRange, 'relatedDocument': PORP_MT050032UV_RelatedDocument1, 'renderMultiMedia': StrucDoc_RenderMultiMedia, 'repeatNumber': IVL_INT, 'replacementOf': PORP_MT050032UV_ReplacementOf, 'representedOrganization': POCP_MT030300UV_Organization, 'requirement': POCP_MT060100UV_Requirement, 'risk': POCP_MT060100UV_Risk, 'riskCode': CD, 'role': POCP_MT050700UV_Role, 'routeCode': CD, 'scale': PQ, 'section': PORP_MT050032UV_Section, 'sectionReplaced': PORP_MT050032UV_SectionReplaced, 'seperatableInd': BL, 'sequel': POCP_MT040100UV_SequelTo, 'sequenceNumber': INT, 'serviceDeliveryLocation': COCT_MT240003UV02_ServiceDeliveryLocation, 'serviceProviderOrganization': COCT_MT150003UV03_Organization, 'setId': II, 'severity': POCP_MT060100UV_Severity, 'signatureCode': CD, 'signatureText': ED, 'softwareName': SC, 'splitCode': CS, 'stabilityTime': IVL_TS, 'stakeholder': POCP_MT060100UV_Stakeholder, 'standardDeviation': PQ, 'state': adxp_state, 'statusCode': CS, 'storage': POCP_MT050100UV_Storage, 'storageCondition': POCP_MT050100UV_StorageCondition, 'strainText': ED, 'streetAddressLine': adxp_streetAddressLine, 'streetName': adxp_streetName, 'streetNameBase': adxp_streetNameBase, 'streetNameType': adxp_streetNameType, 'structuredBody': PORP_MT050032UV_StructuredBody, 'sub': StrucDoc_Sub, 'subject': POCP_MT070200UV_Subject2, 'subject2': PORP_MT050032UV_Subject3, 'subjectOf': POCP_MT020200UV_Subject, 'subsetCode': CS, 'substanceAdministration': POCP_MT010100UV_SubstanceAdministration, 'substanceAdministration1': POCP_MT060100UV_SubstanceAdministration1, 'substanceAdministrationCriterion': POCP_MT060100UV_SubstanceAdministrationCriterion, 'substanceSpecification': POCP_MT090100UV_SubstanceSpecification, 'suffix': enxp_suffix, 'sup': StrucDoc_Sup, 'table': StrucDoc_Table, 'targetSiteCode': CD, 'tbody': StrucDoc_Tbody, 'td': StrucDoc_Td, 'telecom': TEL, 'templateId': II, 'territorialAuthority': POCP_MT082100UV_TerritorialAuthority, 'territory': POCP_MT082100UV_Territory, 'text': ED, 'textFragmentReference': PORP_MT050032UV_TextFragmentReference, 'tfoot': StrucDoc_Tfoot, 'th': StrucDoc_Th, 'thead': StrucDoc_Thead, 'thumbnail': ED, 'time': TS, 'title': ST, 'tr': StrucDoc_Tr, 'translation': PQR, 'transportationEvent': POCP_MT040100UV_TransportationEvent, 'typeId': II, 'unitID': adxp_unitID, 'unitPriceAmt': RTO_MO_PQ, 'unitQuantity': RTO_PQ_PQ, 'unitType': adxp_unitType, 'useablePeriod': SXCM_TS, 'validTime': IVL_TS, 'value': ANY, 'valueNegationInd': BL, 'valuedItem': COCT_MT440001UV09_ValuedItem, 'verifier': PORP_MT050032UV_Verifier, 'versionNumber': ST, 'wholeProduct': POCP_MT010100UV_Product, 'wholeSubstance': POCP_MT080300UV_Substance, 'width': PQ, } USAGE_TEXT = """ Usage: python <Parser>.py [ -s ] <in_xml_file> """ def usage(): print(USAGE_TEXT) sys.exit(1) def get_root_tag(node): tag = Tag_pattern_.match(node.tag).groups()[-1] rootClass = GDSClassesMapping.get(tag) if rootClass is None: rootClass = globals().get(tag) return tag, rootClass def parse(inFileName, silence=False): parser = None doc = parsexml_(inFileName, parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'PORP_MT050032UV_Document' rootClass = PORP_MT050032UV_Document rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_='', pretty_print=True) return rootObj def parseEtree(inFileName, silence=False): parser = None doc = parsexml_(inFileName, parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'PORP_MT050032UV_Document' rootClass = PORP_MT050032UV_Document rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None mapping = {} rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping) reverse_mapping = rootObj.gds_reverse_node_mapping(mapping) if not silence: content = etree_.tostring( rootElement, pretty_print=True, xml_declaration=True, encoding="utf-8") sys.stdout.write(content) sys.stdout.write('\n') return rootObj, rootElement, mapping, reverse_mapping def parseString(inString, silence=False): if sys.version_info.major == 2: from StringIO import StringIO as IOBuffer else: from io import BytesIO as IOBuffer parser = None doc = parsexml_(IOBuffer(inString), parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'PORP_MT050032UV_Document' rootClass = PORP_MT050032UV_Document rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('<?xml version="1.0" ?>\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_='') return rootObj def parseLiteral(inFileName, silence=False): parser = None doc = parsexml_(inFileName, parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'PORP_MT050032UV_Document' rootClass = PORP_MT050032UV_Document rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('#from spl import *\n\n') sys.stdout.write('import spl as model_\n\n') sys.stdout.write('rootObj = model_.rootClass(\n') rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) sys.stdout.write(')\n') return rootObj def main(): args = sys.argv[1:] if len(args) == 1: parse(args[0]) else: usage() if __name__ == '__main__': #import pdb; pdb.set_trace() main() __all__ = [ "AD", "ADXP", "ANY", "ANYNonNull", "BIN", "BL", "BN", "BXIT_CD", "BXIT_IVL_PQ", "CD", "CE", "CO", "COCT_MT090108UV_AssignedPerson", "COCT_MT090108UV_Person", "COCT_MT090303UV01_AssignedDevice", "COCT_MT090303UV01_Device", "COCT_MT150003UV03_ContactParty", "COCT_MT150003UV03_Organization", "COCT_MT150003UV03_Person", "COCT_MT150007UV_ContactParty", "COCT_MT150007UV_Organization", "COCT_MT150007UV_Person", "COCT_MT240003UV02_ServiceDeliveryLocation", "COCT_MT440001UV09_ValuedItem", "COCT_MT710000UV07_LocatedEntity", "COCT_MT710000UV07_LocatedEntityHasParts", "COCT_MT710000UV07_LocatedEntityPartOf", "COCT_MT710000UV07_Place", "COCT_MT710000UV07_Subject7", "COCT_MT960000UV05_Author", "COCT_MT960000UV05_Component1", "COCT_MT960000UV05_Component2", "COCT_MT960000UV05_Device1", "COCT_MT960000UV05_Device2", "COCT_MT960000UV05_Position", "COCT_MT960000UV05_PositionAccuracy", "COCT_MT960000UV05_PositionCoordinate", "CR", "CS", "CV", "ED", "EDTranslation", "EIVL_PPD_TS", "EIVL_TS", "EIVL_event", "EN", "ENXP", "EXPR_PQ", "GLIST_PQ", "GLIST_TS", "HXIT_CE", "HXIT_PQ", "II", "INT", "IVL_INT", "IVL_MO", "IVL_PPD_PQ", "IVL_PPD_TS", "IVL_PQ", "IVL_REAL", "IVL_TS", "IVXB_INT", "IVXB_MO", "IVXB_PPD_PQ", "IVXB_PPD_TS", "IVXB_PQ", "IVXB_REAL", "IVXB_TS", "MO", "ON", "PIVL_PPD_TS", "PIVL_TS", "PN", "POCP_MT000100UV_NamedEntity", "POCP_MT000100UV_Organization", "POCP_MT000100UV_Policy", "POCP_MT000100UV_Subject", "POCP_MT000100UV_TerritorialAuthority", "POCP_MT000100UV_TerritorialAuthority1", "POCP_MT000100UV_Territory", "POCP_MT010100UV_ActDefinition", "POCP_MT010100UV_AdministerableMaterial", "POCP_MT010100UV_Author", "POCP_MT010100UV_Consumable1", "POCP_MT010100UV_Consumable2", "POCP_MT010100UV_Content", "POCP_MT010100UV_Content1", "POCP_MT010100UV_Device", "POCP_MT010100UV_EntityWithGeneric", "POCP_MT010100UV_EquivalentEntity", "POCP_MT010100UV_GenericMedicine", "POCP_MT010100UV_IdentifiedEntity", "POCP_MT010100UV_IndirectTarget", "POCP_MT010100UV_Ingredient", "POCP_MT010100UV_ManufacturedProduct", "POCP_MT010100UV_ManufacturedProduct2", "POCP_MT010100UV_ManufacturedProduct3", "POCP_MT010100UV_MaterialKind", "POCP_MT010100UV_PackagedProduct", "POCP_MT010100UV_Part", "POCP_MT010100UV_PartOfAssembly", "POCP_MT010100UV_PotentialSupply", "POCP_MT010100UV_PrimaryPerformer", "POCP_MT010100UV_Product", "POCP_MT010100UV_Product2", "POCP_MT010100UV_Product3", "POCP_MT010100UV_Reconstitution", "POCP_MT010100UV_SpecializedKind", "POCP_MT010100UV_Subject", "POCP_MT010100UV_SubstanceAdministration", "POCP_MT010200UV_ActDefinition", "POCP_MT010200UV_AdministerableMaterial", "POCP_MT010200UV_Author", "POCP_MT010200UV_Consumable1", "POCP_MT010200UV_Consumable2", "POCP_MT010200UV_Content", "POCP_MT010200UV_Content1", "POCP_MT010200UV_Device", "POCP_MT010200UV_EntityWithGeneric", "POCP_MT010200UV_EquivalentEntity", "POCP_MT010200UV_GenericMedicine", "POCP_MT010200UV_IdentifiedEntity", "POCP_MT010200UV_IndirectTarget", "POCP_MT010200UV_Ingredient", "POCP_MT010200UV_ManufacturedProduct", "POCP_MT010200UV_ManufacturedProduct2", "POCP_MT010200UV_ManufacturedProduct3", "POCP_MT010200UV_MaterialKind", "POCP_MT010200UV_PackagedProduct", "POCP_MT010200UV_Part", "POCP_MT010200UV_PartOfAssembly", "POCP_MT010200UV_PotentialSupply", "POCP_MT010200UV_PrimaryPerformer", "POCP_MT010200UV_Product", "POCP_MT010200UV_Product2", "POCP_MT010200UV_Product3", "POCP_MT010200UV_Reconstitution", "POCP_MT010200UV_SpecializedKind", "POCP_MT010200UV_Subject", "POCP_MT010200UV_SubstanceAdministration", "POCP_MT010300UV_MaterialKind", "POCP_MT010300UV_SpecializedKind", "POCP_MT010300UV_Subject", "POCP_MT010400UV_MaterialKind", "POCP_MT010600UV_ActDefinition", "POCP_MT010600UV_AdministerableMaterial", "POCP_MT010600UV_Author", "POCP_MT010600UV_Consumable1", "POCP_MT010600UV_Consumable2", "POCP_MT010600UV_Content", "POCP_MT010600UV_Content1", "POCP_MT010600UV_Device", "POCP_MT010600UV_EntityWithGeneric", "POCP_MT010600UV_EquivalentEntity", "POCP_MT010600UV_GenericMedicine", "POCP_MT010600UV_IdentifiedEntity", "POCP_MT010600UV_IndirectTarget", "POCP_MT010600UV_Ingredient", "POCP_MT010600UV_ManufacturedProduct", "POCP_MT010600UV_ManufacturedProduct2", "POCP_MT010600UV_ManufacturedProduct3", "POCP_MT010600UV_MaterialKind", "POCP_MT010600UV_PackagedProduct", "POCP_MT010600UV_Part", "POCP_MT010600UV_PartOfAssembly", "POCP_MT010600UV_PotentialSupply", "POCP_MT010600UV_PrimaryPerformer", "POCP_MT010600UV_Product", "POCP_MT010600UV_Product2", "POCP_MT010600UV_Product3", "POCP_MT010600UV_Reconstitution", "POCP_MT010600UV_SpecializedKind", "POCP_MT010600UV_Subject", "POCP_MT010600UV_SubstanceAdministration", "POCP_MT020100UV_Container", "POCP_MT020100UV_Content2", "POCP_MT020100UV_Content3", "POCP_MT020100UV_DeviceInstance", "POCP_MT020100UV_IdentifiedItem", "POCP_MT020100UV_Ingredient1", "POCP_MT020100UV_InstanceOfKind1", "POCP_MT020100UV_InstanceOfKind2", "POCP_MT020100UV_Member", "POCP_MT020100UV_Member1", "POCP_MT020100UV_Part", "POCP_MT020100UV_ProductIdentifierIssuer", "POCP_MT020100UV_ProductInstance", "POCP_MT020100UV_Subject", "POCP_MT020200UV_Container", "POCP_MT020200UV_Content2", "POCP_MT020200UV_Content3", "POCP_MT020200UV_DeviceInstance", "POCP_MT020200UV_IdentifiedItem", "POCP_MT020200UV_Ingredient1", "POCP_MT020200UV_InstanceOfKind", "POCP_MT020200UV_InstanceOfKind2", "POCP_MT020200UV_Member", "POCP_MT020200UV_Member1", "POCP_MT020200UV_Part", "POCP_MT020200UV_ProductIdentifierIssuer", "POCP_MT020200UV_ProductInstance", "POCP_MT020200UV_Subject", "POCP_MT030100UV_ActDefinition", "POCP_MT030100UV_AssignedEntity", "POCP_MT030100UV_AssignedEntity2", "POCP_MT030100UV_AssignedEntity3", "POCP_MT030100UV_ContactParty", "POCP_MT030100UV_ManufacturedProduct3", "POCP_MT030100UV_Organization", "POCP_MT030100UV_OtherLocation", "POCP_MT030100UV_Person", "POCP_MT030100UV_PrimaryPerformer", "POCP_MT030100UV_Product", "POCP_MT030100UV_Subject", "POCP_MT030100UV_Subject2", "POCP_MT030200UV_ActDefinition", "POCP_MT030200UV_AssignedEntity", "POCP_MT030200UV_AssignedEntity3", "POCP_MT030200UV_ContactParty", "POCP_MT030200UV_ManufacturedProduct3", "POCP_MT030200UV_Organization", "POCP_MT030200UV_OtherLocation", "POCP_MT030200UV_Person", "POCP_MT030200UV_PrimaryPerformer", "POCP_MT030200UV_Product", "POCP_MT030200UV_Subject", "POCP_MT030200UV_Subject2", "POCP_MT030300UV_ActDefinition", "POCP_MT030300UV_AssignedEntity", "POCP_MT030300UV_AssignedEntity3", "POCP_MT030300UV_ContactParty", "POCP_MT030300UV_ManufacturedProduct3", "POCP_MT030300UV_Organization", "POCP_MT030300UV_OtherLocation", "POCP_MT030300UV_Person", "POCP_MT030300UV_PrimaryPerformer", "POCP_MT030300UV_Product", "POCP_MT030300UV_Subject", "POCP_MT030300UV_Subject2", "POCP_MT040100UV_Author", "POCP_MT040100UV_Component", "POCP_MT040100UV_Destination", "POCP_MT040100UV_ObservationEvent", "POCP_MT040100UV_Origin", "POCP_MT040100UV_Performer", "POCP_MT040100UV_ProductEvent", "POCP_MT040100UV_SequelTo", "POCP_MT040100UV_TransportationEvent", "POCP_MT050100UV_Action", "POCP_MT050100UV_Agency", "POCP_MT050100UV_Analyte", "POCP_MT050100UV_Approval", "POCP_MT050100UV_Author1", "POCP_MT050100UV_Author2", "POCP_MT050100UV_Characteristic", "POCP_MT050100UV_ContactParty", "POCP_MT050100UV_ControlVariable", "POCP_MT050100UV_Coverage", "POCP_MT050100UV_Custodian", "POCP_MT050100UV_Document", "POCP_MT050100UV_Holder", "POCP_MT050100UV_Interactor", "POCP_MT050100UV_Location", "POCP_MT050100UV_MarketingAct", "POCP_MT050100UV_MonitoringProgram", "POCP_MT050100UV_ObservationGoal", "POCP_MT050100UV_Person", "POCP_MT050100UV_PertinentInformation", "POCP_MT050100UV_Policy", "POCP_MT050100UV_Role", "POCP_MT050100UV_SourceOf", "POCP_MT050100UV_SourceOf2", "POCP_MT050100UV_Storage", "POCP_MT050100UV_StorageCondition", "POCP_MT050100UV_Subject", "POCP_MT050100UV_TerritorialAuthority", "POCP_MT050100UV_Territory", "POCP_MT050500UV_Action", "POCP_MT050500UV_Analyte", "POCP_MT050500UV_Author1", "POCP_MT050500UV_Characteristic", "POCP_MT050500UV_Document", "POCP_MT050500UV_Interactor", "POCP_MT050500UV_Subject", "POCP_MT050600UV_Action", "POCP_MT050600UV_Analyte", "POCP_MT050600UV_Author1", "POCP_MT050600UV_Characteristic", "POCP_MT050600UV_Document", "POCP_MT050600UV_Interactor", "POCP_MT050600UV_Subject", "POCP_MT050700UV_Action", "POCP_MT050700UV_Agency", "POCP_MT050700UV_Analyte", "POCP_MT050700UV_Approval", "POCP_MT050700UV_Author1", "POCP_MT050700UV_Author2", "POCP_MT050700UV_Characteristic", "POCP_MT050700UV_ContactParty", "POCP_MT050700UV_Document", "POCP_MT050700UV_Holder", "POCP_MT050700UV_Interactor", "POCP_MT050700UV_Person", "POCP_MT050700UV_PertinentInformation", "POCP_MT050700UV_Policy", "POCP_MT050700UV_Role", "POCP_MT050700UV_SourceOf", "POCP_MT050700UV_SourceOf2", "POCP_MT050700UV_Subject", "POCP_MT050700UV_TerritorialAuthority", "POCP_MT050700UV_Territory", "POCP_MT060100UV_ActCriterion", "POCP_MT060100UV_AdministrableMaterial", "POCP_MT060100UV_Analyte", "POCP_MT060100UV_CauseOf", "POCP_MT060100UV_Component", "POCP_MT060100UV_Component1", "POCP_MT060100UV_Component2", "POCP_MT060100UV_Component3", "POCP_MT060100UV_Component4", "POCP_MT060100UV_ConsequenceObservation", "POCP_MT060100UV_Consumable1", "POCP_MT060100UV_Consumable2", "POCP_MT060100UV_DerivedFrom", "POCP_MT060100UV_Device", "POCP_MT060100UV_DocumentReference", "POCP_MT060100UV_Effect", "POCP_MT060100UV_Frequency", "POCP_MT060100UV_Goal", "POCP_MT060100UV_IndicationObservationCriterion", "POCP_MT060100UV_Issue", "POCP_MT060100UV_MaintenanceGoal", "POCP_MT060100UV_Mitigates", "POCP_MT060100UV_MonitoringObservation", "POCP_MT060100UV_ObservationCriterion", "POCP_MT060100UV_ObservationDefinition", "POCP_MT060100UV_Participant", "POCP_MT060100UV_Precondition", "POCP_MT060100UV_ProcedureCriterion", "POCP_MT060100UV_Protocol", "POCP_MT060100UV_Reason", "POCP_MT060100UV_Requirement", "POCP_MT060100UV_Risk", "POCP_MT060100UV_Severity", "POCP_MT060100UV_Stakeholder", "POCP_MT060100UV_Subject", "POCP_MT060100UV_Subject1", "POCP_MT060100UV_Subject2", "POCP_MT060100UV_Subject3", "POCP_MT060100UV_Subject4", "POCP_MT060100UV_SubstanceAdministration1", "POCP_MT060100UV_SubstanceAdministration2", "POCP_MT060100UV_SubstanceAdministrationCriterion", "POCP_MT070100UV_Component", "POCP_MT070100UV_Consumable", "POCP_MT070100UV_DerivedFrom", "POCP_MT070100UV_Generalization", "POCP_MT070100UV_ManifestationOf", "POCP_MT070100UV_Observation", "POCP_MT070100UV_ObservationCriterion", "POCP_MT070100UV_Participant", "POCP_MT070100UV_ReferenceRange", "POCP_MT070200UV_ActDefinition", "POCP_MT070200UV_Component1", "POCP_MT070200UV_Component2", "POCP_MT070200UV_Component3", "POCP_MT070200UV_ControlVariable1", "POCP_MT070200UV_ControlVariable2", "POCP_MT070200UV_Device2", "POCP_MT070200UV_DeviceObservation", "POCP_MT070200UV_DeviceSetting", "POCP_MT070200UV_InterventionProcedure", "POCP_MT070200UV_PatientObservation", "POCP_MT070200UV_Subject2", "POCP_MT080200UV_Component", "POCP_MT080200UV_Component2", "POCP_MT080200UV_Derivation", "POCP_MT080200UV_DirectTarget", "POCP_MT080200UV_Entity", "POCP_MT080200UV_OrganismStrain", "POCP_MT080200UV_PresentSubstance", "POCP_MT080200UV_Product", "POCP_MT080200UV_SpecializedKind", "POCP_MT080200UV_Species", "POCP_MT080200UV_Subject", "POCP_MT080300UV_Bond", "POCP_MT080300UV_Component", "POCP_MT080300UV_ControlVariable", "POCP_MT080300UV_DerivationProcess", "POCP_MT080300UV_EquivalentSubstance", "POCP_MT080300UV_Generalization1", "POCP_MT080300UV_Generalization2", "POCP_MT080300UV_IdentifiedSubstance", "POCP_MT080300UV_Ingredient", "POCP_MT080300UV_Interaction", "POCP_MT080300UV_Interactor", "POCP_MT080300UV_Interactor2", "POCP_MT080300UV_Interactor3", "POCP_MT080300UV_Moiety", "POCP_MT080300UV_Moiety1", "POCP_MT080300UV_Moiety2", "POCP_MT080300UV_NamedEntity", "POCP_MT080300UV_Organization", "POCP_MT080300UV_Policy", "POCP_MT080300UV_Product", "POCP_MT080300UV_Subject", "POCP_MT080300UV_Subject2", "POCP_MT080300UV_Substance", "POCP_MT080300UV_TerritorialAuthority", "POCP_MT080300UV_TerritorialAuthority1", "POCP_MT080300UV_Territory", "POCP_MT081100UV_ActiveMoiety", "POCP_MT081100UV_ActiveMoietyEntity", "POCP_MT081100UV_EquivalentSubstance", "POCP_MT081100UV_Subject", "POCP_MT081100UV_Substance", "POCP_MT082100UV_Bond", "POCP_MT082100UV_Component", "POCP_MT082100UV_ControlVariable", "POCP_MT082100UV_DerivationProcess", "POCP_MT082100UV_EquivalentSubstance", "POCP_MT082100UV_Generalization1", "POCP_MT082100UV_Generalization2", "POCP_MT082100UV_IdentifiedSubstance", "POCP_MT082100UV_Interaction", "POCP_MT082100UV_Interactor", "POCP_MT082100UV_Interactor2", "POCP_MT082100UV_Interactor3", "POCP_MT082100UV_Moiety1", "POCP_MT082100UV_Moiety2", "POCP_MT082100UV_NamedEntity", "POCP_MT082100UV_Organization", "POCP_MT082100UV_Policy", "POCP_MT082100UV_Product", "POCP_MT082100UV_Subject", "POCP_MT082100UV_Subject2", "POCP_MT082100UV_Substance", "POCP_MT082100UV_TerritorialAuthority", "POCP_MT082100UV_TerritorialAuthority1", "POCP_MT082100UV_Territory", "POCP_MT090100UV_Analyte", "POCP_MT090100UV_Author", "POCP_MT090100UV_Component", "POCP_MT090100UV_Component2", "POCP_MT090100UV_Consumable", "POCP_MT090100UV_ControlVariable", "POCP_MT090100UV_Device", "POCP_MT090100UV_Interactor", "POCP_MT090100UV_Observation", "POCP_MT090100UV_ObservationCriterion", "POCP_MT090100UV_PrimaryPerformer", "POCP_MT090100UV_ProcessStep", "POCP_MT090100UV_ReferenceRange", "POCP_MT090100UV_Subject", "POCP_MT090100UV_Subject2", "POCP_MT090100UV_Subject3", "POCP_MT090100UV_SubstanceSpecification", "PORP_MT050032UV_Author", "PORP_MT050032UV_Comment", "PORP_MT050032UV_Component1", "PORP_MT050032UV_Component2", "PORP_MT050032UV_Component3", "PORP_MT050032UV_Document", "PORP_MT050032UV_ExcerptFrom", "PORP_MT050032UV_Highlight", "PORP_MT050032UV_LegalAuthenticator", "PORP_MT050032UV_NonXMLBody", "PORP_MT050032UV_ObservationMedia", "PORP_MT050032UV_RelatedDocument", "PORP_MT050032UV_RelatedDocument1", "PORP_MT050032UV_ReplacementOf", "PORP_MT050032UV_Section", "PORP_MT050032UV_SectionReplaced", "PORP_MT050032UV_SequelTo", "PORP_MT050032UV_StructuredBody", "PORP_MT050032UV_Subject", "PORP_MT050032UV_Subject1", "PORP_MT050032UV_Subject2", "PORP_MT050032UV_Subject3", "PORP_MT050032UV_Subject4", "PORP_MT050032UV_TextFragmentReference", "PORP_MT050032UV_Verifier", "PPD_PQ", "PPD_TS", "PQ", "PQR", "QTY", "REAL", "RTO", "RTO_INT_PQ", "RTO_MO_PQ", "RTO_PQ_PQ", "RTO_QTY_QTY", "SC", "SLIST_PQ", "SLIST_TS", "ST", "STTranslation", "SXCM_CD", "SXCM_INT", "SXCM_MO", "SXCM_PPD_PQ", "SXCM_PPD_TS", "SXCM_PQ", "SXCM_REAL", "SXCM_TS", "SXPR_TS", "StrucDoc_Caption", "StrucDoc_Col", "StrucDoc_Colgroup", "StrucDoc_Content", "StrucDoc_Footnote", "StrucDoc_FootnoteRef", "StrucDoc_Item", "StrucDoc_LinkHtml", "StrucDoc_List", "StrucDoc_Paragraph", "StrucDoc_RenderMultiMedia", "StrucDoc_Sub", "StrucDoc_Sup", "StrucDoc_Table", "StrucDoc_Tbody", "StrucDoc_Td", "StrucDoc_Text", "StrucDoc_Tfoot", "StrucDoc_Th", "StrucDoc_Thead", "StrucDoc_Title", "StrucDoc_TitleContent", "StrucDoc_TitleFootnote", "StrucDoc_Tr", "TEL", "TN", "TS", "URG_PQ", "URL", "URXB_PQ", "UVP_PQ", "UVP_TS", "adxp_additionalLocator", "adxp_addressLine", "adxp_buildingNumberSuffix", "adxp_careOf", "adxp_censusTract", "adxp_city", "adxp_country", "adxp_county", "adxp_delimiter", "adxp_deliveryAddressLine", "adxp_deliveryInstallationArea", "adxp_deliveryInstallationQualifier", "adxp_deliveryInstallationType", "adxp_deliveryMode", "adxp_deliveryModeIdentifier", "adxp_direction", "adxp_houseNumber", "adxp_houseNumberNumeric", "adxp_intersection", "adxp_part", "adxp_postBox", "adxp_postalCode", "adxp_precinct", "adxp_state", "adxp_streetAddressLine", "adxp_streetName", "adxp_streetNameBase", "adxp_streetNameType", "adxp_unitID", "adxp_unitType", "enxp_delimiter", "enxp_family", "enxp_given", "enxp_part", "enxp_prefix", "enxp_suffix", "enxp_title", "thumbnail" ]