Soap
The Soap class represents a detailed consultation summary, which includes subjective, objective, assessment, and plan components. This data is typically generated from a machine learning model based on consultation analysis.
Fields
- summary: (Summary) - Contains the entire SOAP note, including the following:
- subjective: (Subjective) - Patient-reported symptoms and concerns.
- objective: (Objective) - Clinician-observed physical findings and lab results.
- assessment: (Assessment) - Diagnosis and differential diagnoses.
- plan: (Plan) - Treatment plan, medications, and follow-up instructions.
Example Usage
Once the SOAP summary is returned from the model, you can access the different components (subjective, objective, assessment, plan) and process them for display, storage, or further analysis.
Example of Handling SOAP Summary Returned from the Model
In this example, the SOAP summary is returned from the model, and each part of the summary (subjective, objective, assessment, and plan) is accessed and printed only if data is available.
import com.altibbi.telehealth.ApiService
import com.altibbi.telehealth.model.Soap
import com.altibbi.telehealth.model.Summary
import com.altibbi.telehealth.model.Subjective
import com.altibbi.telehealth.model.Objective
import com.altibbi.telehealth.model.Assessment
import com.altibbi.telehealth.model.Plan
import com.altibbi.telehealth.ApiCallback
// Function to handle a SOAP summary returned from the model
fun handleSoapSummary(soapSummary: Soap) {
val summary = soapSummary.summary
// Access subjective
val subjective = summary.subjective
println("Subjective Symptoms: ${subjective.symptoms}")
println("Concerns: ${subjective.concerns}")
// Access objective
val objective = summary.objective
println("Lab Results: ${objective.laboratoryResults}")
println("Physical Findings: ${objective.physicalExaminationFindings}")
// Access assessment
val assessment = summary.assessment
println("Diagnosis: ${assessment.diagnosis}")
println("Differential Diagnosis: ${assessment.differentialDiagnosis}")
// Access plan
val plan = summary.plan
println("Medications: ${plan.medications}")
println("Follow-Up Instructions: ${plan.followUpInstructions}")
}
// Fetch the SOAP summary using the API
fun fetchSoapSummary(consultationId: String) {
ApiService.getSoapSummary(consultationId, object : ApiCallback<Soap> {
override fun onSuccess(response: Soap) {
handleSoapSummary(response)
}
override fun onFailure(error: String?) {
println("Error fetching SOAP summary: $error")
}
override fun onRequestError(error: String?) {
println("Request error: $error")
}
})
}
// Example usage
fetchSoapSummary("12345")