/**
 * Given a dictionary of patient records, a patient ID, a field name, and a new value,
 * modify the value of the specified field in the patient's record with the new value.
 *
 * @param patientData Dictionary of patient records where the keys are patient IDs and the values are dictionaries of patient attributes.
 * @param patientId ID of the patient whose record needs to be modified.
 * @param field Name of the field that needs to be modified.
 * @param newValue New value to be assigned to the specified field.
 * @return True if the modification was successful, False otherwise.
 */
fun modifyPatientRecord(patientData: MutableMap<String, MutableMap<String, String>>, patientId: String, field: String, newValue: String): Boolean {

    // Check if the patient ID exists in the patientData dictionary
    if (patientId in patientData) {
        // Check if the field exists in the patient's record
        if (field in patientData[patientId]!!) {
            // Update the field value with the new value
            patientData[patientId]!![field] = newValue
            return true
        }
    }
    return false
}
/**
 * Given a dictionary of patient records, a patient ID, a field name, and a new value,
 * modify the value of the specified field in the patient's record with the new value.
 *
 * @param patientData Dictionary of patient records where the keys are patient IDs and the values are dictionaries of patient attributes.
 * @param patientId ID of the patient whose record needs to be modified.
 * @param field Name of the field that needs to be modified.
 * @param newValue New value to be assigned to the specified field.
 * @return True if the modification was successful, False otherwise.
 */
fun modifyPatientRecord(patientData: MutableMap<String, MutableMap<String, String>>, patientId: String, field: String, newValue: String): Boolean {
/**
 * Given a dictionary of patient records, a patient ID, a field name, and a new value,
 * modify the value of the specified field in the patient's record with the new value.
 *
 * @param patientData Dictionary of patient records where the keys are patient IDs and the values are dictionaries of patient attributes.
 * @param patientId ID of the patient whose record needs to be modified.
 * @param field Name of the field that needs to be modified.
 * @param newValue New value to be assigned to the specified field.
 * @return True if the modification was successful, False otherwise.
 */
fun modifyPatientRecord(patientData: MutableMap<String, MutableMap<String, String>>, patientId: String, field: String, newValue: String): Boolean {

    // Check if the patient ID exists in the patientData dictionary
    if (patientId in patientData) {
        // Check if the field exists in the patient's record
        if (field in patientData[patientId]!!) {
            // Update the field value with the new value
            patientData[patientId]!![field] = newValue
            return true
        }
    }
    return false
}