/**
 * A function that takes in a list of patients, a start range, and an end range, and returns the physicians
 * who have treated patients within the given range.
 *
 * @param patientsList A list of dictionaries representing patients.
 * @param startRange The starting value of the range.
 * @param endRange The ending value of the range.
 * @return A list of physicians who have treated patients within the given range.
 */
fun findPhysician(patientsList: List<Map<String, Any>>, startRange: Int, endRange: Int): List<String> {

    val physicians = mutableListOf<String>()
    for (patient in patientsList) {
        if ("Physician" in patient.keys && startRange <= patient["Consultation Duration"] as Int && patient["Consultation Duration"] as Int <= endRange) {
            val physician = patient["Physician"] as String
            if (physician !in physicians) {
                physicians.add(physician)
            }
        }
    }
    return physicians
}
/**
 * A function that takes in a list of patients, a start range, and an end range, and returns the physicians
 * who have treated patients within the given range.
 *
 * @param patientsList A list of dictionaries representing patients.
 * @param startRange The starting value of the range.
 * @param endRange The ending value of the range.
 * @return A list of physicians who have treated patients within the given range.
 */
fun findPhysician(patientsList: List<Map<String, Any>>, startRange: Int, endRange: Int): List<String> {
/**
 * A function that takes in a list of patients, a start range, and an end range, and returns the physicians
 * who have treated patients within the given range.
 *
 * @param patientsList A list of dictionaries representing patients.
 * @param startRange The starting value of the range.
 * @param endRange The ending value of the range.
 * @return A list of physicians who have treated patients within the given range.
 */
fun findPhysician(patientsList: List<Map<String, Any>>, startRange: Int, endRange: Int): List<String> {

    val physicians = mutableListOf<String>()
    for (patient in patientsList) {
        if ("Physician" in patient.keys && startRange <= patient["Consultation Duration"] as Int && patient["Consultation Duration"] as Int <= endRange) {
            val physician = patient["Physician"] as String
            if (physician !in physicians) {
                physicians.add(physician)
            }
        }
    }
    return physicians
}