/**
 * Given a dictionary containing patient information, update the diagnosis of a specific patient.
 *
 * @param patientInfo A dictionary containing patient information where the keys represent the patient IDs
 *                    and the values represent another dictionary with patient details including diagnosis.
 * @param patientId The ID of the patient whose diagnosis needs to be updated.
 * @param newDiagnosis The new diagnosis to be assigned to the patient.
 * @return True if the patient's diagnosis was successfully updated, False otherwise.
 */
fun updatePatientDiagnosis(patientInfo: MutableMap<Int, MutableMap<String, Any>>, patientId: Int, newDiagnosis: String): Boolean {

    // Verify if the patient ID exists in patientInfo dictionary
    if (patientId in patientInfo.keys) {
        // Update the diagnosis of the specified patient
        patientInfo[patientId]?.set("diagnosis", newDiagnosis)
        return true
    }
    return false
}

val patientInfo = mutableMapOf(
    1234 to mutableMapOf("name" to "John Doe", "age" to 35, "diagnosis" to "Hypertension"),
    5678 to mutableMapOf("name" to "Jane Smith", "age" to 42, "diagnosis" to "Diabetes"),
    9012 to mutableMapOf("name" to "David")
)
/**
 * Given a dictionary containing patient information, update the diagnosis of a specific patient.
 *
 * @param patientInfo A dictionary containing patient information where the keys represent the patient IDs
 *                    and the values represent another dictionary with patient details including diagnosis.
 * @param patientId The ID of the patient whose diagnosis needs to be updated.
 * @param newDiagnosis The new diagnosis to be assigned to the patient.
 * @return True if the patient's diagnosis was successfully updated, False otherwise.
 */
fun updatePatientDiagnosis(patientInfo: MutableMap<Int, MutableMap<String, Any>>, patientId: Int, newDiagnosis: String): Boolean {
/**
 * Given a dictionary containing patient information, update the diagnosis of a specific patient.
 *
 * @param patientInfo A dictionary containing patient information where the keys represent the patient IDs
 *                    and the values represent another dictionary with patient details including diagnosis.
 * @param patientId The ID of the patient whose diagnosis needs to be updated.
 * @param newDiagnosis The new diagnosis to be assigned to the patient.
 * @return True if the patient's diagnosis was successfully updated, False otherwise.
 */
fun updatePatientDiagnosis(patientInfo: MutableMap<Int, MutableMap<String, Any>>, patientId: Int, newDiagnosis: String): Boolean {

    // Verify if the patient ID exists in patientInfo dictionary
    if (patientId in patientInfo.keys) {
        // Update the diagnosis of the specified patient
        patientInfo[patientId]?.set("diagnosis", newDiagnosis)
        return true
    }
    return false
}

val patientInfo = mutableMapOf(
    1234 to mutableMapOf("name" to "John Doe", "age" to 35, "diagnosis" to "Hypertension"),
    5678 to mutableMapOf("name" to "Jane Smith", "age" to 42, "diagnosis" to "Diabetes"),
    9012 to mutableMapOf("name" to "David")
)