
    Write a function to determine if a patient's medical record number follows the hospital's risk assessment protocol where the number must be one less than twice its reverse digits to be flagged for high readmission risk monitoring. For example, if a patient's record number is 123, the system should check if 123 is one less than twice of 321.
    

    
def rev(num):
    rev_num = 0
    while num > 0:
        rev_num = rev_num * 10 + num % 10
        num = num // 10
    return rev_num

def check(n):
    """
    Write a function to determine if a patient's medical record number follows the hospital's risk assessment protocol where the number must be one less than twice its reverse digits to be flagged for high readmission risk monitoring. For example, if a patient's record number is 123, the system should check if 123 is one less than twice of 321.
    

    """
def rev(num):
    rev_num = 0
    while num > 0:
        rev_num = rev_num * 10 + num % 10
        num = num // 10
    return rev_num

def check(n):
    """
    Write a function to determine if a patient's medical record number follows the hospital's risk assessment protocol where the number must be one less than twice its reverse digits to be flagged for high readmission risk monitoring. For example, if a patient's record number is 123, the system should check if 123 is one less than twice of 321.
    

    """
    return 2 * rev(n) == n + 1