code: def add(self, obj):
          
          # base datatype components can't have more than one child
          if self.name and is_base_datatype(self.datatype, self.version) and \
                  len(self.children) >= 1:
              raise MaxChildLimitReached(self, obj, 1)
  
          # the name is different from the datatype (i.e. the name has been forced to be equal to the datatype)
          try:
              if obj.name and obj.name != obj.datatype:
                  try:
                      if not _valid_child_name(obj.name, self.datatype):
                          raise ChildNotValid(obj.name, self)
                  except AttributeError:
                      pass
          except ChildNotFound:  # obj.datatype causes ChildNotFound for some Elements (Message, Groups etc)
              raise ChildNotValid(obj, self)
  
          return super(Component, self).add(obj)
docs: Add an instance of :class:`SubComponent <hl7apy.core.SubComponent>` to the list of children
  
          :param obj: an instance of :class:`SubComponent <hl7apy.core.SubComponent>`
  
          >>> c = Component('CX_10')
          >>> s = SubComponent(name='CWE_1', value='EXAMPLE_ID')
          >>> s2 = SubComponent(name='CWE_4', value='ALT_ID')
          >>> c.add(s)
          >>> c.add(s2)
          >>> print(c.to_er7())
          EXAMPLE_ID&&&ALT_ID