Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty field casued an error #44

Closed
Bugs5382 opened this issue Dec 20, 2023 · 2 comments
Closed

fix: empty field casued an error #44

Bugs5382 opened this issue Dec 20, 2023 · 2 comments
Assignees
Labels
Milestone

Comments

@Bugs5382
Copy link
Owner

When doing the unit testing for Bugs5382/node-hl7-server#21 there was an issue if the field was blank, it wasn't returning a "empty string"

const hl7_string: string = "MSH|^~\\&|||||20081231||ADT^A01^ADT_A01|12345||2.7\rEVN||20081231"

Caused an error:

async sendResponse (type: 'AA' | 'AR'): Promise<boolean> {
    try {
      this._ack = this._createAckMessage(type, this._message) // here because it could not find MSH 11.1 which in this string is empty
      this._socket.write(Buffer.from(`${VT}${this._ack.toString()}${FS}${CR}`))
    } catch (_e: any) {
      this._ack = this._createAEAckMessage()
      this._socket.write(Buffer.from(`${VT}${this._ack.toString()}${FS}${CR}`))
    }

    this._ackSent = true

    return this._ackSent
  }
@Bugs5382 Bugs5382 added the bug Something isn't working label Dec 20, 2023
@Bugs5382 Bugs5382 added this to the 1.0.0 milestone Dec 20, 2023
@Bugs5382 Bugs5382 self-assigned this Dec 20, 2023
Bugs5382 added a commit that referenced this issue Dec 21, 2023
* if the field is not found as an array, then we go ahead and return the same object

Fixes #44

Closes #44
Bugs5382 added a commit that referenced this issue Dec 21, 2023
* MSH.11.1 or MSH.11 must be defined for spec 2.7

Closes #44
Bugs5382 added a commit that referenced this issue Dec 21, 2023
* if the field is not found as an array, then we go ahead and return the same object

Fixes #44

Closes #44
Bugs5382 added a commit that referenced this issue Dec 21, 2023
* MSH.11.1 or MSH.11 must be defined for spec 2.7

Closes #44
Bugs5382 pushed a commit that referenced this issue Dec 21, 2023
# [1.0.0-beta.17](v1.0.0-beta.16...v1.0.0-beta.17) (2023-12-21)

### Bug Fixes

