Overview
Regenerate notes for a specific appointment using an external AI notes service in MediSync. This endpoint takes existing transcription data and processes it through an AI service to generate new clinical notes and summary content with specified templates and language preferences.AI Notes Generation: This endpoint sends transcription data to an external AI service to regenerate clinical notes using customizable templates and language settings. The appointment’s settings are updated with the new template and language preferences.
Authentication
Path Parameters
The appointment ID to regenerate notes for
Query Parameters
The user ID of the healthcare provider requesting the notes regeneration
Body Parameters
The template type to use for notes generation (e.g., “soap_note”, “progress_note”, “consultation_note”)
Language code for notes generation (e.g., “en”, “es”, “fr”). If not provided, will use appointment’s existing language setting.
Response
Indicates if the operation was successful
Object containing the regenerated notes content
Error message if the operation failed
Example Response
Process Flow
- Validation: Validates appointment and template parameters
- Data Retrieval: Fetches appointment and transcription data
- Template Resolution: Uses provided template type or falls back to appointment settings
- External Service Call: Sends transcription data to AI notes service
- Database Update: Updates notes with generated content
- Appointment Update: Updates appointment with new template and language settings
- Real-time Notification: Emits appointment update event to connected clients
Behavior Notes
- Template Fallback: If template type is not provided in request, uses the appointment’s existing notes_type setting
- Language Fallback: If language is not provided in request, uses the appointment’s existing language setting
- Real-time Updates: Emits
appointmentUpdatedevent to notify connected WebSocket clients - Development Mode: Automatically adds ‘dev: true’ flag when running in development environment
- External Service: Communicates with external AI service at http://127.0.0.1:8000/extract-notes/
- Form Data: Sends data as multipart form data including appointment_id, transcription, uid, dashboard_token, template type, and language
Status Codes
- 200 - Notes regenerated successfully
- 400 - Missing required parameters
- 404 - Appointment or transcription not found
- 500 - External service error or database update failure