/**
 * Given a diagnosis, symptoms, and treatments, this function determines the best course of action for a veterinarian.
 *
 * @param diagnosis The diagnosis made by the veterinarian.
 * @param symptoms The list of symptoms observed in the animal.
 * @param treatments The list of possible treatments for the diagnosed condition.
 * @return The recommended treatment based on the diagnosis and symptoms.
 */
fun veterinarianDiagnosis(diagnosis: String, symptoms: List<String>, treatments: List<String>): String {

    if (diagnosis !in listOf("rabies", "influenza", "leukemia")) {
        return "Invalid diagnosis."
    }

    val validSymptoms = listOf("fever", "vomiting", "lethargy", "inappetence", "cough")
    if (!symptoms.all { it in validSymptoms }) {
        return "Invalid symptoms provided."
    }

    val validTreatments = mapOf(
        "rabies" to listOf("vaccine", "quarantine"),
        "influenza" to listOf("antiviral medication", "bed rest"),
        "leukemia" to listOf("chemotherapy", "supportive care")
    )

    if (!treatments.all { it in validTreatments[diagnosis] ?: emptyList() }) {
        return "Invalid treatments provided."
    }

    return validTreatments[diagnosis]?.joinToString(", ") ?: "No treatment recommended."
}
/**
 * Given a diagnosis, symptoms, and treatments, this function determines the best course of action for a veterinarian.
 *
 * @param diagnosis The diagnosis made by the veterinarian.
 * @param symptoms The list of symptoms observed in the animal.
 * @param treatments The list of possible treatments for the diagnosed condition.
 * @return The recommended treatment based on the diagnosis and symptoms.
 */
fun veterinarianDiagnosis(diagnosis: String, symptoms: List<String>, treatments: List<String>): String {
/**
 * Given a diagnosis, symptoms, and treatments, this function determines the best course of action for a veterinarian.
 *
 * @param diagnosis The diagnosis made by the veterinarian.
 * @param symptoms The list of symptoms observed in the animal.
 * @param treatments The list of possible treatments for the diagnosed condition.
 * @return The recommended treatment based on the diagnosis and symptoms.
 */
fun veterinarianDiagnosis(diagnosis: String, symptoms: List<String>, treatments: List<String>): String {

    if (diagnosis !in listOf("rabies", "influenza", "leukemia")) {
        return "Invalid diagnosis."
    }

    val validSymptoms = listOf("fever", "vomiting", "lethargy", "inappetence", "cough")
    if (!symptoms.all { it in validSymptoms }) {
        return "Invalid symptoms provided."
    }

    val validTreatments = mapOf(
        "rabies" to listOf("vaccine", "quarantine"),
        "influenza" to listOf("antiviral medication", "bed rest"),
        "leukemia" to listOf("chemotherapy", "supportive care")
    )

    if (!treatments.all { it in validTreatments[diagnosis] ?: emptyList() }) {
        return "Invalid treatments provided."
    }

    return validTreatments[diagnosis]?.joinToString(", ") ?: "No treatment recommended."
}