datasus 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/bpa.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datasus",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Library with helpers for datasus",
5
5
  "type": "module",
6
6
  "repository": "blikblum/datasus",
package/src/bpa.js CHANGED
@@ -95,8 +95,8 @@ const getIndividualEntry = (procedure, competence, origin, index) => {
95
95
  padStartNumber(patient.race || 99, 2, '0').slice(0, 2),
96
96
  `${patient.ethnicity || ''}`.padEnd(4, ' ').slice(0, 4),
97
97
  padStartNumber(patient.nationality || 10, 3, '0').slice(0, 3),
98
- THREE_BLANKS, // service code
99
- THREE_BLANKS, // classification code
98
+ `${procedure.serviceCode || THREE_BLANKS}`.padStart(3, '0').slice(0, 3), // service code
99
+ `${procedure.classification || THREE_BLANKS}`.padStart(3, '0').slice(0, 3), // classification code
100
100
  EIGHT_BLANKS, // sequence code
101
101
  ' '.repeat(4), // area code
102
102
  ' '.repeat(14), // maintainer cnpj