feat(handoff): 리포트에 F2 도메인추론(AI 예상질환·권장 진료과) 연결 - #102
Merged
Merged
Conversation
핸드오프 리포트의 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
핸드오프 리포트의 **A6(AI 예상질환)·A7(권장 진료과)**가 항상 "정보 없음"으로 뜨던 문제 해결. F1이 라이브로 도메인추론을 하지만 산출물이 DB에 저장되지 않아, 리포트 생성 경로가 빈
DomainInferenceInput을 넘기던 것이 원인. → 리포트 생성 시점에 F2(/ai/domain/infer, RAG)를 재계산해 채운다.변경
ai_client.domain_infer_artifact()—/ai/domain/inferfull artifact를 raw dict로 수신. 공유 contractDomainInferResponse가ai_predicted_disease·department_candidates를 버리므로 우회.handoff._build_domain_inference()— 제출 세션 환자 발화 → F2 재계산 →DomainInferenceInput채움. 실패/발화없음 시 빈 값 degrade.generate_report_task— 다세션 리포트에 도메인추론 실음.검증(로컬)
후속(별도 증분)
disease_similarity/domain_confidence차트(세션별 도메인 시계열 필요)배포
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