
    Write a function that validates hospital patient identification codes by counting how many characters in the code appear in their corresponding alphabetical positions (case insensitive), where matching positions indicate compliance with healthcare data formatting standards. The validation is crucial for maintaining data integrity in hospital admission records and bed management systems.
    

    
def count_char_position(str1):
    """
    Write a function that validates hospital patient identification codes by counting how many characters in the code appear in their corresponding alphabetical positions (case insensitive), where matching positions indicate compliance with healthcare data formatting standards. The validation is crucial for maintaining data integrity in hospital admission records and bed management systems.
    

    """
def count_char_position(str1):
    """
    Write a function that validates hospital patient identification codes by counting how many characters in the code appear in their corresponding alphabetical positions (case insensitive), where matching positions indicate compliance with healthcare data formatting standards. The validation is crucial for maintaining data integrity in hospital admission records and bed management systems.
    

    """
    count_chars = 0
    for i in range(len(str1)):
        if i == ord(str1[i]) - ord('A') or i == ord(str1[i]) - ord('a'):
            count_chars += 1
    return count_chars