/**
 * This function checks the condition of a patient and determines whether they should continue treatment.
 * Inputs:
 * - patientName: the name of the patient (String)
 * - condition: the patient's current condition (String)
 * Returns:
 * - true if the patient should continue treatment, false otherwise (Boolean)
 */
import kotlin.random.Random


fun checkPatientCondition(patientName: String, condition: String): Boolean {

    // Generate a random number representing the patient's condition level
    val conditionLevel = Random.nextInt(1, 101)
    
    // Check the patient's condition and determine whether to continue treatment
    return when {
        condition == "Critical" && conditionLevel >= 70 -> false
        condition == "Serious" && conditionLevel >= 50 -> false
        condition == "Stable" && conditionLevel >= 30 -> false
        else -> true
    }
}
import kotlin.random.Random

/**
 * This function checks the condition of a patient and determines whether they should continue treatment.
 * Inputs:
 * - patientName: the name of the patient (String)
 * - condition: the patient's current condition (String)
 * Returns:
 * - true if the patient should continue treatment, false otherwise (Boolean)
 */
fun checkPatientCondition(patientName: String, condition: String): Boolean {
import kotlin.random.Random

/**
 * This function checks the condition of a patient and determines whether they should continue treatment.
 * Inputs:
 * - patientName: the name of the patient (String)
 * - condition: the patient's current condition (String)
 * Returns:
 * - true if the patient should continue treatment, false otherwise (Boolean)
 */
fun checkPatientCondition(patientName: String, condition: String): Boolean {

    // Generate a random number representing the patient's condition level
    val conditionLevel = Random.nextInt(1, 101)
    
    // Check the patient's condition and determine whether to continue treatment
    return when {
        condition == "Critical" && conditionLevel >= 70 -> false
        condition == "Serious" && conditionLevel >= 50 -> false
        condition == "Stable" && conditionLevel >= 30 -> false
        else -> true
    }
}