Skip to content

Commit

Permalink
fix: batch is BHS or two more MSH
Browse files Browse the repository at this point in the history
* change from > 0 to > 1
  • Loading branch information
Bugs5382 committed Jan 10, 2024
1 parent 795884d commit 574f83c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/hl7.build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ describe('node hl7 client - builder tests', () => {
msh_10: 'CONTROL_ID'
}
})
expect(isBatch(message.toString())).toBe(true)
expect(isBatch(message.toString())).toBe(false)
})

test('...isBatch -should be false', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const expBackoff = (step: number, high: number, attempts: number, exp = 2
* @param message
*/
export const isBatch = (message: string): boolean => {
const lines = split(message).filter(line => line.startsWith('MSH')).length > 0 || false
const lines = split(message).filter(line => line.startsWith('MSH')).length > 1 || false
return message.startsWith('BHS') || lines
}

Expand Down

0 comments on commit 574f83c

Please sign in to comment.