improve ingestion system to match isssteleon setup
This commit is contained in:
@@ -48,9 +48,16 @@ class _NewResultado:
|
||||
|
||||
|
||||
def match_or_mint(
|
||||
discovered: list[DiscoveredField], *, proyecto: str, catalogo: Catalogo, estudio_id: str | None = None
|
||||
discovered: list[DiscoveredField],
|
||||
*,
|
||||
proyecto: str,
|
||||
catalogo: Catalogo,
|
||||
estudio_id: str | None = None,
|
||||
mint: bool = True,
|
||||
) -> list[MatchedField]:
|
||||
"""One `MatchedField` per discovered caption, in order.
|
||||
"""One `MatchedField` per discovered caption, in order. With
|
||||
`mint=False`, a caption nothing in the catalog matches is left out
|
||||
instead of being added to the catalog file.
|
||||
|
||||
`estudio_id`, when the caller already knows it (the row's own
|
||||
study-type column, resolved through `codigos_hospital`), scopes which
|
||||
@@ -67,6 +74,8 @@ def match_or_mint(
|
||||
found = _best_match(field.caption, labels)
|
||||
if found is not None:
|
||||
resultado, is_new = by_resultado_id[found], False
|
||||
elif not mint:
|
||||
continue
|
||||
else:
|
||||
resultado = _mint(field, proyecto=proyecto, estudio_id=estudio_id, catalogo=catalogo)
|
||||
is_new = True
|
||||
|
||||
Reference in New Issue
Block a user