/**
 * This function updates the health status of a patient based on their ID.
 * If the patient is in critical condition, notify the doctor immediately.
 * If the patient is stable and improving, print 'Continue monitoring'.
 * If the patient is deteriorating, update the health status as 'Worsening'.
 * If the patient is recovering, update the health status as 'Improving'.
 * If the patient is discharged, update the health status as 'Discharged'.
 *
 * @param patientId The ID of the patient.
 * @param healthStatus The current health status of the patient.
 * @return The updated health status of the patient.
 */
fun updatePatientHealth(patientId: Int, healthStatus: String): String {

    return when (healthStatus) {
        "Critical" -> {
            println("Patient $patientId is in critical condition. Inform the doctor immediately.")
            "Critical"
        }
        "Stable" -> {
            // Add conditions for 'Stable' health status
            // 1. If the patient is improving, return 'Continue monitoring'.
            // 2. If the patient is deteriorating, return 'Worsening'.
            // Add more conditions as needed.
            // Example:
            // if (improvingCondition) {
            //     return "Continue monitoring"
            // } else if (deterioratingCondition) {
            //     return "Worsening"
            // }
            // Handle other scenarios for 'Stable' health status
            "Updated Stable Status"
        }
        // Handle other health status scenarios
        else -> {
            // Handle default case or other health status scenarios
            "Updated Status"
        }
    }
}
/**
 * This function updates the health status of a patient based on their ID.
 * If the patient is in critical condition, notify the doctor immediately.
 * If the patient is stable and improving, print 'Continue monitoring'.
 * If the patient is deteriorating, update the health status as 'Worsening'.
 * If the patient is recovering, update the health status as 'Improving'.
 * If the patient is discharged, update the health status as 'Discharged'.
 *
 * @param patientId The ID of the patient.
 * @param healthStatus The current health status of the patient.
 * @return The updated health status of the patient.
 */
fun updatePatientHealth(patientId: Int, healthStatus: String): String {
/**
 * This function updates the health status of a patient based on their ID.
 * If the patient is in critical condition, notify the doctor immediately.
 * If the patient is stable and improving, print 'Continue monitoring'.
 * If the patient is deteriorating, update the health status as 'Worsening'.
 * If the patient is recovering, update the health status as 'Improving'.
 * If the patient is discharged, update the health status as 'Discharged'.
 *
 * @param patientId The ID of the patient.
 * @param healthStatus The current health status of the patient.
 * @return The updated health status of the patient.
 */
fun updatePatientHealth(patientId: Int, healthStatus: String): String {

    return when (healthStatus) {
        "Critical" -> {
            println("Patient $patientId is in critical condition. Inform the doctor immediately.")
            "Critical"
        }
        "Stable" -> {
            // Add conditions for 'Stable' health status
            // 1. If the patient is improving, return 'Continue monitoring'.
            // 2. If the patient is deteriorating, return 'Worsening'.
            // Add more conditions as needed.
            // Example:
            // if (improvingCondition) {
            //     return "Continue monitoring"
            // } else if (deterioratingCondition) {
            //     return "Worsening"
            // }
            // Handle other scenarios for 'Stable' health status
            "Updated Stable Status"
        }
        // Handle other health status scenarios
        else -> {
            // Handle default case or other health status scenarios
            "Updated Status"
        }
    }
}