/**
 * Calculate the estimated recovery time for each patient in a list based on their weight and age.
 *
 * @param patientsList List of dictionaries containing patient information
 * @param maxWeight Maximum weight allowed for recovery (in kilograms)
 * @param minAge Minimum age required for recovery (in years)
 * @return A list of strings containing estimated recovery time for each patient
 */
fun calculatePatientRecoveryTime(patientsList: List<Map<String, Any>>, maxWeight: Float, minAge: Int): List<String> {

    val recoveryTimeList = mutableListOf<String>()

    for (patient in patientsList) {
        val weight = patient["weight"] as Float
        val age = patient["age"] as Int

        val recoveryTime = when {
            weight > maxWeight && age >= minAge -> "Longer recovery time"
            weight <= maxWeight && age >= minAge -> "Shorter recovery time"
            weight <= maxWeight && age < minAge -> "Regular recovery time"
            else -> "Not eligible for recovery"
        }

        recoveryTimeList.add(recoveryTime)
    }

    return recoveryTimeList
}
/**
 * Calculate the estimated recovery time for each patient in a list based on their weight and age.
 *
 * @param patientsList List of dictionaries containing patient information
 * @param maxWeight Maximum weight allowed for recovery (in kilograms)
 * @param minAge Minimum age required for recovery (in years)
 * @return A list of strings containing estimated recovery time for each patient
 */
fun calculatePatientRecoveryTime(patientsList: List<Map<String, Any>>, maxWeight: Float, minAge: Int): List<String> {
/**
 * Calculate the estimated recovery time for each patient in a list based on their weight and age.
 *
 * @param patientsList List of dictionaries containing patient information
 * @param maxWeight Maximum weight allowed for recovery (in kilograms)
 * @param minAge Minimum age required for recovery (in years)
 * @return A list of strings containing estimated recovery time for each patient
 */
fun calculatePatientRecoveryTime(patientsList: List<Map<String, Any>>, maxWeight: Float, minAge: Int): List<String> {

    val recoveryTimeList = mutableListOf<String>()

    for (patient in patientsList) {
        val weight = patient["weight"] as Float
        val age = patient["age"] as Int

        val recoveryTime = when {
            weight > maxWeight && age >= minAge -> "Longer recovery time"
            weight <= maxWeight && age >= minAge -> "Shorter recovery time"
            weight <= maxWeight && age < minAge -> "Regular recovery time"
            else -> "Not eligible for recovery"
        }

        recoveryTimeList.add(recoveryTime)
    }

    return recoveryTimeList
}