alyagi-deploy commited on
Commit
bef0ebc
·
1 Parent(s): b8dcb52

deploy: 유효기간·저장법 보강

Browse files
Files changed (1) hide show
  1. services/dur.py +9 -0
services/dur.py CHANGED
@@ -288,6 +288,9 @@ async def _get_permit_detail(client: httpx.AsyncClient, item_seq: str) -> dict |
288
  "interaction": nb["interaction"],
289
  "side_effect": nb["side_effect"],
290
  "deposit": it.get("STORAGE_METHOD") or "",
 
 
 
291
  "image": "", # 허가상세엔 낱알 이미지 없음 — 성상(CHART) 텍스트로 대체
292
  "update_date": it.get("CHANGE_DATE") or "",
293
  "source": "허가정보",
@@ -366,6 +369,12 @@ async def get_dur_dashboard(drug_name: str) -> dict[str, Any]:
366
  # e약은요 미수록(전문약 다수) → 허가정보 상세로 본문 보강
367
  async with httpx.AsyncClient() as client:
368
  easy = await _get_permit_detail(client, src.get("ITEM_SEQ") or "")
 
 
 
 
 
 
369
 
370
  # badges + combo_ingrs
371
  badges: list[dict[str, Any]] = []
 
288
  "interaction": nb["interaction"],
289
  "side_effect": nb["side_effect"],
290
  "deposit": it.get("STORAGE_METHOD") or "",
291
+ "valid_term": it.get("VALID_TERM") or "",
292
+ "chart": it.get("CHART") or "",
293
+ "material": it.get("MATERIAL_NAME") or "",
294
  "image": "", # 허가상세엔 낱알 이미지 없음 — 성상(CHART) 텍스트로 대체
295
  "update_date": it.get("CHANGE_DATE") or "",
296
  "source": "허가정보",
 
369
  # e약은요 미수록(전문약 다수) → 허가정보 상세로 본문 보강
370
  async with httpx.AsyncClient() as client:
371
  easy = await _get_permit_detail(client, src.get("ITEM_SEQ") or "")
372
+ # 허가상세에 있는 유효기간·저장법·성상·주성분으로 item 빈칸 보강
373
+ if easy and item:
374
+ if not item.get("valid_term"): item["valid_term"] = easy.get("valid_term") or ""
375
+ if not item.get("storage"): item["storage"] = easy.get("deposit") or ""
376
+ if not item.get("chart"): item["chart"] = easy.get("chart") or ""
377
+ if not item.get("material"): item["material"] = easy.get("material") or ""
378
 
379
  # badges + combo_ingrs
380
  badges: list[dict[str, Any]] = []