
    In a hospital triage system, develop an algorithm that determines the next higher risk category score by rearranging the digits of a patient's current composite health risk score, while maintaining the same set of digits. This adjusted score must be the smallest possible value greater than the current score, helping medical staff quickly identify and prioritize patients who may need immediate intervention.
    

    
def rearrange_bigger(n):
    """
    In a hospital triage system, develop an algorithm that determines the next higher risk category score by rearranging the digits of a patient's current composite health risk score, while maintaining the same set of digits. This adjusted score must be the smallest possible value greater than the current score, helping medical staff quickly identify and prioritize patients who may need immediate intervention.
    

    """
def rearrange_bigger(n):
    """
    In a hospital triage system, develop an algorithm that determines the next higher risk category score by rearranging the digits of a patient's current composite health risk score, while maintaining the same set of digits. This adjusted score must be the smallest possible value greater than the current score, helping medical staff quickly identify and prioritize patients who may need immediate intervention.
    

    """
    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