> For the complete documentation index, see [llms.txt](https://docs.voa.health/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.voa.health/integracao/tiss/tutoriais/01-validar-um-lote.md).

# Validar um lote

Comece pelo exemplo incluído. O relatório reúne achados que podem ser revisados antes de corrigir a guia.

[Abrir no GitHub](https://github.com/Voa-Health/tiss/blob/main/docs/tutoriais/01-validar-um-lote.ipynb) · [Abrir no Colab](https://colab.research.google.com/github/Voa-Health/tiss/blob/main/docs/tutoriais/01-validar-um-lote.ipynb)

Comece pelo exemplo incluído. O relatório reúne achados que podem ser revisados antes de corrigir a guia.

```python
from tiss import examples, validate

report = validate(examples.load("lote-com-erros"))
[(finding.code, finding.severity) for finding in report.findings]
```

```
[('xsd.tipo', 'error'),
 ('xsd.elemento_ausente', 'error'),
 ('lote.hash_divergente', 'error'),
 ('guia.sequencial', 'error'),
 ('item.valor_zerado', 'error'),
 ('item.valor_divergente', 'error'),
 ('guia.executante_ausente', 'warning'),
 ('lote.valor_total_geral', 'error')]
```

Cada achado aponta uma regra e, quando possível, sua localização. Um lote válido não contém achados.

```python
valid_report = validate(examples.load("lote-valido"))
valid_report.valid, valid_report.findings
```

```
(True, ())
```
