code: def sequence_id_factory(value, datatype_cls, validation_level=None):
      
      if not value:
          return datatype_cls(validation_level=validation_level)
      try:
          return datatype_cls(int(value), validation_level=validation_level)
      except ValueError:
          raise ValueError('{0} is not an HL7 valid SI value'.format(value))
docs: Creates a :class:`SI <hl7apy.base_datatypes.SI>` object
  
      The value in input can be a string representing an integer number or an ``int``.
      (i.e. a string valid for ``int()``  ).
      If it's not, a :exc:`ValueError` is raised
      Also an empty string or ``None`` are allowed
  
      :type value: ``str`` or ``None``
      :param value: the value to assign the date object
  
      :type datatype_cls: `class`
      :param value: the SI class to use. It has to be loaded from one implementation of the different version
          modules
  
      :type validation_level: ``int``
      :param validation_level: It must be a value from class
          :class:`VALIDATION_LEVEL hl7apy.consts.VALIDATION_LEVEL` or ``None`` to use the default value
  
      :rtype: :class:`SI <hl7apy.base_datatypes.SI>`