* end 2 end test fix ([59cd787](59cd787)), closes [#44](#44)
* field.ts fix ([6097a4c](6097a4c)), closes [#44](#44) [#44](#44)
@Bugs5382
Copy link
Owner Author

🎉 This issue has been resolved in version 1.0.0-beta.17 🎉

The release is available on:

Your semantic-release bot 📦🚀

Bugs5382 pushed a commit that referenced this issue Dec 24, 2023
# 1.0.0 (2023-12-24)

### Bug Fixes

* added in dataSep var ([9683a12](9683a12)), closes [#4](#4)
* empty was triggering ([5f2ee31](5f2ee31))
* end 2 end test fix ([59cd787](59cd787)), closes [#44](#44)
* field.ts fix ([6097a4c](6097a4c)), closes [#44](#44) [#44](#44)
* fix node-hl7-server build ([c7d2e5d](c7d2e5d))
* fix node-hl7-server build x2 ([5af0217](5af0217))
* fixed types ([270baba](270baba)), closes [#13](#13)
* get/set now accessible ([1b4d45d](1b4d45d)), closes [#29](#29)
* many MSH sends ([76410fd](76410fd))
* needed on client response ([659a64d](659a64d))
* package.json ([485cc86](485cc86))
* package.json x2 ([4572d45](4572d45))
* package.json x3 ([30edb4b](30edb4b))
* set now accessible via segment class ([116e7fe](116e7fe)), closes [#31](#31)

### Features

*  return Segment class ([f1d6831](f1d6831)), closes [#4](#4)
* .toFile() ([c38c4c5](c38c4c5)), closes [#16](#16)
* able to parse files ([8a20ff3](8a20ff3))
* add more documentation ([#50](#50)) ([dd63791](dd63791))
* added date into options ([7f1399a](7f1399a))
* added field class ([511c11c](511c11c)), closes [#4](#4)
* added parser within the client package ([20a4b71](20a4b71)), closes [#4](#4)
* added tls settings ([c76faed](c76faed)), closes [#20](#20)
* added tls settings ([bdb79de](bdb79de)), closes [#20](#20)
* added tls settings ([b57ec86](b57ec86)), closes [#20](#20)
* all specs ([4bdf8fd](4bdf8fd)), closes [#12](#12)
* basic client sends ([2fc1c83](2fc1c83)), closes [#15](#15)
* batch and message ([275ce6e](275ce6e))
* batch BHS and BTS ([41177bc](41177bc)), closes [#4](#4)
* batch message ([321efd4](321efd4)), closes [#4](#4)
* big blob of structure ([b293c5e](b293c5e)), closes [#1](#1)
* bulk changes ([43ab455](43ab455)), closes [#15](#15)
* client work ([fc863f6](fc863f6)), closes [#15](#15)
* client work x2 ([6dc84e3](6dc84e3)), closes [#15](#15)
* code not working, SOS sent ([3d328b0](3d328b0)), closes [#4](#4)
* documentation updates ([de3e81a](de3e81a)), closes [#4](#4)
* expanded client connection code ([999223b](999223b)), closes [#15](#15)
* **experiential:** contains typescript specs for MSH ([fb06663](fb06663)), closes [#4](#4)
* **experiential:** fully typescript checked ([662ebd8](662ebd8)), closes [#4](#4)
* **experiential:** fully typescript checked x2 ([823b2c9](823b2c9)), closes [#4](#4)
* **experiential:** fully typescript checked x3 ([98826e3](98826e3)), closes [#4](#4)
* **experiential:** internal code helpers ([4a54b08](4a54b08)), closes [#4](#4)
* **experiential:** merge in base ([41cc9a5](41cc9a5)), closes [#4](#4)
* **experiential:** merge in base 'message' ([23cb56d](23cb56d)), closes [#4](#4)
* **experiential:** new design method ([45c3f87](45c3f87))
* **experiential:** new design method x2 ([a8d0bec](a8d0bec))
* **experiential:** new design method x3 ([87ddc8a](87ddc8a))
* **experiential:** new design method x4 ([8c2cc05](8c2cc05))
* **experiential:** nodeBase and utils ([7274bf0](7274bf0)), closes [#4](#4)
* **experiential:** re-doing the code ([fc3bbfd](fc3bbfd)), closes [#4](#4)
* **experiential:** some unit tests passing ([8154324](8154324)), closes [#4](#4)
* **experiential:** unit test failing, but showing promising results ([8a5a53e](8a5a53e))
* **experiential:** updated package ([12fa609](12fa609)), closes [#4](#4)
* feat: added .js ([e01b378](e01b378))
* feat: isFile and isBatch ([89b4a03](89b4a03)), closes [#18](#18)
* file batch ([30a32ef](30a32ef)), closes [#16](#16)
* file batch x2 ([edaf6e6](edaf6e6)), closes [#16](#16)
* file saves ([9ba059e](9ba059e)), closes [#16](#16)
* initial client class structure ([9e505db](9e505db)), closes [#4](#4)
* issue with sent header is fixed ([aea29a4](aea29a4))
* **lint:** lint fails the unit testing ([a8ff707](a8ff707)), closes [#4](#4)
* **lint:** messages is the only thing left ([723be98](723be98)), closes [#4](#4)
* **lint:** most of lint complete ([fe4038c](fe4038c)), closes [#4](#4)
* **lint:** most of lint complete x2 ([eadf478](eadf478)), closes [#4](#4)
* message added to batch ([85ef77b](85ef77b)), closes [#4](#4)
* message queue ([5a1bb26](5a1bb26)), closes [#21](#21) [#15](#15)
* message read working ([8d3c3f7](8d3c3f7)), closes [#4](#4)
* MSH, BHS, and FHS ([02dd239](02dd239))
* **parser:** batch processing ([5105171](5105171)), closes [#4](#4)
* **parser:** fix _subComponentSplit (^) ([e564107](e564107)), closes [#4](#4)
* ParserPlan ([22b7f83](22b7f83)), closes [#4](#4)
* **parser:** segment generation ([8492db5](8492db5)), closes [#4](#4)
* **parser:** working unit tests now ([4eb5bdd](4eb5bdd)), closes [#4](#4)
* reading file is no issue ([c966d26](c966d26))
* remove these from typedoc/main file ([441484f](441484f)), closes [#4](#4)
* restructure // unit tests ([a41b547](a41b547)), closes [#4](#4)
* revert typescript package ([e874cf0](e874cf0)), closes [#4](#4)
* storing segments results ([f58b0b4](f58b0b4)), closes [#4](#4)
* tls working ([80fa3f7](80fa3f7)), closes [#20](#20)
* tls working ([82a207c](82a207c)), closes [#20](#20)
* tls working ([87969f3](87969f3)), closes [#20](#20)
* unit testing ([65f09a1](65f09a1)), closes [#4](#4)
* unit tests ([cb8d30d](cb8d30d)), closes [#15](#15)
* unit tests pass ([a262172](a262172)), closes [#4](#4)
* update client options checks ([8ba99e8](8ba99e8)), closes [#4](#4)
* update file batch options ([9561962](9561962))
* update packages ([3b81b02](3b81b02))
* updated packages // formatting/style ([6f66891](6f66891)), closes [#4](#4)
* updates to the code to make it cleaner ([631026a](631026a)), closes [#15](#15)
* v1.0.0  ([#52](#52)) ([8fdcc2e](8fdcc2e))
@Bugs5382
Copy link
Owner Author

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant