From d820d13af9627b26c561f4c0c7074ce5705fb931 Mon Sep 17 00:00:00 2001 From: thug0bin Date: Thu, 5 Mar 2026 14:14:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B9=84=EA=B8=89=EC=97=AC/100%=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20-=20UnitCode=20=EA=B8=B0=EB=B0=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - UnitCode 컬럼 추가 (같은 테이블, 쿼리 부담 없음) - UnitCode=2: 비) 비급여 (빨간색) - UnitCode=3: 100) 전액본인부담 (보라색) - 기존 대체조제 배지와 함께 표시 가능 --- backend/pmr_api.py | 5 +++++ backend/templates/pmr.html | 26 +++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/backend/pmr_api.py b/backend/pmr_api.py index 4361388..51b410f 100644 --- a/backend/pmr_api.py +++ b/backend/pmr_api.py @@ -201,6 +201,7 @@ def get_prescription_detail(prescription_id): s.PS_Type, s.INV_QUAN, s.SUB_SERIAL, + s.UnitCode, g.GoodsName, g.SUNG_CODE, m.PRINT_TYPE, @@ -236,6 +237,9 @@ def get_prescription_detail(prescription_id): is_substituted = row.PS_Type == '4' and (i + 1) in original_prescriptions original_drug = original_prescriptions.get(i + 1) if is_substituted else None + # UnitCode: 1=보험, 2=비보험, 3=100/100, 4~7=급여(본인부담률) + unit_code = int(row.UnitCode) if row.UnitCode else 1 + medications.append({ 'medication_code': row.DrugCode or '', 'med_name': row.GoodsName or row.DrugCode or '', @@ -247,6 +251,7 @@ def get_prescription_detail(prescription_id): 'type': '급여' if row.PS_Type in ['0', '4'] else '비급여' if row.PS_Type == '1' else row.PS_Type, 'sung_code': row.SUNG_CODE or '', 'ps_type': row.PS_Type or '0', + 'unit_code': unit_code, 'is_substituted': is_substituted, 'original_drug': original_drug }) diff --git a/backend/templates/pmr.html b/backend/templates/pmr.html index 6e2b18c..ac0f7d3 100644 --- a/backend/templates/pmr.html +++ b/backend/templates/pmr.html @@ -966,6 +966,30 @@ margin-right: 4px; vertical-align: middle; } + /* 비급여 표시 */ + .noncov-badge { + display: inline-block; + background: linear-gradient(135deg, #ef4444, #dc2626); + color: white; + padding: 1px 5px; + border-radius: 4px; + font-size: 0.65rem; + font-weight: 700; + margin-right: 4px; + vertical-align: middle; + } + /* 100/100 전액본인부담 표시 */ + .full-badge { + display: inline-block; + background: linear-gradient(135deg, #8b5cf6, #7c3aed); + color: white; + padding: 1px 5px; + border-radius: 4px; + font-size: 0.65rem; + font-weight: 700; + margin-right: 4px; + vertical-align: middle; + } .original-rx { margin-top: 4px; font-size: 0.75rem; @@ -1419,7 +1443,7 @@
- ${m.ps_type === '1' ? '대) ' : ''}${m.is_substituted ? '저) ' : ''}${m.med_name || m.medication_code} + ${m.unit_code === 2 ? '비) ' : ''}${m.unit_code === 3 ? '100) ' : ''}${m.ps_type === '1' ? '대) ' : ''}${m.is_substituted ? '저) ' : ''}${m.med_name || m.medication_code}
${m.medication_code}
${m.add_info ? `
${escapeHtml(m.add_info)}
` : ''}