Governance TEA EEG: preview of one EDF and its ADOS-2 report analysed in memory, nothing stored

This commit is contained in:
ulises
2026-11-23 12:26:15 -06:00
parent b0b797ac15
commit 6452e43cad
4 changed files with 358 additions and 8 deletions
+15
View File
@@ -164,6 +164,21 @@ def upload_eeg():
return jsonify(added), 201
@governance_bp.post("/tea/eeg/preview")
def preview_eeg():
"""Analyse one EDF, and the child's ADOS-2 report if given, without storing either: the summary bundle."""
from webapi.tea.eeg_preview import EegPreview, PreviewError
edf = request.files.get("edf")
if edf is None or not edf.filename:
return jsonify({"error": "Se requiere el campo edf."}), 400
report = request.files.get("ados2")
try:
return jsonify(EegPreview().run(edf.read(), report.read() if report is not None and report.filename else None))
except PreviewError as error:
return jsonify({"error": str(error)}), 400
# -- model versions ----------------------------------------------------------------