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.
getSoapSummary Function
The getSoapSummary function fetches the SOAP note for a specific consultation.
Parameters
- consultationId: (int) - The ID of the consultation.
Returns
Future<Soap>: A future that resolves with theSoapobject.
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
Fetching and Handling SOAP Summary
ApiService apiService = ApiService();
Future<void> fetchAndPrintSoap(int consultationId) async {
try {
final soapSummary = await apiService.getSoapSummary(consultationId);
final summary = soapSummary.summary;
print("Subjective Symptoms: ${summary.subjective.symptoms}");
print("Diagnosis: ${summary.assessment.diagnosis}");
print("Medications: ${summary.plan.medications}");
} catch (e) {
print("Error fetching SOAP: $e");
}
}