datasus 0.5.0 → 0.5.1

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 +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datasus",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Library with helpers for datasus",
5
5
  "type": "module",
6
6
  "repository": "blikblum/datasus",
package/src/bpa.js CHANGED
@@ -21,7 +21,7 @@ const getHeader = (
21
21
  origin,
22
22
  destination,
23
23
  appInfo,
24
- { lineCount, sheetCount, controlAccumulator },
24
+ { lineCount, sheetCount, controlAccumulator }
25
25
  ) => {
26
26
  const controlCode = controlAccumulator % 1111
27
27
  const header = [
@@ -109,9 +109,9 @@ const getIndividualEntry = (procedure, competence, origin, index) => {
109
109
  normalizeNumberText(patient.phone).padEnd(11, ' ').slice(0, 11),
110
110
  `${patient.email || ''}`.padEnd(40, ' ').slice(0, 40),
111
111
  padStartNumber(procedure.nationalId || TEN_BLANKS, 10, '0').slice(0, 10),
112
- procedure.cpf || ELEVEN_BLANKS,
112
+ patient.cpf || ELEVEN_BLANKS,
113
113
  ' ', // situação de rua
114
- procedure.cpf ? 'N' : 'S' // sem CPF
114
+ patient.cpf ? 'N' : 'S', // sem CPF
115
115
  ].join('')
116
116
 
117
117
  return entry
@@ -119,7 +119,7 @@ const getIndividualEntry = (procedure, competence, origin, index) => {
119
119
 
120
120
  export const generateBPA = (
121
121
  { procedures = [], origin = {}, destination = {}, competence = {}, appInfo = '' } = {},
122
- { consolidated = true, individual = true } = {},
122
+ { consolidated = true, individual = true } = {}
123
123
  ) => {
124
124
  const stats = { lineCount: 0, sheetCount: 0, controlAccumulator: 0 }
125
125