Skip to main content

Document Service — AI Integration

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 03 platform-services


1. AI Integration Status

Scoped optional AI-assist features — no direct vendor AI SDK calls. All AI calls route through ai-gateway-service per platform standard.


2. AI Calls List

#PurposeRoutePrompt templateModerationHITL
AI-DOC-01Template wording suggestionsai-gateway-service /v1/ai/completedoc-template-wording-suggest-v1Platform content filterYes — user must accept before saving
AI-DOC-02Layout field placement hintsai-gateway-service /v1/ai/completedoc-template-layout-hint-v1Platform content filterYes — advisory only
AI-DOC-03Field binding suggestion (FHIR path)ai-gateway-service /v1/ai/completedoc-template-binding-suggest-v1Platform content filterYes — user confirms binding before publish

3. Constraints and Guardrails

ConstraintDetail
No autonomous submissionAI output is advisory until explicitly accepted by the user in the template designer UI; no autonomous publish
No direct vendor SDKAll AI calls via ai-gateway-service; no direct Anthropic/OpenAI SDK in this service
No PHI in AI promptsTemplate definition contains structural/wording elements only; FHIR binding paths are synthetic keys (e.g. Patient.name), not actual patient data
Offline degradationCloud AI unavailable offline; UI displays "AI assist unavailable — please enter field names manually" per FR-AI-008
ModerationAll AI output passes through platform content filter before display
AuditAI-assisted template changes are flagged in the template version definition.aiAssistedFields[] metadata

4. HITL Flow


5. Future AI Capabilities (Out of Scope v1)

CapabilityNotes
Structured data extraction from scanned PDFs (OCR + NLP)Requires separate governance; optional integration behind interface
AI-assisted document summary for patient portalRoute through ai-gateway; HITL review by clinician