Overview
Delete the medical document associated with a specific appointment in MediSync. This operation permanently removes the document from both the database and secure storage.Authentication
Path Parameters
The appointment ID to delete the document for
Response
Whether the deletion was successful
Empty object returned on successful deletion
Error message if the deletion failed
Response Examples
Successful Deletion
Document Not Found Error
Storage Deletion Error
Database Deletion Error
Business Logic
- Appointment-Based Deletion: Documents are deleted using the appointment ID, not the document ID directly.
- Two-Phase Deletion: The system first removes the file from cloud storage, then removes the database record.
- Complete Removal: Both the file content and all metadata are permanently deleted.
- Audit Logging: Deletion operations are logged for audit and compliance purposes.
Error Handling
- 404 Not Found: No document exists for the specified appointment ID
- 400 Bad Request:
- Error deleting document from storage
- Error deleting document from database
- 401 Unauthorized: Invalid or missing authentication token
- 500 Internal Server Error: Unexpected server error during deletion
Notes
- This operation is irreversible - deleted documents cannot be recovered
- Both storage and database records are removed completely
- The operation succeeds only if both storage and database deletions are successful
- Deletion is logged for audit and compliance tracking
- No document ID is required - only the appointment ID