Automático: several studies per layout, loose markers, joins only across documents, unreadable answers held

This commit is contained in:
Roberto Treviño
2026-12-03 15:22:16 -06:00
parent a2a9eb7af3
commit 0c8ca048df
9 changed files with 354 additions and 115 deletions
+8 -2
View File
@@ -3,8 +3,8 @@ garbles is still marked by a line it prints, and a report that leaves its sample
the order it answers is paired with that order by the column both carry."""
from core.pipeline import Join, Route
from models.draft.documents import printed_line
from models.draft.joins import Kind, joined, partner
from models.draft.joins import Kind, apart_from, joined, partner
from models.draft.layouts import printed_line
HPV = (
"No.Proceso {n}\nPaciente {name}\nDDDDEEEETTTTEEEECCCCCCCCIIIIOOOONNNN\n"
@@ -38,5 +38,11 @@ def test_a_report_is_read_with_the_order_the_same_column_pairs_it_with():
found = dict((r["_record"], t) for t, r in joined(node, reports.everyone, orders))
assert found["h1"].startswith("SOLICITUD DE CITOLOGÍA") and "Proceso 1" in found["h1"]
assert found["h0"].startswith("No.Proceso 0") # no order: its own text alone
assert apart_from(next(r for _, r in joined(node, reports.everyone, orders)
if r["_record"] == "h1"), orders) # fmt: skip
both = row("c1", FORM.format(n=1, name="X") + "\n" + HPV.format(n=1, name="X"), 1)
(_, itself), = joined(node, [both], Kind("cervical_cytology", "", "", [], [both],
orders.route)) # fmt: skip
assert not apart_from(itself, orders) # one file, order and report: paired with itself
lone = Kind("cervical_cytology", "VPH", "x", [], reports.everyone[:1])
assert partner(lone, [lone, orders]) is None