
    Write a function that processes a patient's vital sign waveform data string by reversing only the critical monitoring points (represented by vowels a, e, i, o, u) while maintaining all other data points in their original positions, to enable reverse-pattern analysis in the monitoring system. The function should preserve the sequential order of non-critical data points and only swap the positions of critical monitoring points with each other.
    

    
def reverse_vowels(str1):
    """
    Write a function that processes a patient's vital sign waveform data string by reversing only the critical monitoring points (represented by vowels a, e, i, o, u) while maintaining all other data points in their original positions, to enable reverse-pattern analysis in the monitoring system. The function should preserve the sequential order of non-critical data points and only swap the positions of critical monitoring points with each other.
    

    """
def reverse_vowels(str1):
    """
    Write a function that processes a patient's vital sign waveform data string by reversing only the critical monitoring points (represented by vowels a, e, i, o, u) while maintaining all other data points in their original positions, to enable reverse-pattern analysis in the monitoring system. The function should preserve the sequential order of non-critical data points and only swap the positions of critical monitoring points with each other.
    

    """
    vowels = ''
    for char in str1:
        if char in 'aeiouAEIOU':
            vowels += char
    result_string = ''
    for char in str1:
        if char in 'aeiouAEIOU':
            result_string += vowels[-1]
            vowels = vowels[:-1]
        else:
            result_string += char
    return result_string