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
void handleSoapSummary(Soap soapSummary) {
final summary = soapSummary.summary;
// Access subjective
final subjective = summary.subjective;
if (subjective != null) {
print("Subjective Symptoms: ${subjective.symptoms}");
print("Concerns: ${subjective.concerns}");
}
// Access objective
final objective = summary.objective;
if (objective != null) {
print("Lab Results: ${objective.laboratoryResults}");
print("Physical Findings: ${objective.physicalExaminationFindings}");
}
// Access assessment
final assessment = summary.assessment;
if (assessment != null) {
print("Diagnosis: ${assessment.diagnosis}");
print("Differential Diagnosis: ${assessment.differentialDiagnosis}");
}
// Access plan
final plan = summary.plan;
if (plan != null) {
print("Medications: ${plan.medications}");
print("Follow-Up Instructions: ${plan.followUpInstructions}");
}
}
// Example SOAP summary returned from the model
final 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);