Skip to content

feat(metadata): document curated CNES LT fields - #392

Open
elvispcavalcante wants to merge 1 commit into
AlertaDengue:mainfrom
elvispcavalcante:feat/cnes-lt-metadata
Open

elvispcavalcante wants to merge 1 commit into
AlertaDengue:mainfrom
elvispcavalcante:feat/cnes-lt-metadata

Conversation

@elvispcavalcante

Copy link
Copy Markdown

Refs #232

Follows the format of #383 (CNES ST) and adds a curated schema for CNES LT (hospital beds).

Changes

  • pysus/api/metadata/schemas/cnes/lt.yaml: 10 columns (CNES, CODUFMUN, TP_LEITO, CODLEITO, QT_EXIST, QT_CONTR, QT_SUS, QT_NSUS, COMPETEN, NAT_JUR) with PT/EN descriptions. TP_LEITO and CODLEITO include their category codes.
  • Tests in test_columns.py and test_metadata_columns.py cover search by endpoint, description and bed specialty, load a synthetic row shaped like LTCE2610, and check that available_groups("cnes") == ["lt", "st"]. The "uncovered group" tests now use pf.
  • docs/source/guides/columns.rst: describes the LT coverage and adds a load_column_metadata("cnes", "lt") example.

No change to pysus/api/columns.py was needed, since it already loads every CNES group.

Sources (also cited in the YAML header)

  • DATASUS, Informe Técnico CNES 2017-06, section 2.4 (LT layout)
  • DATASUS TabWin package TAB_CNES.zip (Oct 2026): Leitos_Especialidade.def, tip1leit.cnv, Esp_leit.CNV
  • Checked against the official LTCE2610 file

Notes from that check:

  • QT_NSUS and NAT_JUR are in the file but not in section 2.4. QT_NSUS is labelled in Leitos_Especialidade.def as QT_EXIST - QT_SUS, which held for every row.
  • TP_LEITO is declared as CHAR(2), but its values use a single character, so the schema doesn't fix its width.
  • CODLEITO 96 is in the file but has no label in Esp_leit.CNV.

Checks

  • pytest pysus/tests/api/test_columns.py pysus/tests/api/test_metadata_columns.py: 43 passed
  • pre-commit on the changed files: passed
  • sphinx-build -W: no new warnings from this change (the local warnings are identical on main)

Add a curated CNES hospital bed (LT) column schema, sourced from the
DATASUS CNES 2017-06 technical layout and the TabWin TAB_CNES package,
and checked against the official LTCE2610 file.

Refs AlertaDengue#232

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant