Skip to main content

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.

// Function to handle a SOAP summary returned from the model
fun handleSoapSummary(soapSummary: Soap) {
val summary = soapSummary.summary

// Access subjective
val subjective = summary.subjective
subjective?.let {
println("Subjective Symptoms: ${it.symptoms}")
println("Concerns: ${it.concerns}")
}

// Access objective
val objective = summary.objective
objective?.let {
println("Lab Results: ${it.laboratoryResults}")
println("Physical Findings: ${it.physicalExaminationFindings}")
}

// Access assessment
val assessment = summary.assessment
assessment?.let {
println("Diagnosis: ${it.diagnosis}")
println("Differential Diagnosis: ${it.differentialDiagnosis}")
}

// Access plan
val plan = summary.plan
plan?.let {
println("Medications: ${it.medications}")
println("Follow-Up Instructions: ${it.followUpInstructions}")
}
}

// Example SOAP summary returned from the model
val soapSummaryFromModel = Soap(
summary = Summary(
subjective = Subjective(symptoms = "Cough, Fever", concerns = "Shortness of breath"),
objective = Objective(laboratoryResults = "Blood test normal", physicalExaminationFindings = "Clear lungs"),
assessment = Assessment(diagnosis = "Viral infection", differentialDiagnosis = "Bacterial infection"),
plan = Plan(nonPharmacologicalIntervention = "Rest and fluids", medications = "Paracetamol", followUpInstructions = "Return if symptoms worsen")
)
)

// Handle the SOAP summary
handleSoapSummary(soapSummaryFromModel)