
    Design a function that determines the minimum batch size (as a power of 2) needed to process patient records in the hospital's risk assessment system, where the batch size must be large enough to accommodate all current patient records while maintaining computational efficiency. The function should take the current number of patient records as input and return the smallest power of 2 that can contain all records in a single batch.
    

    
def next_power_of_2(n):
    """
    Design a function that determines the minimum batch size (as a power of 2) needed to process patient records in the hospital's risk assessment system, where the batch size must be large enough to accommodate all current patient records while maintaining computational efficiency. The function should take the current number of patient records as input and return the smallest power of 2 that can contain all records in a single batch.
    

    """
def next_power_of_2(n):
    """
    Design a function that determines the minimum batch size (as a power of 2) needed to process patient records in the hospital's risk assessment system, where the batch size must be large enough to accommodate all current patient records while maintaining computational efficiency. The function should take the current number of patient records as input and return the smallest power of 2 that can contain all records in a single batch.
    

    """
    if n and (not n & n - 1):
        return n
    count = 0
    while n != 0:
        n >>= 1
        count += 1
    return 1 << count