/**
 * This function takes a list of patient records and checks for any incorrect entries.
 * If an incorrect entry is found, the function breaks the loop and returns false.
 * Otherwise, it returns true.
 */
fun validatePatientRecords(records: List<Map<String, Any>>): Boolean {

    for (record in records) {
        var decision: String
        while (true) {
            decision = readLine()!!.toString()
            if (decision.toLowerCase() == "y" || decision.toLowerCase() == "n") {
                break
            } else {
                println("Invalid input! Please enter 'Y' for Yes or 'N' for No.")
            }
        }
        if (decision.toLowerCase() == "n") {
            println("Incorrect patient record found! Please review.")
            return false
        }
    }
    return true
}

// Example usage

val patientRecords = listOf(
    mapOf("name" to "John Doe", "age" to 35)
)
/**
 * This function takes a list of patient records and checks for any incorrect entries.
 * If an incorrect entry is found, the function breaks the loop and returns false.
 * Otherwise, it returns true.
 */
fun validatePatientRecords(records: List<Map<String, Any>>): Boolean {
/**
 * This function takes a list of patient records and checks for any incorrect entries.
 * If an incorrect entry is found, the function breaks the loop and returns false.
 * Otherwise, it returns true.
 */
fun validatePatientRecords(records: List<Map<String, Any>>): Boolean {

    for (record in records) {
        var decision: String
        while (true) {
            decision = readLine()!!.toString()
            if (decision.toLowerCase() == "y" || decision.toLowerCase() == "n") {
                break
            } else {
                println("Invalid input! Please enter 'Y' for Yes or 'N' for No.")
            }
        }
        if (decision.toLowerCase() == "n") {
            println("Incorrect patient record found! Please review.")
            return false
        }
    }
    return true
}

// Example usage

val patientRecords = listOf(
    mapOf("name" to "John Doe", "age" to 35)
)