
    Given a patient's medication tracking code, create a new tracking code by rearranging its digits to form the next highest possible number while maintaining the same digits. The new tracking code must be the smallest possible number that is greater than the original code using the same digits, ensuring efficient chronological tracking of medication events.
    

    
def rearrange_bigger(n):
    """
    Given a patient's medication tracking code, create a new tracking code by rearranging its digits to form the next highest possible number while maintaining the same digits. The new tracking code must be the smallest possible number that is greater than the original code using the same digits, ensuring efficient chronological tracking of medication events.
    

    """
def rearrange_bigger(n):
    """
    Given a patient's medication tracking code, create a new tracking code by rearranging its digits to form the next highest possible number while maintaining the same digits. The new tracking code must be the smallest possible number that is greater than the original code using the same digits, ensuring efficient chronological tracking of medication events.
    

    """
    nums = list(str(n))
    for i in range(len(nums) - 2, -1, -1):
        if nums[i] < nums[i + 1]:
            z = nums[i:]
            y = min(filter(lambda x: x > z[0], z))
            z.remove(y)
            z.sort()
            nums[i:] = [y] + z
            return int(''.join(nums))
    return False