- 개발/테스트 스크립트를 dev_scripts/ 폴더로 이동 - 스크린샷을 screenshots/ 폴더로 이동 - 백업 파일 보존 (.backup) - 처방 관련 추가 스크립트 포함 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.7 KiB
Python
54 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
개선된 Excel 입고 처리 테스트
|
|
"""
|
|
|
|
import sys
|
|
sys.path.append('/root/kdrug')
|
|
|
|
from excel_processor import ExcelProcessor
|
|
import pandas as pd
|
|
|
|
def test_excel_processing():
|
|
"""Excel 처리 테스트"""
|
|
processor = ExcelProcessor()
|
|
|
|
# 한의정보 샘플 파일 테스트
|
|
print("=== 한의정보 샘플 파일 처리 테스트 ===\n")
|
|
|
|
if processor.read_excel('sample/한의정보.xlsx'):
|
|
print(f"✓ 파일 읽기 성공")
|
|
print(f"✓ 형식 감지: {processor.format_type}")
|
|
|
|
# 처리
|
|
df = processor.process()
|
|
print(f"✓ 데이터 처리 완료: {len(df)}행")
|
|
|
|
# 보험코드 확인
|
|
if 'insurance_code' in df.columns:
|
|
print("\n보험코드 샘플 (처리 후):")
|
|
for idx, code in enumerate(df['insurance_code'].head(5)):
|
|
herb_name = df.iloc[idx]['herb_name']
|
|
print(f" {herb_name}: {code} (길이: {len(str(code))})")
|
|
|
|
print("\n=== 한의사랑 샘플 파일 처리 테스트 ===\n")
|
|
|
|
processor2 = ExcelProcessor()
|
|
if processor2.read_excel('sample/한의사랑.xlsx'):
|
|
print(f"✓ 파일 읽기 성공")
|
|
print(f"✓ 형식 감지: {processor2.format_type}")
|
|
|
|
# 처리
|
|
df2 = processor2.process()
|
|
print(f"✓ 데이터 처리 완료: {len(df2)}행")
|
|
|
|
# 보험코드 확인
|
|
if 'insurance_code' in df2.columns:
|
|
print("\n보험코드 샘플 (처리 후):")
|
|
for idx, code in enumerate(df2['insurance_code'].head(5)):
|
|
herb_name = df2.iloc[idx]['herb_name']
|
|
print(f" {herb_name}: {code} (길이: {len(str(code))})")
|
|
|
|
if __name__ == "__main__":
|
|
test_excel_processing() |