-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* yay!
- Loading branch information
Showing
32 changed files
with
1,433 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
jest.config.ts | ||
release.config.js | ||
/__tests__/**/* | ||
release.config.cjs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,4 @@ package-lock.json | |
|
||
# Webstorm | ||
.idea | ||
lib |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"rules": { | ||
"require-author": "error", | ||
"require-description": "error", | ||
"require-engines": "error", | ||
"require-license": "error", | ||
"require-name": "error", | ||
"require-repository": "error", | ||
"require-version": "error", | ||
"require-bugs": "error", | ||
"require-homepage": "error", | ||
"require-keywords": "error", | ||
"bin-type": "error", | ||
"config-type": "error", | ||
"description-type": "error", | ||
"devDependencies-type": "error", | ||
"directories-type": "error", | ||
"engines-type": "error", | ||
"files-type": "error", | ||
"homepage-type": "error", | ||
"keywords-type": "error", | ||
"license-type": "error", | ||
"main-type": "error", | ||
"man-type": "error", | ||
"name-type": "error", | ||
"preferGlobal-type": "error", | ||
"private-type": "error", | ||
"repository-type": "error", | ||
"scripts-type": "error", | ||
"version-type": "error", | ||
"valid-values-author": ["error", [ | ||
"Shane Froebel" | ||
]], | ||
"valid-values-private": ["error", [ | ||
false | ||
]], | ||
"no-restricted-dependencies": ["error", [ | ||
"gulping-npm-package-json-lint" | ||
]], | ||
"no-restricted-pre-release-dependencies": ["error", [ | ||
"gulping-npm-package-json-lint" | ||
]], | ||
"no-restricted-devDependencies": ["error", [ | ||
"gulping-npm-package-json-lint" | ||
]], | ||
"no-restricted-pre-release-devDependencies": ["error", [ | ||
"gulping-npm-package-json-lint" | ||
]], | ||
"name-format": "error", | ||
"version-format": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# [1.0.0-beta.2](https://github.com/Bugs5382/fastify-hl7/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2023-12-30) | ||
|
||
|
||
### Features | ||
|
||
* added functions that get ([c68830e](https://github.com/Bugs5382/fastify-hl7/commit/c68830ed6397d1bb71ad6a7720e92eaafca8e2ce)) | ||
* added functions that get ([#3](https://github.com/Bugs5382/fastify-hl7/issues/3)) ([d94ea96](https://github.com/Bugs5382/fastify-hl7/commit/d94ea96c63726c8b6e79d52df1fb48414b1e1138)) | ||
|
||
# 1.0.0-beta.1 (2023-12-29) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* removed .npmignore ([bd788da](https://github.com/Bugs5382/fastify-hl7/commit/bd788dad661f7f4e271458d5b633280a9d561fef)) | ||
|
||
|
||
### Features | ||
|
||
* added in ([3c340d5](https://github.com/Bugs5382/fastify-hl7/commit/3c340d59ac2861bbf58c90acb28615914410b3ca)) | ||
* buildMessage, publishMessage ([fc1d7db](https://github.com/Bugs5382/fastify-hl7/commit/fc1d7db9968030247c518817ce5a6c8f231fa91d)) | ||
* client stuff done ([bd6cb46](https://github.com/Bugs5382/fastify-hl7/commit/bd6cb464ad45833b0c3df2623db22ff5737a36ba)) | ||
* develop branch for release ([28c5f30](https://github.com/Bugs5382/fastify-hl7/commit/28c5f30f01a88cbec9b04b37b1aadf7ed959a369)) | ||
* first working version ([f9d3ffd](https://github.com/Bugs5382/fastify-hl7/commit/f9d3ffd660c9802778adb9732d6e3587be109139)) | ||
* fixed client connections ([c421328](https://github.com/Bugs5382/fastify-hl7/commit/c4213281c43f8ee7655f4e6c88cf0d0ad15e8d3b)) | ||
* full example ([7c36b2d](https://github.com/Bugs5382/fastify-hl7/commit/7c36b2d02c65a05050ec44889f8745a2c61ede62)) | ||
* initial build ([36b35d9](https://github.com/Bugs5382/fastify-hl7/commit/36b35d904231507b6a6004bda4a5f07c2d224233)) | ||
* new design, again. ([2113ca3](https://github.com/Bugs5382/fastify-hl7/commit/2113ca3183d91a085791a067e2af6fc69d305aba)) | ||
* registration working ([6f54019](https://github.com/Bugs5382/fastify-hl7/commit/6f54019a66aa5c24ec1d7ce3130475ef6b602426)) | ||
* release branch for release ([c85e0be](https://github.com/Bugs5382/fastify-hl7/commit/c85e0bec4fbb6019d460e0b5743292e58097cb41)) | ||
* standardized project ([dec9a8b](https://github.com/Bugs5382/fastify-hl7/commit/dec9a8b35af1ab60bb44c709e02472911788e99f)) | ||
* standardized project ([#1](https://github.com/Bugs5382/fastify-hl7/issues/1)) ([42b973f](https://github.com/Bugs5382/fastify-hl7/commit/42b973f1680c5dcce0296cd7fb1a11b80dc9920c)) | ||
* update server signatures ([d1fc0da](https://github.com/Bugs5382/fastify-hl7/commit/d1fc0dad4c3ca5dbfa40b4850cd092f43a82e3d8)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# Fastify HL7 | ||
|
||
A Fastify Hl7 Plugin Developed in Pure TypeScript. | ||
It uses the [node-hl7-client](https://github.com/Bugs5382/node-hl7-client) and [node-hl7-server](https://github.com/Bugs5382/node-hl7-server) plugin as a wrapper. | ||
|
||
The build exports this to valid ESM and CJS for ease of cross-compatibility. | ||
|
||
If you are using this NPM package, please consider giving it a :star: star. | ||
This will increase its visibility and solicit more contribution from the outside. | ||
|
||
This documentation is how to use this plugin, not on how to use the libraries above. | ||
Head [here](#external-libraries) if you need help with those. | ||
|
||
## Table of Contents | ||
|
||
1. [Install](#install) | ||
2. [Basic Usage](#basic-usage) | ||
1. [Server Quick Start](#server-quick-start) | ||
2. [Client Quick Start](#client-quick-start) | ||
3. [Full Documentation](#full-documentation) | ||
1. [This Library Options](#this-library-options) | ||
2. [External Libraries](#external-libraries) | ||
4. [Acknowledgements](#acknowledgements) | ||
5. [License](#license) | ||
|
||
## Install | ||
|
||
``` | ||
npm install fastify-hl7 | ||
``` | ||
|
||
## Basic Usage | ||
|
||
Register this as a plugin. | ||
|
||
```ts | ||
await fastify.register(fastifyHL7) | ||
``` | ||
|
||
### Server Quick Start | ||
|
||
```ts | ||
const listener = fastify.hl7.createInbound( | ||
'ib_adt', | ||
{port: 3001}, | ||
async (req, res) => { | ||
const messageReq = req.getMessage() | ||
const messageType = req.getType() | ||
// your logic here | ||
await res.sendResponse('AA') | ||
}) | ||
``` | ||
This will create a inbound connection. You can optionally return it to a variable to attach advanced listeners. | ||
|
||
### Client Quick Start | ||
|
||
```ts | ||
import fastify from "fastify"; | ||
|
||
fastify.hl7.createClient('localhost', {host: '0.0.0.0'}) | ||
``` | ||
|
||
This will create a "client" class that will then allow you to attach different outbound connections. | ||
The name ```localhost``` in a unique identifier to this host, so it can be used to attach different outbound connections to this server/broker. | ||
|
||
There might be times when your HL7 messages need to cross-over to different hosts/server/inbound endpoints and this is how you would get them. | ||
|
||
Within your code now you can use the fastify context and access the ```hl7``` decorator, | ||
and create an outbound connection. | ||
|
||
```ts | ||
const client = fastify.hl7.createOutbound( | ||
'ob_adt', | ||
{port: 3001}, | ||
async (res) => { | ||
const messageRes = res.getMessage() | ||
// Your code here. Either a failure or a success, but still do your work here. | ||
}) | ||
|
||
// building a HL7 Message Segment | ||
const message = app.hl7.buildMessage({ | ||
messageHeader: { | ||
msh_9_1: "ADT", | ||
msh_9_2: "A01", | ||
msh_11_1: "D", | ||
} | ||
}) | ||
|
||
await client.sendMessage(message) | ||
``` | ||
|
||
## Full Documentation | ||
|
||
### This Library Options | ||
|
||
### `enableServer` | ||
|
||
If this is not set, enableServer will be set to ```true```. You need to set this to ```false``` will turn off the server capabilities. | ||
|
||
|
||
### ```serverOptions``` | ||
|
||
Set this using the options from the [node-hl7-serer](https://github.com/Bugs5382/node-hl7-server/blob/main/README.md) library ServerOptions values to override server creation. | ||
This could be enabling IPv4 or IPv6 and other server options including TLS. SInce you can not set this after run time, it has to be set during registration. | ||
|
||
|
||
|
||
### External Libraries | ||
|
||
* [node-hl7-client](https://github.com/Bugs5382/node-hl7-client/blob/main/README.md) - For the Client, Parser, and Builder to review their options that can be passed as props. | ||
* [node-hl7-server](https://github.com/Bugs5382/node-hl7-server/blob/main/README.md) - For the Server to the options that can be passed as props. | ||
|
||
Please review the library for more complete documentation. | ||
A far as this plugin for Fastify, there are no options to pass. | ||
|
||
## Acknowledgements | ||
|
||
- My Wife and Baby Girl. | ||
|
||
## License | ||
|
||
Licensed under [MIT](./LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.