Skip to content

Commit

Permalink
fix: needed on client response
Browse files Browse the repository at this point in the history
* TCP/MLLP protocol
  • Loading branch information
Bugs5382 committed Dec 20, 2023
1 parent 7606453 commit 659a64d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client/hl7Outbound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,14 @@ export class HL7Outbound extends EventEmitter {

socket.on('data', (buffer: Buffer) => {
this._awaitingResponse = false
const response = new InboundResponse(buffer.toString())
this._handler(response)
let loadedMessage = buffer.toString().replace(VT, '')
// is there is F5 and CR in this message?
if (loadedMessage.includes(FS + CR)) {
// strip them out
loadedMessage = loadedMessage.replace(FS + CR, '')
const response = new InboundResponse(loadedMessage)
this._handler(response)
}
})

socket.on('end', () => {
Expand Down

0 comments on commit 659a64d

Please sign in to comment.