From 0d9f4c9a230534a6402f01ab68071d1a961639cb Mon Sep 17 00:00:00 2001 From: thug0bin Date: Thu, 5 Mar 2026 20:44:04 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=9D=B4=EC=A0=84=20=EC=B2=98=EB=B0=A9?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=8F=84=20=EB=8C=80=EC=B2=B4=EC=A1=B0?= =?UTF-8?q?=EC=A0=9C=20=EC=9B=90=EC=B2=98=EB=B0=A9(PS=5FType=3D9)=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 현재 처방과 동일하게 PS_Type=9는 목록에서 제외 - 중복 처방처럼 보이는 문제 해결 --- backend/pmr_api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/pmr_api.py b/backend/pmr_api.py index a9ed7f9..3dea33e 100644 --- a/backend/pmr_api.py +++ b/backend/pmr_api.py @@ -760,18 +760,21 @@ def get_patient_history(cus_code): pre_serial = row.PreSerial # 해당 처방의 약품 목록 조회 + # PS_Type=9 (대체조제 원처방)는 제외 cursor.execute(""" SELECT s.DrugCode, s.Days, s.QUAN, s.QUAN_TIME, + s.PS_Type, g.GoodsName, m.PRINT_TYPE FROM PS_sub_pharm s LEFT JOIN PM_DRUG.dbo.CD_GOODS g ON s.DrugCode = g.DrugCode LEFT JOIN PM_DRUG.dbo.CD_MC m ON s.DrugCode = m.DRUGCODE WHERE s.PreSerial = ? + AND (s.PS_Type IS NULL OR s.PS_Type != '9') ORDER BY s.SUB_SERIAL """, (pre_serial,)) @@ -783,7 +786,8 @@ def get_patient_history(cus_code): 'add_info': med_row.PRINT_TYPE or '', 'dosage': float(med_row.QUAN) if med_row.QUAN else 0, 'frequency': med_row.QUAN_TIME or 0, - 'duration': med_row.Days or 0 + 'duration': med_row.Days or 0, + 'ps_type': med_row.PS_Type or '0' }) # 날짜 포맷