{"_id":"@br-health-kit/sigtap","name":"@br-health-kit/sigtap","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@br-health-kit/sigtap","version":"1.0.0","description":"SIGTAP - Tabela Unificada de procedimentos do SUS, tipada e versionada por competencia","license":"MIT","engines":{"node":">=20"},"type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./web":{"types":"./dist/web.d.ts","import":"./dist/web.js","require":"./dist/web.cjs"},"./data/*":"./data/*"},"dependencies":{"@br-health-kit/core":"1.0.0"},"publishConfig":{"access":"public"},"keywords":["sigtap","sus","procedimentos","datasus","brasil"],"repository":{"type":"git","url":"git+https://github.com/arielff3/br-health-kit.git","directory":"packages/sigtap"},"homepage":"https://github.com/arielff3/br-health-kit/tree/main/packages/sigtap#readme","bugs":{"url":"https://github.com/arielff3/br-health-kit/issues"},"scripts":{"build":"tsup","clean":"node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""},"_id":"@br-health-kit/sigtap@1.0.0","_integrity":"sha512-4k9TY5z1GEaMLo7EQcXVJUsmpCtwBFyMIEScImZXTeXzdc3NfdKg1yM0Umz1/1qTwQw24qDw1siOLir6YwrKHg==","_resolved":"C:\\Users\\ariel\\AppData\\Local\\Temp\\0d075d5bbb007162ffe66d8bc2998872\\br-health-kit-sigtap-1.0.0.tgz","_from":"file:br-health-kit-sigtap-1.0.0.tgz","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-4k9TY5z1GEaMLo7EQcXVJUsmpCtwBFyMIEScImZXTeXzdc3NfdKg1yM0Umz1/1qTwQw24qDw1siOLir6YwrKHg==","shasum":"cdc5ebcbd9300387cd58023e99af3a0d81062818","tarball":"https://registry.npmjs.org/@br-health-kit/sigtap/-/sigtap-1.0.0.tgz","fileCount":31,"unpackedSize":2374384,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICrzPvMTO1Dg0I2tA10oxVD7hKKZbv88N5Bxq4BfMaWIAiAx3n1ooLiaqtPr2K3CnXA2yfJlVD793WGP1K6VYf4ohw=="}]},"_npmUser":{"name":"arielff03","email":"arielfrancoferreira5@gmail.com"},"directories":{},"maintainers":[{"name":"arielff03","email":"arielfrancoferreira5@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sigtap_1.0.0_1787770225757_0.0013650260620796661"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-26T18:50:25.569Z","1.0.0":"2026-08-26T18:50:25.982Z","modified":"2026-08-26T18:50:26.209Z"},"maintainers":[{"name":"arielff03","email":"arielfrancoferreira5@gmail.com"}],"description":"SIGTAP - Tabela Unificada de procedimentos do SUS, tipada e versionada por competencia","homepage":"https://github.com/arielff3/br-health-kit/tree/main/packages/sigtap#readme","keywords":["sigtap","sus","procedimentos","datasus","brasil"],"repository":{"type":"git","url":"git+https://github.com/arielff3/br-health-kit.git","directory":"packages/sigtap"},"bugs":{"url":"https://github.com/arielff3/br-health-kit/issues"},"license":"MIT","readme":"# @br-health-kit/sigtap\n\nSIGTAP, the unified table of SUS procedures, medications and OPM, typed and\nversioned by monthly competence.\n\n```bash\nnpm install @br-health-kit/sigtap\n```\n\n```ts\nimport { sigtap, centsToAmount } from '@br-health-kit/sigtap'\n\nsigtap.competence            // '2026.08'\nsigtap.find('0201010011')    // AMNIOCENTESE\nsigtap.search('consulta')\nsigtap.byPrefix('0101')      // everything under that subgroup\nsigtap.findOccupation('225125')  // CBO\n```\n\n## Competence matters\n\nSIGTAP is republished every month and values change between competences. Pin\none whenever the result has to be reproducible:\n\n```ts\nsigtap.load('2026.08')   // pinned\nsigtap.latest()          // follows\n```\n\n## The code carries the hierarchy\n\n```\n0201010011\n||||||\n||||++-- organisation form (01)\n||++---- subgroup (01)\n++------ group (02, diagnostic procedures)\n```\n\nThat is why `byPrefix('02')`, `byPrefix('0201')` and `byPrefix('020101')`\nfilter by group, subgroup and organisation form without needing a join.\n\n## Money in cents\n\nValues are integer cents, not floats: summing floats over a billing batch\nloses money. Use `centsToAmount` to display:\n\n```ts\ncentsToAmount(procedure.ambulatoryValueCents)  // '2.20'\n```\n\n## Ages in months\n\nSIGTAP publishes age limits in months. Verified against the real data:\nneonatal screening ends at 11, transfontanellar puncture at 59, and tubal\nligation starts at 252, the 21 years Brazilian law requires. Source sentinels\n(`9999`, and `1571` for \"no upper limit\") become `null`.\n\nThe same holds for quantities: `9999` in maximum executions and days of stay\nis a sentinel and becomes `null`. Without that, a consumer could bill 9,999\ndays of inpatient stay for an outpatient exam.\n\n## Occupations are extended CBO\n\n`findOccupation` accepts six-character **alphanumeric** codes: beyond numeric\nCBO, SIGTAP adds entries such as `2231F9` (médico residente), `5151F1`\n(agente de combate às endemias) and `1312C1` (sanitarista) for occupations\nplain CBO does not number.\n\n## The source is FTP only\n\nEvery HTTP host DATASUS documents for SIGTAP refuses connections; anonymous\nFTP on `ftp2.datasus.gov.br` serves the monthly packages normally. The\npipeline lists the directory, picks the most recent competence (honouring\n`_v<timestamp>` republications) and downloads over FTP.\n\nTables are parsed as fixed width using **the layout SIGTAP itself publishes**\nnext to each file, so a column widened at the source is followed\nautomatically, and a layout that stops describing its file is detected rather\nthan producing shifted fields.\n\n## What is not included yet\n\nThe relationship tables (`rl_procedimento_*`: compatible CID, enabled\noccupations, modalities) and the long descriptions (`tb_descricao`, 17 MB) are\nnot published. See [`ROADMAP.md`](../../ROADMAP.md).\n\n## Environment\n\nNode 20+ through the default entry. For a client bundle use\n`@br-health-kit/sigtap/web`. See [`docs/browser.md`](../../docs/browser.md).\n\n## Provenance\n\nPublic data from the Ministério da Saúde (DATASUS), redistributed without\ncontent modification. Code under MIT.\n","readmeFilename":"README.md","_rev":"1-5abae80c24e5ee44249bff4a51a050a4"}