feat: implement OCR parsing status tracking and biomarker count display
This commit is contained in:
@@ -24,6 +24,8 @@ pub struct SourceResponse {
|
||||
pub file_path: String,
|
||||
pub file_type: String,
|
||||
pub file_size: i64,
|
||||
pub status: String,
|
||||
pub biomarker_count: Option<i32>,
|
||||
pub ocr_data: Option<String>,
|
||||
pub description: Option<String>,
|
||||
pub uploaded_at: String,
|
||||
@@ -55,6 +57,8 @@ pub async fn list_sources(
|
||||
file_path: s.file_path,
|
||||
file_type: s.file_type,
|
||||
file_size: s.file_size,
|
||||
status: s.status,
|
||||
biomarker_count: s.biomarker_count,
|
||||
ocr_data: s.ocr_data,
|
||||
description: s.description,
|
||||
uploaded_at: s.uploaded_at.to_string(),
|
||||
@@ -82,6 +86,8 @@ pub async fn get_source(
|
||||
file_path: s.file_path,
|
||||
file_type: s.file_type,
|
||||
file_size: s.file_size,
|
||||
status: s.status,
|
||||
biomarker_count: s.biomarker_count,
|
||||
ocr_data: s.ocr_data,
|
||||
description: s.description,
|
||||
uploaded_at: s.uploaded_at.to_string(),
|
||||
@@ -166,6 +172,8 @@ pub async fn upload_source(
|
||||
file_path: Set(file_path.to_string_lossy().to_string()),
|
||||
file_type: Set(content_type.clone()),
|
||||
file_size: Set(file_size),
|
||||
status: Set("pending".to_string()),
|
||||
biomarker_count: Set(None),
|
||||
ocr_data: Set(None),
|
||||
description: Set(description.clone()),
|
||||
uploaded_at: Set(now),
|
||||
@@ -187,6 +195,8 @@ pub async fn upload_source(
|
||||
file_path: inserted.file_path,
|
||||
file_type: inserted.file_type,
|
||||
file_size: inserted.file_size,
|
||||
status: inserted.status,
|
||||
biomarker_count: inserted.biomarker_count,
|
||||
ocr_data: inserted.ocr_data,
|
||||
description: inserted.description,
|
||||
uploaded_at: inserted.uploaded_at.to_string(),
|
||||
@@ -256,6 +266,8 @@ pub async fn update_ocr(
|
||||
file_path: updated.file_path,
|
||||
file_type: updated.file_type,
|
||||
file_size: updated.file_size,
|
||||
status: updated.status,
|
||||
biomarker_count: updated.biomarker_count,
|
||||
ocr_data: updated.ocr_data,
|
||||
description: updated.description,
|
||||
uploaded_at: updated.uploaded_at.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user