@br-health-kit/sigtap
v1.0.0
Published
SIGTAP - Tabela Unificada de procedimentos do SUS, tipada e versionada por competencia
Maintainers
Readme
@br-health-kit/sigtap
SIGTAP, the unified table of SUS procedures, medications and OPM, typed and versioned by monthly competence.
npm install @br-health-kit/sigtapimport { sigtap, centsToAmount } from '@br-health-kit/sigtap'
sigtap.competence // '2026.08'
sigtap.find('0201010011') // AMNIOCENTESE
sigtap.search('consulta')
sigtap.byPrefix('0101') // everything under that subgroup
sigtap.findOccupation('225125') // CBOCompetence matters
SIGTAP is republished every month and values change between competences. Pin one whenever the result has to be reproducible:
sigtap.load('2026.08') // pinned
sigtap.latest() // followsThe code carries the hierarchy
0201010011
||||||
||||++-- organisation form (01)
||++---- subgroup (01)
++------ group (02, diagnostic procedures)That is why byPrefix('02'), byPrefix('0201') and byPrefix('020101')
filter by group, subgroup and organisation form without needing a join.
Money in cents
Values are integer cents, not floats: summing floats over a billing batch
loses money. Use centsToAmount to display:
centsToAmount(procedure.ambulatoryValueCents) // '2.20'Ages in months
SIGTAP publishes age limits in months. Verified against the real data:
neonatal screening ends at 11, transfontanellar puncture at 59, and tubal
ligation starts at 252, the 21 years Brazilian law requires. Source sentinels
(9999, and 1571 for "no upper limit") become null.
The same holds for quantities: 9999 in maximum executions and days of stay
is a sentinel and becomes null. Without that, a consumer could bill 9,999
days of inpatient stay for an outpatient exam.
Occupations are extended CBO
findOccupation accepts six-character alphanumeric codes: beyond numeric
CBO, SIGTAP adds entries such as 2231F9 (médico residente), 5151F1
(agente de combate às endemias) and 1312C1 (sanitarista) for occupations
plain CBO does not number.
The source is FTP only
Every HTTP host DATASUS documents for SIGTAP refuses connections; anonymous
FTP on ftp2.datasus.gov.br serves the monthly packages normally. The
pipeline lists the directory, picks the most recent competence (honouring
_v<timestamp> republications) and downloads over FTP.
Tables are parsed as fixed width using the layout SIGTAP itself publishes next to each file, so a column widened at the source is followed automatically, and a layout that stops describing its file is detected rather than producing shifted fields.
What is not included yet
The relationship tables (rl_procedimento_*: compatible CID, enabled
occupations, modalities) and the long descriptions (tb_descricao, 17 MB) are
not published. See ROADMAP.md.
Environment
Node 20+ through the default entry. For a client bundle use
@br-health-kit/sigtap/web. See docs/browser.md.
Provenance
Public data from the Ministério da Saúde (DATASUS), redistributed without content modification. Code under MIT.
