Skip to content

feat(handoff): 리포트에 F2 도메인추론(AI 예상질환·권장 진료과) 연결 - #102

Merged
Seohyunjho merged 1 commit into
Masterfrom
feat/report-domain-inference
Jul 28, 2026
Merged

Seohyunjho merged 1 commit into
Masterfrom
feat/report-domain-inference

Conversation

@Seohyunjho

Copy link
Copy Markdown
Collaborator

요약

핸드오프 리포트의 **A6(AI 예상질환)·A7(권장 진료과)**가 항상 "정보 없음"으로 뜨던 문제 해결. F1이 라이브로 도메인추론을 하지만 산출물이 DB에 저장되지 않아, 리포트 생성 경로가 빈 DomainInferenceInput을 넘기던 것이 원인. → 리포트 생성 시점에 F2(/ai/domain/infer, RAG)를 재계산해 채운다.

변경

  • ai_client.domain_infer_artifact() — /ai/domain/infer full artifact를 raw dict로 수신. 공유 contract DomainInferResponse가 ai_predicted_disease·department_candidates를 버리므로 우회.
  • handoff._build_domain_inference() — 제출 세션 환자 발화 → F2 재계산 → DomainInferenceInput 채움. 실패/발화없음 시 빈 값 degrade.
  • generate_report_task — 다세션 리포트에 도메인추론 실음.

검증(로컬)

  • A6: 질환 유사도 후보(계절성정동장애·월경전불쾌장애·우울증 등) 렌더 ✅
  • A7: 권장 진료과(정신건강의학과 + 사유) 렌더 ✅
  • 실패 시 기존 "정보 없음" degrade 유지 ✅

후속(별도 증분)

  • disease_similarity/domain_confidence 차트(세션별 도메인 시계열 필요)
  • 임상 종합소견(narrative, LLM) · 감성(sentiment) 리포트 반영

배포

merge 후 DGX: git pull && docker compose -f infra/deploy/docker-compose.dgx.yml up -d --build api (ai-server 무변경 → api만). DGX에서 실환자 리포트 재생성으로 end-to-end 검증 예정.

🤖 Generated with Claude Code

핸드오프 리포트의 A6(AI 예상질환)·A7(권장 진료과)가 항상 "정보 없음"으로 뜨던
문제 해결. F1이 라이브로 도메인추론을 하지만 그 산출물이 DB에 저장되지 않아
리포트 생성 경로(generate_report_task)가 빈 DomainInferenceInput을 넘기던 것이 원인.

- ai_client.domain_infer_artifact(): `/ai/domain/infer`의 full artifact를 raw dict로
  받는다. 공유 contract DomainInferResponse는 domain_candidates/summary만 담아
  ai_predicted_disease·department_candidates를 버리므로, DomainInferenceInput(dict 허용)
  에 하위 객체를 그대로 통과시킨다.
- handoff._build_domain_inference(): 제출 세션의 환자 발화로 F2를 재계산(RAG mode)해
  ai_predicted_disease + department_candidates를 채운다. 발화 없음/호출 실패 시 빈 값으로
  degrade(기존 '정보 없음' 동작 보존).
- generate_report_task: 다세션 리포트 요청에 위 도메인추론을 실어 A6/A7를 채운다.

검증(로컬): 도메인 아티팩트→리포트 A6(질환 유사도 후보)·A7(정신건강의학과) 정상 렌더.
비고: disease_similarity/domain_confidence 차트는 세션별 도메인 시계열이 필요해 후속.
임상 종합소견(narrative)·감성 반영도 별도 증분.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Seohyunjho
Seohyunjho merged commit 1e4f25a into Master Jul 28, 2026
2 checks passed
@Seohyunjho
Seohyunjho deleted the feat/report-domain-inference branch July 28, 2026 05:26
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.

1 participant