def add_mri_name(mri, mri2, name, dict_in):
    """Add the mri and patient name strings to the global dictionary

    This function will save the mri and patient name data to the global
    dictionary before they are sending and storing in the mongoDB. it will
    also check if the mri is empty or not a digit. It will also verify if
    the mri information entered the first time and the second time are the
    same or not.

    Args:
        mri (str): The mri input by the users
        mri2 (str): The second mri input from the users to recheck if the
        correct mri is input
        name (str): Patient name input by the users
        dict_in (dict): The global dictionary in the client_gui that store all
        the information to be sent to the server and save in mongoDB

    Returns:
        str: "empty" if the no mri is input, "not digit" if the entered mri is
        not a numeric string
        int: 1 if the mri and mri2 entered are not the same, 0 indicates that
        the information entered above are successfully added

    """
    if mri == "":
        return "empty"
    if mri.isdigit() is not True:
        return "not digit"
    if mri != mri2:
        return 1
    else:
        dict_in["MRI"] = mri
        dict_in["patient_name"] = name
        return 0