feat: update medical training case and auth modules
This commit is contained in:
@@ -10,6 +10,7 @@ from pathlib import Path
|
||||
from config.exceptions import AppError
|
||||
from . import deepseek_client
|
||||
from .pdf_reader import extract_text_from_pdfs
|
||||
from .exam_items import normalize_exam_items
|
||||
from prompts.loader import load_prompt
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -38,6 +39,10 @@ def parse_pdf(files, case_type: str, user) -> dict:
|
||||
data.pop('stages', None)
|
||||
|
||||
data['case_type'] = case_type
|
||||
if 'exam_items' in data:
|
||||
data['exam_items'] = normalize_exam_items(data.get('exam_items') or [])
|
||||
else:
|
||||
data['exam_items'] = []
|
||||
|
||||
_strip_unknown_fields(data)
|
||||
_validate_schema(data)
|
||||
@@ -72,7 +77,7 @@ _SCHEMA_ALLOWED_KEYS = {
|
||||
'patient_age', 'patient_gender', 'tags', 'symptom_tags', 'disease_tags',
|
||||
'competency_tags', 'guideline_tags', 'knowledge_points', 'icd_codes',
|
||||
'estimated_minutes', 'osce_enabled', 'department_name',
|
||||
'traditional', 'teaching',
|
||||
'exam_items', 'traditional', 'teaching',
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user