/**
 * This nested function updates the progress of a single patient.
 *
 * @param patient A dictionary containing information about a patient.
 * @return Updated dictionary with the progress of the patient.
 */
fun updateProgress(patient: MutableMap<String, Any>): MutableMap<String, Any> {

    val currentExercises = listOf("exercise1", "exercise2", "exercise3") // Define current exercises here
    for (exercise in currentExercises) {
        if (exercise in patient["completed_exercises"] as List<String>) {
            patient["progress"] = (patient["progress"] as Int) + 5
        }
    }
    return patient
}

fun updatePatients(patients: List<MutableMap<String, Any>>): List<MutableMap<String, Any>> {
    val updatedPatients = mutableListOf<MutableMap<String, Any>>()
    for (patient in patients) {
        updatedPatients.add(updateProgress(patient))
    }
    return updatedPatients
}
/**
 * This nested function updates the progress of a single patient.
 *
 * @param patient A dictionary containing information about a patient.
 * @return Updated dictionary with the progress of the patient.
 */
fun updateProgress(patient: MutableMap<String, Any>): MutableMap<String, Any> {
/**
 * This nested function updates the progress of a single patient.
 *
 * @param patient A dictionary containing information about a patient.
 * @return Updated dictionary with the progress of the patient.
 */
fun updateProgress(patient: MutableMap<String, Any>): MutableMap<String, Any> {

    val currentExercises = listOf("exercise1", "exercise2", "exercise3") // Define current exercises here
    for (exercise in currentExercises) {
        if (exercise in patient["completed_exercises"] as List<String>) {
            patient["progress"] = (patient["progress"] as Int) + 5
        }
    }
    return patient
}

fun updatePatients(patients: List<MutableMap<String, Any>>): List<MutableMap<String, Any>> {
    val updatedPatients = mutableListOf<MutableMap<String, Any>>()
    for (patient in patients) {
        updatedPatients.add(updateProgress(patient))
    }
    return updatedPatients
}