{"ok":true,"module":"module-5-teleconsult","meta":{"title":"Module 5 — Teleconsultation","moduleRegistryPrefix":"TC / PD","sourcePath":"reference/concept-platform/Platform pahse 3 mvp/Module 5","specStack":"healthcare_platform_api (FastAPI) + Agora video tokens","layers":5,"overallCompletionPct":34,"consultPipeline":"symptom session → consultation request → claimed → chat/video → e-Rx → fee (Module 4)","integratedWith":"hospitalnode.in — appointments, practitioners, Razorpay appointment pay","updated":"June 2026"},"integration":{"layers":5,"completionPct":34,"liveLayers":0,"partialLayers":2,"gapLayers":3},"layers":[{"layer":1,"id":"in-app-chat","name":"In-app consultation chat","status":"gap","routes":[{"label":"Hospital AI chat","href":"/shop?view=ai","status":"partial"},{"label":"Krishna AI chat","href":"/krishna-ai","status":"partial"},{"label":"Appointments","href":"/appointments","status":"gap"}],"gaps":["No consultation_messages table","No participant-only privacy (patient + claiming doctor)","Send only while status=claimed — not implemented","Polling GET messages API missing","Module 2 L4 queue not linked to chat thread"]},{"layer":2,"id":"video-calling","name":"Agora video / audio calling","status":"gap","routes":[{"label":"Appointments teleconsult","href":"/appointments","status":"partial"},{"label":"Meeting URL stub","href":"/customer/appointments","status":"stub"},{"label":"Phase 1 PD-01","href":"/phase1","status":"gap"}],"gaps":["AGORA_APP_ID / AGORA_APP_CERTIFICATE not wired","No video_sessions table or token API","No client-side Agora SDK UI","Live video connection untested (spec honesty boundary)","Call recording policy not defined"]},{"layer":3,"id":"eprescription","name":"E-prescription during consultation","status":"gap","routes":[{"label":"Hospital AI Rx OCR","href":"/shop?view=ai","status":"partial"},{"label":"Rx API","href":"/api/shop/hospital-ai/rx","status":"partial"},{"label":"Module 3 Rx gate","href":"/module3","status":"partial"}],"gaps":["No issue-prescription during consult (doctor-only)","E-Rx not written to shared Prescription table for cart gate","Pharmacist dispense view for e-Rx context — gap","OTC rejection on issue endpoint — N/A","Refill policy for e-Rx — open"]},{"layer":4,"id":"scheduled-appointments","name":"Doctor scheduling & booking","status":"partial","routes":[{"label":"Book appointments","href":"/appointments","status":"live"},{"label":"Browse doctors","href":"/api/appointments/browse","status":"live"},{"label":"Practitioner slots","href":"/api/practitioners","status":"partial"},{"label":"My appointments","href":"/customer/appointments","status":"live"},{"label":"Cancel appointment","href":"/api/appointments/book","status":"live"}],"gaps":["No ConsultationRequest claimed-at-booking unified with Module 2 queue","Doctor availability publish API differs from spec shape","Symptom session not required for direct booking (OK per spec L4)","Time-gating chat/video to scheduled_at — not built (spec intentional)","Spec has no cancel — hospitalnode has cancel (ahead); refund on cancel gap"]},{"layer":5,"id":"consultation-fees","name":"Consultation fees (Razorpay)","status":"partial","routes":[{"label":"Appointment payment","href":"/api/appointments","status":"partial"},{"label":"Confirm appointment pay","href":"/api/appointments","status":"partial"},{"label":"Module 4 Razorpay","href":"/module4","status":"live"},{"label":"Practitioner fees in DB","href":"/api/appointments/browse","status":"partial"}],"gaps":["No PUT /doctors/me/fee doctor self-service API","Consultation fee webhook branch on shared Payment model — gap","fee_paid visibility on consult response — gap","Hard payment gate before chat/video/e-Rx — not built (spec deliberate)","Refund if appointment cancelled after pay — gap"]}],"module2Bridge":[{"spec":"POST /symptom-checker/sessions/{id}/request-consultation","platformRoute":"—","status":"gap"},{"spec":"GET /consultations/queue (doctor FIFO)","platformRoute":"—","status":"gap"},{"spec":"POST /consultations/{id}/claim","platformRoute":"—","status":"gap"},{"spec":"POST /consultations/{id}/complete","platformRoute":"—","status":"gap"},{"spec":"Direct book (Module 5 L4)","platformRoute":"POST /api/appointments/book","status":"partial"}],"teleconsultJourney":[{"step":"Symptom check (Module 2)","layer":"M2","route":"/shop?view=ai","status":"partial"},{"step":"Request consultation","layer":"M2 L4","route":"/module2","status":"gap"},{"step":"Doctor claims / books slot","layer":"M5 L4","route":"/appointments","status":"partial"},{"step":"In-app chat","layer":"L1","route":"/appointments","status":"gap"},{"step":"Video call (Agora)","layer":"L2","route":"/customer/appointments","status":"gap"},{"step":"Doctor issues e-Rx","layer":"L3","route":"/api/shop/hospital-ai/rx","status":"gap"},{"step":"Pay consultation fee","layer":"L5","route":"/api/appointments","status":"partial"},{"step":"Pharmacy order (Module 3)","layer":"M3","route":"/module3","status":"partial"}],"apiMap":[{"spec":"POST .../messages","platformRoute":"—","status":"gap"},{"spec":"POST .../video/start","platformRoute":"meeting URL stub only","status":"gap"},{"spec":"POST .../issue-prescription","platformRoute":"Hospital AI Rx OCR (patient upload)","status":"gap"},{"spec":"GET /doctors + book slot","platformRoute":"GET /api/appointments/browse + POST book","status":"partial"},{"spec":"POST .../payment/create","platformRoute":"POST /api/appointments/[id]/payment","status":"partial"},{"spec":"PUT /doctors/me/fee","platformRoute":"fees in practitioners table (admin seed)","status":"gap"}],"envKeys":["AGORA_APP_ID (video — gap)","AGORA_APP_CERTIFICATE (video — gap)","RAZORPAY_* (consultation fees — partial via Module 4)"],"dashboard":"/module5","aheadOfSpec":["Appointment cancellation flow (spec L4 has no cancel)","OPD + home_visit modes beyond spec teleconsult-only","Guest demo booking without login"],"criticalGaps":["Module 2 consultation queue (claim/complete)","In-app chat on claimed consultation","Agora video tokens + client UI","Doctor e-prescription during consult"]}