Lesion size extracted from pathology reports; development record route; scenario catalog and background training jobs in governance

This commit is contained in:
rockdrigo
2026-11-21 03:28:13 -06:00
parent fae6b2232f
commit 2d71fe1103
11 changed files with 489 additions and 9 deletions
+11
View File
@@ -50,3 +50,14 @@ def test_the_rarer_invasive_types_are_read_as_their_code(tipo, codigo):
"""Pins down: a mucinous, tubular or mixed ductal and lobular carcinoma is read as its ICD-O-3 code rather than left
unresolved or taken as ductal or lobular. Fails if their names leave the catalog's aliases."""
assert _leer(f"Diagnóstico: BIOPSIA: {tipo} (8480/3).")["biopsia.tipo_histologico"][0] == codigo
@pytest.mark.parametrize("texto", [
"GRADO HISTOLÓGICO 2 DE NOTTINGHAM (PUNTAJE 6/9). TAMAÑO DE LA LESIÓN: 25 MM. INVASIÓN LINFOVASCULAR: NO.",
"GRADO HISTOLÓGICO 2 DE NOTTINGHAM (PUNTAJE 6/9). TAMAÑO DE LA\nLESIÓN: 25 MM. INVASIÓN LINFOVASCULAR: NO.",
"GRADO HISTOLÓGICO 2 DE NOTTINGHAM (PUNTAJE 6/9). TAMAÑO\nDE LA LESIÓN: 25 MM. INVASIÓN LINFOVASCULAR: NO.",
])
def test_the_lesion_size_is_read_even_when_the_page_wraps_its_caption(texto):
"""Pins down: "TAMAÑO DE LA LESIÓN: 25 MM" gives 25 whether it is on one line or the page wraps it between words,
because the extractor also sees each pair of adjacent lines joined. Fails if the joined lines stop being offered."""
assert float(_leer(texto)["biopsia.tamano_tumor_mm"][0]) == 25.0