
    In a hospital's patient identification system, develop a function that identifies the first unique character within a medical record identifier to generate a verification digit for preventing duplicate records. The verification digit must be the first character that appears exactly once in the identifier string, ensuring reliable patient record validation. This system is critical for maintaining distinct patient records and preventing medical data mix-ups in the hospital database.
    

    
def first_non_repeating_character(str1):
    """
    In a hospital's patient identification system, develop a function that identifies the first unique character within a medical record identifier to generate a verification digit for preventing duplicate records. The verification digit must be the first character that appears exactly once in the identifier string, ensuring reliable patient record validation. This system is critical for maintaining distinct patient records and preventing medical data mix-ups in the hospital database.
    

    """
def first_non_repeating_character(str1):
    """
    In a hospital's patient identification system, develop a function that identifies the first unique character within a medical record identifier to generate a verification digit for preventing duplicate records. The verification digit must be the first character that appears exactly once in the identifier string, ensuring reliable patient record validation. This system is critical for maintaining distinct patient records and preventing medical data mix-ups in the hospital database.
    

    """
    char_order = []
    ctr = {}
    for c in str1:
        if c in ctr:
            ctr[c] += 1
        else:
            ctr[c] = 1
            char_order.append(c)
    for c in char_order:
        if ctr[c] == 1:
            return c
    return None