[FEAT] 상호작용 경고에 병용금기 사유(PROHBT_CONTENT) 노출#77
Open
heejeongJ wants to merge 1 commit into
Open
Conversation
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.
작업 개요
기존 상호작용 응답은 병용금기 상대 성분만 노출해 "왜 위험한지"를 알 수 없었습니다. DUR 응답의
PROHBT_CONTENT(횡문근융해증·혈액학적 독성 등)를 함께 매핑·노출해 사용자 이해도를 높였습니다.주요 변경 사항
1. InteractionRulePort 시그니처 변경
lookupContraindicatedIngredients(name)반환을Set<String>→Map<String, String>(성분 → 사유)으로 변경lookupByMedicineName시그니처는 유지2. DurInteractionRuleAdapter 확장
MIXTURE_INGR_KOR_NAME와PROHBT_CONTENT를 페어로 추출 (LinkedHashMap 으로 입력 순서 보존)putIfAbsent)/info의interactionWarnings포맷을"성분(사유), ..."로 강화하고, 사유가 비면 성분만 노출3. InteractionEngine 경고 문구 강화
"메토잘정과(와) 이부프로펜는 병용금기입니다(혈액학적 독성). 함께 복용 전 의사·약사와 상담하세요."4. 테스트 갱신
DurInteractionRuleAdapterTest:/info사유 포맷, 사유 없는 경우, 같은 성분 첫 사유 채택, 매핑 반환·예외 폴백InteractionEngineTest: 사유 부착·사유 비어 있을 때·정규화·component폴백 케이스:api:test·:app:compileJava통과라이브 검증
실제 DUR 키로 end-to-end 확인.
이부프로펜→ 매핑메토트렉세이트 → 혈액학적 독성메토잘정(component=메토트렉세이트) + 새 약이부프로펜→"메토잘정과(와) 이부프로펜는 병용금기입니다(혈액학적 독성). 함께 복용 전 의사·약사와 상담하세요."고민사항
1. 포트 시그니처 교체 vs 새 메서드 추가
기존
Set<String>을 유지하고 사유 조회용 메서드를 별도로 두는 안도 가능했지만, 단일 구현(DurInteractionRuleAdapter)·단일 호출자(InteractionEngine)라 호환성 위험이 작고 시그니처를 한 번에 교체하는 편이 인터페이스를 깔끔히 유지한다고 판단했습니다.2. 같은 성분에 여러 사유가 있을 때
DUR 응답에는 같은 상대 성분이 다른 사유로 여러 번 등재되는 경우가 있습니다. 결정적 동작을 위해 첫 사유를 채택(
putIfAbsent)했습니다. 만약 사유 누락이 문제가 되면"사유1 / 사유2"로 결합하는 방식으로 바꿀 여지가 있습니다.3. 사유가 비어 있을 때의 출력
PROHBT_CONTENT가 비어 있는 행도 일부 존재합니다. 이 경우 괄호 없이 성분명만 노출해 가독성을 유지했습니다.4.
/info응답 포맷 — DTO 구조 vs 문자열 enrich구조화된 응답으로 바꾸려면 DTO 변경과 클라이언트 영향이 발생합니다. 현재 클라이언트가
interactionWarnings문자열을 그대로 렌더링하는 점을 고려해, DTO 는 그대로 두고 문자열에 사유를 함께 담는 방식을 택했습니다.5. 사유 텍스트 가공 여부
PROHBT_CONTENT는 짧은 의학 용어 한두 단어(횡문근융해증·혈액학적 독성 등)로 들어와 그대로 노출해도 자연스럽습니다. 별도 가공·축약 없이 원문 사유를 그대로 사용했습니다.호환성 / 영향 범위
/v2/check경고 문구가 사유 포함 형태로 길어집니다. 요청·응답 스키마는 동일합니다./v2/info의interactionWarnings문자열 포맷이"성분(사유), ..."로 바뀝니다. 사유 없을 때는 기존과 동일하게 성분명만 노출됩니다.연관 이슈
Closes #76