def METHOD_NAME(name: str, tkns: List[Token], doc: Doc, cdb: CDB, config: Config, label: str = 'concept') -> Optional[Span]:
    """Given a name it will check should it be annotated based on config rules. If yes
    the annotation will be added to the doc._.ents array.
    Args:
        name (str):
            The name found in the text of the document.
        tkns (List[spacy.tokens.Token]):
            Tokens that belong to this name in the spacy document.
        doc (spacy.tokens.Doc):
            Spacy document to be annotated with named entities.
        cdb (medcat.cdb.CDB):
            Concept database.
        config (medcat.config.Config):
            Global config for medcat.
        label (str):
            Label for this name (usually `concept` if we are using a vocab based approach).
    """
    logger.debug("Maybe annotating name: %s", name)
    # Check uppercase to distinguish uppercase and lowercase words that have a different meaning.
    if config.ner.get('check_upper_case_names'):
        # Check whether name is completely uppercase in CDB.
        if cdb.name_isupper.get(name, False):
            # Check whether tokens are also in uppercase. If tokens are not in uppercase, there is a mismatch.
            if not all([x.is_upper for x in tkns]):
                return None
    if len(name) >= config.ner['min_name_len']:
        # Check the upper case limit, last part checks is it one token and uppercase
        if len(name) >= config.ner['upper_case_limit_len'] or (len(tkns) == 1 and tkns[0].is_upper):
            # Everything is fine, mark name
            entity = Span(doc, tkns[0].i, tkns[-1].i + 1, label=label)
            # Only set this property when using a vocab approach and where this name
            #fits a name in the cdb. All standard name entity recognition models will not set this.
            entity._.detected_name = name
            entity._.link_candidates = cdb.name2cuis[name]
            entity._.id = len(doc._.ents)
            entity._.confidence = -1  # This does not calculate confidence
            # Append the entity to the document
            doc._.ents.append(entity)
            # Not necessary, but why not
            logger.debug("NER detected an entity." +
                         "\n\tDetected name: %s" +
                         "\n\tLink candidates: %s\n", entity._.detected_name, entity._.link_candidates)
            return entity
    return None