|
@@ -419,7 +419,6 @@ class SearchBusiness:
|
|
|
logger.error(f"科室推荐失败: {str(e)}")
|
|
|
return []
|
|
|
|
|
|
- def validate_medical_record(self, medical_record: str, validate_type: str) -> dict:
|
|
|
|
|
|
def _validate_chief_complaint(self, structured_data: dict) -> list:
|
|
|
"""
|
|
@@ -441,7 +440,7 @@ class SearchBusiness:
|
|
|
if chief_complaint.get("持续时间"):
|
|
|
is_accurate, error_msg = check_time(chief_complaint["持续时间"])
|
|
|
if not is_accurate:
|
|
|
- errors.append(f"持续时间'{chief_complaint['持续时间']}'{error_msg}")
|
|
|
+ errors.append(f"主诉持续时间'{chief_complaint['持续时间']}'{error_msg}")
|
|
|
return errors
|
|
|
|
|
|
def _validate_diagnosis_info(self, structured_data: dict) -> list:
|
|
@@ -479,10 +478,10 @@ class SearchBusiness:
|
|
|
#json打印structured_data
|
|
|
logger.info(f"结构化数据: {json.dumps(structured_data, ensure_ascii=False, indent=4)}")
|
|
|
|
|
|
- # 验证主诉字段
|
|
|
+ # 验证主诉字段格式
|
|
|
errors = self._validate_chief_complaint(structured_data)
|
|
|
|
|
|
- # 验证诊断信息
|
|
|
+ # 验证诊断信息逻辑
|
|
|
errors.extend(self._validate_diagnosis_info(structured_data))
|
|
|
|
|
|
if errors:
|