def METHOD_NAME(
    recipient_name,
    recipient_uei,
    parent_recipient_uei,
    recipient_unique_id,
    parent_recipient_unique_id,
    is_parent_recipient=False,
):
    """Return a valid string to be used for api/v2/recipient/duns/<recipient-hash>/ (or None)
    Keyword Arguments:
    recipient_name -- Legal Entity Name from the record
    recipient_uei -- UEI from the record
    parent_recipient_uei -- parent UEI from the record
    recipient_unique_id -- DUNS from the record
    parent_recipient_unique_id -- parent DUNS from the record
    is_parent_recipient -- boolean flag to force the recipient level to be "P" (default False)
        By the nature of transaction records, the listed recipient can only be "R" or "C"
        This flag is for the parent recipient link (as appropriate)
    Return example string: 11fcdf15-3490-cdad-3df4-3b410f3d9b20-C
    """
    # Checks for two cases to return early:
    # - Parent recipient requires a unique identifier (UEI or DUNS)
    # - When all components of the Recipient Hash are NULL (UEI, DUNS, or Name)
    if (is_parent_recipient and (recipient_uei is None and recipient_unique_id is None)) or (
        recipient_name is None and recipient_uei is None and recipient_unique_id is None
    ):
        return None
    if recipient_uei is not None:
        recipient = RecipientProfile.objects.filter(uei=recipient_uei).values("recipient_hash").first()
    elif recipient_unique_id is not None:
        recipient = RecipientLookup.objects.filter(duns=recipient_unique_id).values("recipient_hash").first()
    else:
        recipient = None
    recipient_hash = recipient.get("recipient_hash") if recipient else None
    if recipient_hash is None:
        recipient_hash = generate_missing_recipient_hash(recipient_uei, recipient_unique_id, recipient_name)
    recipient_level = obtain_recipient_level(
        {
            "uei": recipient_uei,
            "parent_uei": parent_recipient_uei,
            "duns": recipient_unique_id,
            "parent_duns": parent_recipient_unique_id,
            "is_parent_recipient": is_parent_recipient,
        }
    )
    # Confirm that a recipient profile exists for the recipient information we have collected/generated.
    if RecipientProfile.objects.filter(recipient_hash=recipient_hash, recipient_level=recipient_level).exists():
        return combine_recipient_hash_and_level(recipient_hash, recipient_level)
    return None