# Update a patient Updates an existing patient record Endpoint: PUT /v1/patients/{id} Version: 1.0.0 Security: bearerAuth ## Path parameters: - `id` (integer, required) Patient unique identifier ## Request fields (application/json): - `first_name` (string) Patient's first name Example: "Jane" - `middle_name` (string,null) Patient's middle name Example: "Marie" - `last_name` (string) Patient's last name Example: "Doe" - `date_of_birth` (string) Patient's date of birth (must be before today) Example: "1985-03-15" - `notes` (string,null) Clinical notes about the patient Example: "Updated contact information" - `allergies` (string,null) Known allergies Example: "Penicillin, Sulfa drugs" - `meta` (object,null) Additional metadata ## Response 200 fields (application/json): - `data` (object) - `data.id` (integer, required) Unique identifier for the patient Example: 789 - `data.uuid` (string, required) UUID for the patient Example: "550e8400-e29b-41d4-a716-446655440000" - `data.first_name` (string, required) Patient's first name Example: "Jane" - `data.middle_name` (string,null) Patient's middle name Example: "Marie" - `data.last_name` (string, required) Patient's last name Example: "Doe" - `data.gender` (string,null) Patient's gender (when demographics are loaded) Example: "female" - `data.date_of_birth` (string, required) Patient's date of birth Example: "1985-03-15" - `data.notes` (string,null) Clinical notes about the patient Example: "Patient has a history of anxiety. Prefers afternoon appointments." - `data.latest_medications` (array) List of current medications (when loaded) Example: ["Sertraline 50mg","Lorazepam 0.5mg PRN"] - `data.user` (object) User who created the patient (when loaded) - `data.user.id` (integer, required) Unique identifier for the user Example: 12345 - `data.user.name` (string, required) Full name of the user Example: "Dr. Sarah Johnson" - `data.user.email` (string, required) Email address of the user Example: "sarah.johnson@nextvisit.ai" - `data.user.created_at` (string, required) Timestamp when the user was created Example: "2023-03-15T09:12:34Z" - `data.user.updated_at` (string, required) Timestamp when the user was last updated Example: "2023-05-22T14:07:53Z" - `data.timeline` (array) Patient timeline events (when loaded) - `data.encounters` (array) Recent encounters/progress notes (when loaded) - `data.encounters.id` (integer, required) Unique identifier for the progress note Example: 123 - `data.encounters.name` (string, required) Name or title of the progress note Example: "Follow-up Visit - Jane Doe" - `data.encounters.transcription` (string) Transcribed content of the audio recording Example: "Patient reports improvement in symptoms since last visit..." - `data.encounters.analysis` (string) AI-generated analysis of the transcription Example: "Patient's condition has improved with current treatment regimen..." - `data.encounters.template` (object) - `data.encounters.template.id` (integer) Template ID used for this note Example: 5 - `data.encounters.template.name` (string) Name of the template Example: "Standard Follow-up" - `data.encounters.template.description` (string) Description of the template Example: "Standard template for routine follow-up visits" - `data.encounters.patient` (object) Associated patient information - `data.encounters.audio` (object) - `data.encounters.audio.duration` (number) Duration of the audio in seconds Example: 480 - `data.encounters.audio.bitrate` (integer) Bitrate of the audio file Example: 128000 - `data.encounters.audio.size` (integer) Size of the audio file in bytes Example: 7680000 - `data.encounters.audio.uploaded_at` (string) When the audio was uploaded Example: "2023-04-10T15:30:00Z" - `data.encounters.audio.expires_at` (string) When the audio file will expire Example: "2023-05-10T15:30:00Z" - `data.encounters.audio.file_url` (string) Temporary URL to access the audio file Example: "https://storage.nextvisit.app/encounters/abc123.mp3?token=xyz" - `data.encounters.has` (object) - `data.encounters.has.content` (boolean) Whether analysis has been completed Example: true - `data.encounters.has.transcription` (boolean) Whether transcription has been completed Example: true - `data.encounters.has.signed` (boolean) Whether the note has been reviewed and signed - `data.encounters.team_id` (integer, required) ID of the team this note belongs to Example: 5 - `data.encounters.user_id` (integer, required) ID of the user who created this note Example: 42 - `data.encounters.user` (object) Information about the user who created the note - `data.encounters.transcription_started_at` (string) When transcription process started Example: "2023-04-10T15:35:00Z" - `data.encounters.transcription_completed_at` (string) When transcription was completed Example: "2023-04-10T15:40:00Z" - `data.encounters.analysis_started_at` (string) When analysis process started Example: "2023-04-10T15:40:00Z" - `data.encounters.analysis_completed_at` (string) When analysis was completed Example: "2023-04-10T15:45:00Z" - `data.encounters.error_state` (string,null) Any error state during processing - `data.encounters.created_at` (string, required) When the progress note was created Example: "2023-04-10T15:30:00Z" - `data.encounters.updated_at` (string, required) When the progress note was last updated Example: "2023-04-10T15:45:00Z" - `data.meta` (object,null) Additional metadata - `data.created_at` (string, required) When the patient was created Example: "2024-01-15T10:30:00Z" - `data.updated_at` (string, required) When the patient was last updated Example: "2024-06-20T14:45:00Z" ## Response 401 fields (application/json): - `message` (string, required) Error message Example: "Validation failed" - `errors` (object) Detailed validation errors by field Example: {"email":["The email must be a valid email address","The email has already been taken"],"password":["The password must be at least 8 characters"],"template_name":["This field is required"]} ## Response 404 fields (application/json): - `message` (string, required) Error message Example: "Validation failed" - `errors` (object) Detailed validation errors by field Example: {"email":["The email must be a valid email address","The email has already been taken"],"password":["The password must be at least 8 characters"],"template_name":["This field is required"]} ## Response 422 fields (application/json): - `message` (string, required) Error message Example: "Validation failed" - `errors` (object) Detailed validation errors by field Example: {"email":["The email must be a valid email address","The email has already been taken"],"password":["The password must be at least 8 characters"],"template_name":["This field is required"]} ## Response 500 fields (application/json): - `message` (string) Example: "Failed to update patient" - `error` (string) Example: "Database connection error"