ADOS-2 preview carries each item's code and title from the Core list
The preview result names the module's items by the titles in core.tea.ados2_items, module items first, so the Gobernanza dialog and its PDF print what the report asks instead of field names.
This commit is contained in:
@@ -7,6 +7,7 @@ from sqlalchemy.exc import SQLAlchemyError
|
||||
from core import concept_map, tea
|
||||
from core.pipeline import apply_patterns
|
||||
from core.tea import ados2 as scoring
|
||||
from core.tea import ados2_items
|
||||
from models import graph
|
||||
from models.tea.eeg import analysis, curves, read
|
||||
from models.tea.jobs import MODELS
|
||||
@@ -148,7 +149,10 @@ def _report(
|
||||
evaluation_date = _parse("evaluation_date", row.get("evaluation_date"), "date", warnings)
|
||||
if "evaluation_date" not in row:
|
||||
evaluation_date = recorded_on
|
||||
items = {item: _parse(item, row.get(item), "number", warnings) for item in tea.ADOS2_ITEMS}
|
||||
module = row.get("module")
|
||||
titles = {i.field: f"{i.code} {i.title}" for i in ados2_items.ITEMS.get(module, ())}
|
||||
order = [*titles, *(item for item in tea.ADOS2_ITEMS if item not in titles)]
|
||||
items = {item: _parse(item, row.get(item), "number", warnings) for item in order}
|
||||
css, classification = None, None
|
||||
if evaluation_date is None:
|
||||
warnings.append("ADOS-2 not scored: no evaluation date")
|
||||
@@ -166,9 +170,10 @@ def _report(
|
||||
"the report lacks the module or the item scores"
|
||||
)
|
||||
return PreviewAdos2(
|
||||
module=row.get("module"),
|
||||
module=module,
|
||||
evaluation_date=evaluation_date,
|
||||
items=items,
|
||||
titles=titles,
|
||||
css=css,
|
||||
classification=classification,
|
||||
read=fields,
|
||||
|
||||
Reference in New Issue
Block a user