import re


def rpcPrefix(rpcFile):
    """
    Returns the RPC filename prefix for the given RPC file.

    :param rpcFile: RPC file document.
    :type rpcFile: dict
    :returns: prefix string
    """
    match = re.match(r'.*?(?P<prefix>[0-9]{2}[A-Z]{3}[0-9]{8})\-'
                     '(?P<modality>P1BS|M1BS)\-'
                     '(?P<trail>[0-9]{12}_[0-9]{2}_P[0-9]{3})',
                     rpcFile['name'],
                     flags=re.IGNORECASE)

    if match:
        return "%s-%s" % (match.group('prefix'), match.group('trail'))
    else:
        return None