Retrieve the doctor letter for a specific appointment in MediSync. This endpoint returns the generated doctor letter associated with the given appointment ID and doctor ID, or null if no letter has been generated yet.
Appointment-Based Retrieval: Doctor letters are retrieved by appointment ID and doctor ID. If no letter exists for the specified appointment and doctor combination, the response will be successful with null data.
{ "success": true, "data": { "_id": "letter_def456", "appointment_id": "apt_abc123", "patient_id": "pat_ghi789", "doctor_id": "doc_xyz789", "status": "generated", "markdown_content": "# Medical Referral Letter\n\n**Date:** 2024-01-15\n\n**To:** Dr. Sarah Johnson, Cardiology Specialist\n**From:** Dr. Michael Chen, Internal Medicine\n\n**Re:** John Smith (DOB: 1975-08-15)\n\n## Clinical Summary\n\nI am referring Mr. Smith for cardiology evaluation following his recent presentation with chest pain...\n\n## Diagnosis\n- Atypical chest pain (ICD-10: R07.89)\n\n## Current Medications\n- Lisinopril 20mg daily\n\n## Recommendation\nPlease evaluate for possible cardiac etiology and provide treatment recommendations.\n\nThank you for your consultation.\n\nDr. Michael Chen, MD", "generation_inputs": { "current_date": "2024-01-15", "patient_name": "John Smith", "date_of_birth": "1975-08-15", "appointment_notes": "Patient presented with chest pain...", "diagnosis": "Atypical chest pain", "icd_10_codes": ["R07.89"], "recipient_doctor": "Dr. Sarah Johnson, Cardiology Specialist", "referring_doctor": "Dr. Michael Chen, Internal Medicine", "language": "en" }, "error": null, "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T10:32:00.000Z" }}