Skip to content

Human-in-the-Loop AI Drafts#155

Merged
inteee merged 1 commit intoCIVRA-INC:mainfrom
Kaylahray:human-in-the-loop
Mar 9, 2026
Merged

Human-in-the-Loop AI Drafts#155
inteee merged 1 commit intoCIVRA-INC:mainfrom
Kaylahray:human-in-the-loop

Conversation

@Kaylahray
Copy link
Contributor

Human-in-the-Loop AI Drafts. closes #121

AI output lands in a temporary Draft state before it touches the immutable medical record.


Backend (apps/api)

  • AiDraftModel — temporary MongoDB collection (clinicId, encounterId, authorId, content, status: "DRAFT")
  • POST /ai/drafts — saves finalized SSE stream content as a draft
  • PATCH /ai/drafts/:id — updates draft while the doctor edits
  • DELETE /ai/drafts/:id — discards draft
  • POST /ai/drafts/:id/approve — promotes draft → permanent ClinicalNote (type: AI_SUMMARY), then deletes the draft
  • GET /ai/stream-dummy — emits a word every 50 ms for local UI development without a live Gemini key

Copy link
Contributor

@inteee inteee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the effort here.

@inteee inteee merged commit 1a0e43f into CIVRA-INC:main Mar 9, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Human-in-the-Loop" Draft State UI

2 participants