def _generate_document_barcode(self, sequence):
        log.debug("doc_codes.models Generate document barcode called. sequence: %s", sequence)
        # HACK: Ideally we shouldn't need a 'barcode_format' field, as that could be inferred from the regex. (maybe?)
        # along with the integer padding required? eg assume a fixed length integer portion of a regex is padded
        # TODO: Validate the generated code to ensure it's valid, and not invalid according to the regex.

        if len(self.barcode_format) > 0:
            n = str(sequence)
            n = n.zfill(self.barcode_zfill)
            log.debug('barcode: %s' % self.barcode_format % n)
            return self.barcode_format % n
        else:
            log.debug("False barcode")
            return False
Calls GetPersonInfo, returns selected_record_id
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/core/models.py/DocumentTypeRule._generate_document_barcode--crossover with--dataset/ETHPy150Open orcasgit/python-healthvault/healthvaultlib/healthvault.py/HealthVaultConn._get_record_id