Skip to main content

PredictSummary

The PredictSummary class represents a summary of predictions based on the analysis of a consultation using a machine learning model. It contains a summary field, which holds the textual prediction result.

Fields​

  • summary: (String) - A brief textual summary of the consultation's prediction result.

Example Usage​

Once the prediction summary has been retrieved from the model, it can be displayed, stored, or further processed for analysis.

Example of Handling Predict Summary Returned from the Model​

Here’s an example showing how to fetch and handle a prediction summary using getPredictSummary.

import com.altibbi.telehealth.ApiService
import com.altibbi.telehealth.model.PredictSummary
import com.altibbi.telehealth.ApiCallback

// Function to handle a prediction summary returned from the model
fun handlePredictSummary(predictSummary: PredictSummary) {
println("Prediction Summary: ${predictSummary.summary}")
}

// Fetch the prediction summary using the API
fun fetchPredictSummary(consultationId: String) {
ApiService.getPredictSummary(consultationId, object : ApiCallback<PredictSummary> {
override fun onSuccess(response: PredictSummary) {
handlePredictSummary(response)
}

override fun onFailure(error: String?) {
println("Error fetching Predict Summary: $error")
}

override fun onRequestError(error: String?) {
println("Request error: $error")
}
})
}

// Example usage of fetching and handling a PredictSummary
fetchPredictSummary("12345")