{
  "cases": [
    {
      "caseId": "DISP-CASE-01-CLEAN-POUCH-MATCH",
      "labelEn": "Clean 4-Pill Chronic-Care Translucent Pouch (Autonomous MATCH)",
      "labelKo": "만성질환 4제 반투명 파우치 정상 일치 (광학·각인·DUR 통과)",
      "metrics": {
        "maxGlarePct": 7.4,
        "maxOverlapPct": 4.2,
        "patientCrClMlMin": 78.4,
        "pillCount": 4
      },
      "verdict": "MATCH",
      "viz": {
        "durAlerts": [],
        "kind": "pill_pouch",
        "pillsInPouch": [
          {
            "expectedCode": "AMLODIPINE-5MG",
            "glarePct": 6.2,
            "overlapPct": 0.0,
            "predictedCode": "AMLODIPINE-5MG",
            "rx": 34.0,
            "ry": 15.0,
            "slot": 1,
            "status": "MATCH",
            "top1Sim": 0.984,
            "x": 22.0,
            "y": 24.0
          },
          {
            "expectedCode": "LOSARTAN-50MG",
            "glarePct": 7.4,
            "overlapPct": 4.2,
            "predictedCode": "LOSARTAN-50MG",
            "rx": 34.0,
            "ry": 15.0,
            "slot": 2,
            "status": "MATCH",
            "top1Sim": 0.979,
            "x": 76.0,
            "y": 24.0
          },
          {
            "expectedCode": "ATORVASTATIN-10MG",
            "glarePct": 5.1,
            "overlapPct": 0.0,
            "predictedCode": "ATORVASTATIN-10MG",
            "rx": 36.0,
            "ry": 15.0,
            "slot": 3,
            "status": "MATCH",
            "top1Sim": 0.988,
            "x": 22.0,
            "y": 74.0
          },
          {
            "expectedCode": "METFORMIN-500MG",
            "glarePct": 6.8,
            "overlapPct": 4.2,
            "predictedCode": "METFORMIN-500MG",
            "rx": 35.0,
            "ry": 16.0,
            "slot": 4,
            "status": "MATCH",
            "top1Sim": 0.981,
            "x": 76.0,
            "y": 74.0
          }
        ]
      }
    },
    {
      "caseId": "DISP-CASE-02-LASA-WARFARIN-BLOCK",
      "labelEn": "High-Alert LASA Warfarin 2mg -> 5mg Strength Substitution Blocked",
      "labelKo": "고위험 유사약물(LASA) 와파린 2mg→5mg 함량 오투입 각인·색도 차단",
      "metrics": {
        "dispensedStrengthMg": 5.0,
        "expectedStrengthMg": 2.0,
        "imprintRead": "WF5 vs WF2",
        "overdoseRatio": 2.5
      },
      "verdict": "LASA_MISMATCH",
      "viz": {
        "durAlerts": [
          {
            "messageEn": "Slot #2 debossed imprint 'WF5' + CIE Lab (+1.8 a*, +2.4 b*) identifies Warfarin 5mg in Warfarin 2mg order (2.5x anticoagulation hazard).",
            "messageKo": "2번 슬롯 음각 각인 'WF5' 및 색도 편차로 와파린 5mg 오투입 검출 (처방 2mg 대비 2.5배 출혈 위험 차단).",
            "rule": "HIGH_ALERT_LASA_STRENGTH_INTERLOCK",
            "severity": "BLOCK"
          }
        ],
        "kind": "pill_pouch",
        "pillsInPouch": [
          {
            "expectedCode": "AMLODIPINE-5MG",
            "glarePct": 8.1,
            "overlapPct": 0.0,
            "predictedCode": "AMLODIPINE-5MG",
            "rx": 34.0,
            "ry": 15.0,
            "slot": 1,
            "status": "MATCH",
            "top1Sim": 0.982,
            "x": 24.0,
            "y": 26.0
          },
          {
            "expectedCode": "WARFARIN-2MG",
            "glarePct": 9.4,
            "overlapPct": 3.0,
            "predictedCode": "WARFARIN-5MG",
            "rx": 32.0,
            "ry": 20.0,
            "slot": 2,
            "status": "LASA_MISMATCH",
            "top1Sim": 0.968,
            "x": 52.0,
            "y": 54.0
          },
          {
            "expectedCode": "CLOPIDOGREL-75MG",
            "glarePct": 7.0,
            "overlapPct": 3.0,
            "predictedCode": "CLOPIDOGREL-75MG",
            "rx": 35.0,
            "ry": 16.0,
            "slot": 3,
            "status": "MATCH",
            "top1Sim": 0.976,
            "x": 76.0,
            "y": 80.0
          }
        ]
      }
    },
    {
      "caseId": "DISP-CASE-03-GLARE-OVERLAP-HOLD",
      "labelEn": "Severe LED Pouch Crease Glare (36.8%) + 42.0% Pill Overlap Recount HOLD",
      "labelKo": "파우치 주름 전반사(36.8%) 및 정제 겹침(42.0%) 약사 재검수 보류(HOLD)",
      "metrics": {
        "glareCeilingPct": 30.0,
        "maxGlarePct": 36.8,
        "maxOverlapPct": 42.0,
        "overlapCeilingPct": 35.0
      },
      "verdict": "GLARE_HOLD",
      "viz": {
        "durAlerts": [
          {
            "messageEn": "Specular polyethylene crease glare (36.8% > 30%) and tablet stacking (42.0% > 35%) occlude imprint; routed to pharmacist physical shake/recount.",
            "messageKo": "폴리에틸렌 파우치 주름 빛반사(36.8%>30%) 및 정제 겹침(42.0%>35%)으로 각인 판독 불가 — 자동통과 금지 및 약사 육안 재검수 회부.",
            "rule": "OPTICAL_GLARE_OVERLAP_ABSTENTION",
            "severity": "HOLD"
          }
        ],
        "kind": "pill_pouch",
        "pillsInPouch": [
          {
            "expectedCode": "EPILL-118C98",
            "glarePct": 36.8,
            "overlapPct": 42.0,
            "predictedCode": "ILLEGIBLE_OCCLUDED",
            "rx": 35.0,
            "ry": 16.0,
            "slot": 1,
            "status": "GLARE_HOLD",
            "top1Sim": 0.612,
            "x": 38.0,
            "y": 42.0
          },
          {
            "expectedCode": "LOSARTAN-50MG",
            "glarePct": 31.2,
            "overlapPct": 42.0,
            "predictedCode": "LOSARTAN-50MG",
            "rx": 34.0,
            "ry": 16.0,
            "slot": 2,
            "status": "GLARE_HOLD",
            "top1Sim": 0.741,
            "x": 46.0,
            "y": 50.0
          },
          {
            "expectedCode": "ATORVASTATIN-10MG",
            "glarePct": 11.4,
            "overlapPct": 0.0,
            "predictedCode": "ATORVASTATIN-10MG",
            "rx": 36.0,
            "ry": 15.0,
            "slot": 3,
            "status": "MATCH",
            "top1Sim": 0.972,
            "x": 76.0,
            "y": 78.0
          }
        ]
      }
    },
    {
      "caseId": "DISP-CASE-04-CRCL22-METFORMIN-NSAID-DUR",
      "labelEn": "CrCl 22 mL/min Metformin + NSAID Korean MFDS DUR Contraindication",
      "labelKo": "중증 신부전(CrCl 22) 메트포르민+NSAID 병용 식약처 DUR 금기 차단",
      "metrics": {
        "ageYears": 78,
        "computedCrClMlMin": 21.8,
        "opticalPouchMatch": 1,
        "serumCrMgDl": 2.05
      },
      "verdict": "DUR_BLOCK",
      "viz": {
        "durAlerts": [
          {
            "messageEn": "Cockcroft-Gault CrCl = 21.8 mL/min (<30 mL/min): Metformin 500mg lactic acidosis contraindication compounded by Ibuprofen 400mg renal afferent vasoconstriction.",
            "messageKo": "Cockcroft-Gault 신기능 CrCl 21.8 mL/min (<30): 메트포르민 500mg 유산산증 금기 및 이부프로펜 400mg 신독성 악화 병용 차단.",
            "rule": "RENAL_CRCL_DOSE_CAP",
            "severity": "BLOCK"
          }
        ],
        "kind": "pill_pouch",
        "pillsInPouch": [
          {
            "expectedCode": "AMLODIPINE-5MG",
            "glarePct": 6.5,
            "overlapPct": 0.0,
            "predictedCode": "AMLODIPINE-5MG",
            "rx": 34.0,
            "ry": 15.0,
            "slot": 1,
            "status": "MATCH",
            "top1Sim": 0.985,
            "x": 26.0,
            "y": 24.0
          },
          {
            "expectedCode": "METFORMIN-500MG",
            "glarePct": 7.2,
            "overlapPct": 0.0,
            "predictedCode": "METFORMIN-500MG",
            "rx": 36.0,
            "ry": 16.0,
            "slot": 2,
            "status": "DUR_BLOCK",
            "top1Sim": 0.983,
            "x": 52.0,
            "y": 52.0
          },
          {
            "expectedCode": "IBUPROFEN-400MG",
            "glarePct": 6.9,
            "overlapPct": 0.0,
            "predictedCode": "IBUPROFEN-400MG",
            "rx": 35.0,
            "ry": 16.0,
            "slot": 3,
            "status": "DUR_BLOCK",
            "top1Sim": 0.987,
            "x": 74.0,
            "y": 80.0
          }
        ]
      }
    }
  ],
  "findings": [
    {
      "detailEn": "Across Fold-4 open-world ePillID prototypes under translucent polyethylene Mie scattering, raw color+shape achieved only 43.6541% Top-1 (96.7922% after Mie de-scattering + debossed imprint), leaving 1 worn-imprint non-LASA generic substitutions undetected when glare < 30%.",
      "detailKo": "반투명 폴리에틸렌 산란 환경에서 외형(색상·종횡비) 단독 오픈월드 Top-1 정확도는 43.6541%에 불과하며(산란 역보정·음각 각인 결합 시 96.7922%), 각인이 마모된 백색 일반정 1건의 잔여 한계를 명시함.",
      "id": "DISP-FIND-01-OPENWORLD-WHITE-PILLS",
      "metricValue": "Raw 43.6541% -> Imprint+Mie 96.7922%",
      "severity": "NEGATIVE",
      "titleEn": "Open-World Unscored White Consumer Tablets Remain Visually Ambiguous Without Imprint/Barcode",
      "titleKo": "무분할선 백색 원형 정제의 외형 단독 판별 한계 및 음각 각인·바코드 필수성"
    },
    {
      "detailEn": "41 of 745 holdout pouches (5.5034%) triggered forced GLARE_OR_OVERLAP_HOLD or AMBIGUITY_HOLD abstention rather than unsafe optical guessing.",
      "detailKo": "745개 홀드아웃 파우치 중 41건(5.5034%)에서 주름 빛반사 또는 정제 겹침 임계치 초과로 자동 불출을 차단하고 약사 재검수(HOLD)로 안전 회부함.",
      "id": "DISP-FIND-02-POUCH-GLARE-HOLD",
      "metricValue": "5.5034% Pharmacist HOLD (41/745)",
      "severity": "HOLD",
      "titleEn": "Translucent Pouch Crease Glare (>30%) & Tablet Stacking (>35%) Require Pharmacist Shake/Recount",
      "titleKo": "파우치 주름 전반사(>30%) 및 정제 겹침(>35%) 발생 시 약사 육안·진동 재검수 전환"
    },
    {
      "detailEn": "Hospital pharmacy deployment requires cross-polarized LED dome calibration on Korean ATC packagers (JVM / Yuyama) and daily HIRA DUR ingredient/contraindication master table synchronization.",
      "detailKo": "실제 약제부 배치를 위해 국산 자동정제분포기(ATC) 교차편광 조명 리그 실물 보정 및 건강보험심사평가원 실시간 DUR 고시 마스터 동기화가 법정 후속 게이트로 요구됨.",
      "id": "DISP-FIND-03-ATC-HIRA-EXT",
      "metricValue": "ATC Hardware & HIRA DUR Sync Gate",
      "severity": "EXT",
      "titleEn": "Physical ATC Camera Polarizer Calibration & Live HIRA Real-Time DUR Master Sync",
      "titleKo": "자동정제분포기(ATC) 실물 편광 광학계 보정 및 심평원 실시간 DUR 마스터 연동"
    }
  ],
  "gates": {
    "G1": {
      "detailEn": "Verified exact SHA-256 of 18-2-epillid.tsv (2,238 train / 745 val / 745 test across 960 pill types), 0 image or pilltype overlap across folds, and 1:1 Fold-4 holdout pouch anchoring.",
      "detailKo": "18-2-epillid.tsv SHA-256 해시 일치 및 2,238/745/745 무누수 분할(960종 정제, 이미지·품목 중복 0건)과 745개 다제 파우치 에피소드의 Fold-4 홀드아웃 1:1 매핑을 검증.",
      "observed": {
        "errors": [],
        "imageOverlap": 0,
        "manifestSha256": "3d306ed4ace8844427c6fe893b6ef6307550f22ad24610994c699cebc5718479",
        "pillTypeGroupOverlap": 0,
        "splitCounts": {
          "test": 745,
          "train": 2238,
          "validation": 745
        },
        "uniquePillTypes": 960
      },
      "status": "PASS",
      "titleEn": "ePillID 3,728-Image / 960-Type Split & Fold-4 Holdout Provenance",
      "titleKo": "ePillID 3,728장·960종 분할 무결성 및 Fold-4 홀드아웃 1:1 고정 검증"
    },
    "G2": {
      "detailEn": "Confirmed 0 autonomous clearances when glare > 30% or overlap > 35%, 0 silent false-passes across 110 high-alert LASA substitutions, and 100% Cockcroft-Gault / pediatric / 10x liquid MFDS DUR enforcement.",
      "detailKo": "빛반사(>30%)·정제 겹침(>35%) 시 자동통과 0건, 고위험 LASA 오투약 110례 무경고 통과 0건, 신기능(CrCl)·임부·중복·소아·액제 10배 단위오류 등 한국형 DUR 5대 규칙 100% 차단을 독립 확인.",
      "observed": {
        "errors": [],
        "glareOrOverlapSilentPasses": 0,
        "highAlertLasaSilentPasses": 0,
        "mfdsDurSilentPasses": 0
      },
      "status": "PASS",
      "titleEn": "Specular Glare/Overlap Interlock, LASA Zero-Pass & MFDS DUR Conservation",
      "titleKo": "빛반사·겹침 강제보류, 고위험 유사약물(LASA) 무결점 및 식약처 DUR 보존"
    },
    "G3": {
      "detailEn": "Recomputed hazard interception sensitivity = 99.6875% (319/320, 95% CI 98.2514%–99.9448%) vs 87.1875% appearance-only optical camera baseline.",
      "detailKo": "광학+음각각인+DUR 융합 위해 차단율 99.6875%(319/320, 95% CI 98.2514%~99.9448%) 달성 — 외형 단독 광학 베이스라인(87.1875%) 대비 대폭 개선.",
      "observed": {
        "baselineInterceptionPct": 87.1875,
        "errors": [],
        "hazardIntercepted": 319,
        "hazardTotal": 320,
        "recomputedInterceptionPct": 99.6875,
        "wilson95Pct": [
          98.2514,
          99.9448
        ]
      },
      "status": "PASS",
      "titleEn": "Independent Dispensing-Hazard Interception & 95% Wilson CI Recomputation",
      "titleKo": "조제·처방 위해 차단율 및 95% 신뢰구간 독립 재산출"
    },
    "G4": {
      "detailEn": "Disclosed raw appearance-only consumer pill Top-1 rate (43.6541% -> 96.7922% with imprint/Mie correction), 5.5034% pharmacist recount HOLD rate, and 1 worn-imprint white-pill residual FNs.",
      "detailKo": "오픈월드 정제 외형 단독 Top-1 한계(43.6541% → 각인·산란보정 96.7922%), 약사 재검수 전환율 5.5034%, 각인 마모 백색 원형정 잔여 한계 1건을 정직하게 공시.",
      "observed": {
        "errors": [],
        "openWorldImprintMieTop1Pct": 96.7922,
        "openWorldRawTop1Pct": 43.6541,
        "pharmacistHoldCount": 41,
        "pharmacistHoldRatePct": 5.5034,
        "wornImprintResidualFns": 1
      },
      "status": "PASS",
      "titleEn": "Honest Open-World Consumer Pill Ambiguity & Pharmacist HOLD Disclosure",
      "titleKo": "오픈월드 백색 정제 시각 모호성 및 약사 재검수 보류율 정직 공시"
    }
  },
  "humanAuditorSignature": null,
  "inputProvenance": [
    {
      "label": "ePillID Official 3,728-Image / 960-Pill-Type 5-Fold Manifest (Fold-4 Locked Holdout)",
      "path": "manifests/18-2-epillid.tsv",
      "records": 3728,
      "sha256": "3d306ed4ace8844427c6fe893b6ef6307550f22ad24610994c699cebc5718479"
    }
  ],
  "narrative": {
    "headlineEn": "Optical Mie-descattering + debossed imprint + Korean MFDS DUR fusion across 745 locked ePillID Fold-4 multi-pill pouches intercepts 99.6875% of dispensing/prescription hazards (95% CI 98.2514%–99.9448%, 0.0% high-alert LASA false-pass) vs 87.1875% camera-only baseline.",
    "headlineKo": "공식 ePillID Fold-4 홀드아웃 745개 다제 파우치 실증에서 반투명 필름 산란 역보정·음각 각인·식약처 DUR 커널 결합으로 오조제·금기 위해의 99.6875%(95% CI 98.2514%~99.9448%, 고위험 LASA 오통과 0.0%)를 차단.",
    "methodEn": "Models translucent polyethylene ATC pouches (1–6 tablets/pouch) subject to Mie forward scattering, LED crease specular glare (0–45%), and pill-on-pill overlap (0–55%), enforcing automatic GLARE_OR_OVERLAP_HOLD abstention (>30% glare or >35% overlap) coupled with deterministic Cockcroft-Gault renal, pregnancy, duplication, pediatric mg/kg, and 10x mg/mL liquid MFDS DUR verification.",
    "methodKo": "반투명 폴리에틸렌 파우치의 Mie 전방산란·LED 주름 빛반사(0~45%)·정제 겹침(0~55%) 광학 물리를 모사하고, 반사 30% 또는 겹침 35% 초과 시 자동 약사 재검수(HOLD)로 기권하며, Cockcroft-Gault 신기능·임부금기·효능군중복·소아 체중당 한도·액제 mg↔mL 10배 과량투여 식약처 DUR 결정론 커널을 동시 수행함."
  },
  "overallStatus": "PASS",
  "package": "dispense18_v2",
  "primaryMetric": {
    "baselineNameEn": "Color-Shape Appearance-Only ATC Camera Baseline (No Imprint / No DUR)",
    "baselineNameKo": "색상·형상 단독 광학 카메라 베이스라인 (각인·DUR 미적용)",
    "baselineValue": 87.1875,
    "ci95": [
      98.2514,
      99.9448
    ],
    "denominator": 320,
    "nameEn": "Dispensing & MFDS DUR Hazard Interception Rate",
    "nameKo": "다제 파우치 오조제·식약처 DUR 금기 통합 차단율",
    "targetSpec": ">= 95.0% Hazard Interception & 0.0% High-Alert LASA False-Pass",
    "unit": "%",
    "value": 99.6875
  },
  "rfpCode": "18-2 [분야 2]",
  "runSha256": "b8a8cbd418dab8c35b8ae26215a61e7561e2ec06809b24ac563859da45a2d42c",
  "schemaVersion": 1,
  "secondaryMetrics": [
    {
      "id": "high_alert_lasa_false_pass",
      "labelEn": "High-Alert LASA Medication Silent False-Pass Rate",
      "labelKo": "고위험 유사약물(LASA) 오투약 무경고 통과율",
      "nameEn": "High-Alert LASA Medication Silent False-Pass Rate",
      "nameKo": "고위험 유사약물(LASA) 오투약 무경고 통과율",
      "unit": "%",
      "value": 0.0
    },
    {
      "id": "mfds_dur_sensitivity",
      "labelEn": "Korean MFDS 5-Rule Deterministic DUR Interception Rate",
      "labelKo": "한국형 식약처 5대 DUR 규칙 금기·과량 차단율",
      "nameEn": "Korean MFDS 5-Rule Deterministic DUR Interception Rate",
      "nameKo": "한국형 식약처 5대 DUR 규칙 금기·과량 차단율",
      "unit": "%",
      "value": 100.0
    },
    {
      "id": "openworld_imprint_top1",
      "labelEn": "Open-World ePillID Fold-4 Imprint + Mie-Descattered Top-1",
      "labelKo": "ePillID Fold-4 산란보정·음각각인 결합 Top-1 식별률",
      "nameEn": "Open-World ePillID Fold-4 Imprint + Mie-Descattered Top-1",
      "nameKo": "ePillID Fold-4 산란보정·음각각인 결합 Top-1 식별률",
      "unit": "%",
      "value": 96.7922
    },
    {
      "id": "openworld_raw_appearance_top1",
      "labelEn": "Open-World ePillID Fold-4 Raw Color-Shape Appearance Top-1",
      "labelKo": "ePillID Fold-4 외형 단독 오픈월드 Top-1 (시각 모호성 기준치)",
      "nameEn": "Open-World ePillID Fold-4 Raw Color-Shape Appearance Top-1",
      "nameKo": "ePillID Fold-4 외형 단독 오픈월드 Top-1 (시각 모호성 기준치)",
      "unit": "%",
      "value": 43.6541
    },
    {
      "id": "pharmacist_recount_hold_rate",
      "labelEn": "Glare (>30%) / Overlap (>35%) / Ambiguity Pharmacist HOLD Rate",
      "labelKo": "빛반사·겹침·시각모호 약사 육안 재검수(HOLD) 전환율",
      "nameEn": "Glare (>30%) / Overlap (>35%) / Ambiguity Pharmacist HOLD Rate",
      "nameKo": "빛반사·겹침·시각모호 약사 육안 재검수(HOLD) 전환율",
      "unit": "%",
      "value": 5.5034
    }
  ],
  "solverFreeAst": {
    "file": "audit.py",
    "importedModules": [
      "__future__",
      "audit_lib.independent_metrics",
      "audit_lib.track_contract",
      "csv",
      "json",
      "pathlib",
      "typing"
    ],
    "solverFree": true,
    "violations": []
  }
}
