fastify-hl7 2.2.0 → 3.0.0
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.
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ If you are using this NPM package, please consider giving it a :star: star.
|
|
|
9
9
|
This will increase its visibility and solicit more contribution from the outside.
|
|
10
10
|
|
|
11
11
|
This documentation is how to use this plugin, not on how to use the libraries above.
|
|
12
|
-
Head [here](#external-libraries) if you need help with those.
|
|
12
|
+
Head [here](#external-libraries-options) if you need help with those.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ Head [here](#external-libraries) if you need help with those.
|
|
|
19
19
|
2. [Client Quick Start](#client-quick-start)
|
|
20
20
|
3. [Full Documentation](#full-documentation)
|
|
21
21
|
1. [This Library Options](#this-library-options)
|
|
22
|
-
2. [External Libraries](#external-libraries)
|
|
22
|
+
2. [External Libraries Options](#external-libraries-options)
|
|
23
23
|
4. [Acknowledgements](#acknowledgements)
|
|
24
24
|
5. [License](#license)
|
|
25
25
|
|
|
@@ -97,19 +97,17 @@ await client.sendMessage(message)
|
|
|
97
97
|
|
|
98
98
|
If this is not set, enableServer will be set to ```true```. You need to set this to ```false``` will turn off the server capabilities.
|
|
99
99
|
|
|
100
|
-
|
|
101
100
|
### ```serverOptions```
|
|
102
101
|
|
|
103
102
|
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.
|
|
104
103
|
This could be enabling IPv4 or IPv6 and other server options including TLS. Since you cannot set this after run time, it has to be set during registration.
|
|
105
104
|
|
|
106
|
-
### External Libraries
|
|
105
|
+
### External Libraries Options
|
|
107
106
|
|
|
108
107
|
* [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.
|
|
109
108
|
* [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.
|
|
110
109
|
|
|
111
|
-
Please review the
|
|
112
|
-
A far as this plugin for Fastify, there are no options to pass.
|
|
110
|
+
Please review the libraries for more complete documentation.
|
|
113
111
|
|
|
114
112
|
## Acknowledgements
|
|
115
113
|
|
|
@@ -44,7 +44,7 @@ class HL7Client {
|
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Build a HL7 Batch
|
|
47
|
-
|
|
47
|
+
*@remarks Create a properly formatted HL7 Batch.
|
|
48
48
|
* @since 1.0.0
|
|
49
49
|
* @param props
|
|
50
50
|
*/
|
|
@@ -56,7 +56,7 @@ class HL7Client {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Build Date
|
|
59
|
-
|
|
59
|
+
*@remarks Build a date string based off HL7 Standards
|
|
60
60
|
* @since 2.1.0
|
|
61
61
|
* @param date
|
|
62
62
|
* @param length Options are 8, 12, or 14 (default)
|
|
@@ -66,7 +66,7 @@ class HL7Client {
|
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Build a HL7 File Batch
|
|
69
|
-
|
|
69
|
+
*@remarks Create a properly formatted HL7 File Batch.
|
|
70
70
|
* @since 1.0.0
|
|
71
71
|
* @param props
|
|
72
72
|
*/
|
|
@@ -78,7 +78,7 @@ class HL7Client {
|
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Build a HL7 Message
|
|
81
|
-
|
|
81
|
+
*@remarks Create a properly formatted HL7 message.
|
|
82
82
|
* @since 1.0.0
|
|
83
83
|
* @param props
|
|
84
84
|
*/
|
|
@@ -120,7 +120,7 @@ class HL7Client {
|
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Create an HL7 Outbound Connection
|
|
123
|
-
|
|
123
|
+
*@remarks Connect to an HL7 Server/Broker
|
|
124
124
|
* @since 1.0.0
|
|
125
125
|
* @param name The name stored within created client connections.
|
|
126
126
|
* @param props
|
|
@@ -178,7 +178,7 @@ class HL7Client {
|
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
180
|
* Process a HL7
|
|
181
|
-
|
|
181
|
+
*@remarks A HL7 message that could either be a Message (MSH) or Batch (BHS)
|
|
182
182
|
* @since 1.0.0
|
|
183
183
|
* @param text Raw HL& String
|
|
184
184
|
*/
|
|
@@ -192,7 +192,7 @@ class HL7Client {
|
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
194
|
* Read File
|
|
195
|
-
|
|
195
|
+
*@remarks Pass the correct path of the file you want to read.
|
|
196
196
|
* @since 1.0.0
|
|
197
197
|
* @param fullFilePath
|
|
198
198
|
* @returns FileBatch
|
|
@@ -206,7 +206,7 @@ class HL7Client {
|
|
|
206
206
|
}
|
|
207
207
|
/**
|
|
208
208
|
* Read a File Buffer
|
|
209
|
-
|
|
209
|
+
*@remarks Translate an already Buffered HL7 FHS segment to decode it.
|
|
210
210
|
* @since 1.0.0
|
|
211
211
|
* @param fileBuffer
|
|
212
212
|
* @returns FileBatch
|
|
@@ -10,14 +10,14 @@ export declare class HL7Client {
|
|
|
10
10
|
closeAll(): Promise<boolean>;
|
|
11
11
|
/**
|
|
12
12
|
* Build a HL7 Batch
|
|
13
|
-
|
|
13
|
+
*@remarks Create a properly formatted HL7 Batch.
|
|
14
14
|
* @since 1.0.0
|
|
15
15
|
* @param props
|
|
16
16
|
*/
|
|
17
17
|
buildBatch(props?: ClientBuilderOptions): Batch;
|
|
18
18
|
/**
|
|
19
19
|
* Build Date
|
|
20
|
-
|
|
20
|
+
*@remarks Build a date string based off HL7 Standards
|
|
21
21
|
* @since 2.1.0
|
|
22
22
|
* @param date
|
|
23
23
|
* @param length Options are 8, 12, or 14 (default)
|
|
@@ -25,14 +25,14 @@ export declare class HL7Client {
|
|
|
25
25
|
buildDate(date: Date, length?: string): string;
|
|
26
26
|
/**
|
|
27
27
|
* Build a HL7 File Batch
|
|
28
|
-
|
|
28
|
+
*@remarks Create a properly formatted HL7 File Batch.
|
|
29
29
|
* @since 1.0.0
|
|
30
30
|
* @param props
|
|
31
31
|
*/
|
|
32
32
|
buildFileBatch(props?: ClientBuilderFileOptions): FileBatch;
|
|
33
33
|
/**
|
|
34
34
|
* Build a HL7 Message
|
|
35
|
-
|
|
35
|
+
*@remarks Create a properly formatted HL7 message.
|
|
36
36
|
* @since 1.0.0
|
|
37
37
|
* @param props
|
|
38
38
|
*/
|
|
@@ -45,7 +45,7 @@ export declare class HL7Client {
|
|
|
45
45
|
createClient(name: string, props: ClientOptions): Client;
|
|
46
46
|
/**
|
|
47
47
|
* Create an HL7 Outbound Connection
|
|
48
|
-
|
|
48
|
+
*@remarks Connect to an HL7 Server/Broker
|
|
49
49
|
* @since 1.0.0
|
|
50
50
|
* @param name The name stored within created client connections.
|
|
51
51
|
* @param props
|
|
@@ -66,14 +66,14 @@ export declare class HL7Client {
|
|
|
66
66
|
getClientConnectionByPort(port: string): Connection | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* Process a HL7
|
|
69
|
-
|
|
69
|
+
*@remarks A HL7 message that could either be a Message (MSH) or Batch (BHS)
|
|
70
70
|
* @since 1.0.0
|
|
71
71
|
* @param text Raw HL& String
|
|
72
72
|
*/
|
|
73
73
|
processHL7(text: string): Message | Batch;
|
|
74
74
|
/**
|
|
75
75
|
* Read File
|
|
76
|
-
|
|
76
|
+
*@remarks Pass the correct path of the file you want to read.
|
|
77
77
|
* @since 1.0.0
|
|
78
78
|
* @param fullFilePath
|
|
79
79
|
* @returns FileBatch
|
|
@@ -85,7 +85,7 @@ export declare class HL7Client {
|
|
|
85
85
|
readFile(fullFilePath: string): FileBatch;
|
|
86
86
|
/**
|
|
87
87
|
* Read a File Buffer
|
|
88
|
-
|
|
88
|
+
*@remarks Translate an already Buffered HL7 FHS segment to decode it.
|
|
89
89
|
* @since 1.0.0
|
|
90
90
|
* @param fileBuffer
|
|
91
91
|
* @returns FileBatch
|
|
@@ -18,7 +18,7 @@ export class HL7Client {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Build a HL7 Batch
|
|
21
|
-
|
|
21
|
+
*@remarks Create a properly formatted HL7 Batch.
|
|
22
22
|
* @since 1.0.0
|
|
23
23
|
* @param props
|
|
24
24
|
*/
|
|
@@ -30,7 +30,7 @@ export class HL7Client {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Build Date
|
|
33
|
-
|
|
33
|
+
*@remarks Build a date string based off HL7 Standards
|
|
34
34
|
* @since 2.1.0
|
|
35
35
|
* @param date
|
|
36
36
|
* @param length Options are 8, 12, or 14 (default)
|
|
@@ -40,7 +40,7 @@ export class HL7Client {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Build a HL7 File Batch
|
|
43
|
-
|
|
43
|
+
*@remarks Create a properly formatted HL7 File Batch.
|
|
44
44
|
* @since 1.0.0
|
|
45
45
|
* @param props
|
|
46
46
|
*/
|
|
@@ -52,7 +52,7 @@ export class HL7Client {
|
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Build a HL7 Message
|
|
55
|
-
|
|
55
|
+
*@remarks Create a properly formatted HL7 message.
|
|
56
56
|
* @since 1.0.0
|
|
57
57
|
* @param props
|
|
58
58
|
*/
|
|
@@ -94,7 +94,7 @@ export class HL7Client {
|
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Create an HL7 Outbound Connection
|
|
97
|
-
|
|
97
|
+
*@remarks Connect to an HL7 Server/Broker
|
|
98
98
|
* @since 1.0.0
|
|
99
99
|
* @param name The name stored within created client connections.
|
|
100
100
|
* @param props
|
|
@@ -152,7 +152,7 @@ export class HL7Client {
|
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* Process a HL7
|
|
155
|
-
|
|
155
|
+
*@remarks A HL7 message that could either be a Message (MSH) or Batch (BHS)
|
|
156
156
|
* @since 1.0.0
|
|
157
157
|
* @param text Raw HL& String
|
|
158
158
|
*/
|
|
@@ -166,7 +166,7 @@ export class HL7Client {
|
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
168
|
* Read File
|
|
169
|
-
|
|
169
|
+
*@remarks Pass the correct path of the file you want to read.
|
|
170
170
|
* @since 1.0.0
|
|
171
171
|
* @param fullFilePath
|
|
172
172
|
* @returns FileBatch
|
|
@@ -180,7 +180,7 @@ export class HL7Client {
|
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* Read a File Buffer
|
|
183
|
-
|
|
183
|
+
*@remarks Translate an already Buffered HL7 FHS segment to decode it.
|
|
184
184
|
* @since 1.0.0
|
|
185
185
|
* @param fileBuffer
|
|
186
186
|
* @returns FileBatch
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -25,14 +25,14 @@ declare module 'fastify' {
|
|
|
25
25
|
* @since 1.0.0 */
|
|
26
26
|
closeServerAll: () => Promise<boolean>;
|
|
27
27
|
/** Create Client
|
|
28
|
-
|
|
28
|
+
*@remarks Connecting to a remote server/broker that accepts connections.
|
|
29
29
|
* @since 1.0.0 */
|
|
30
30
|
createClient: (name: string, props: ClientOptions) => Client;
|
|
31
31
|
/** Create an incoming port connection on the server.
|
|
32
32
|
* @since 1.0.0 */
|
|
33
33
|
createInbound: (name: string, props: ListenerOptions, handler: InboundHandler) => Inbound;
|
|
34
34
|
/** Create Outgoing Client Port
|
|
35
|
-
|
|
35
|
+
*@remarks This is on the established client that we are already a part off.
|
|
36
36
|
* @since 1.0.0 */
|
|
37
37
|
createConnection: (name: string, props: ClientListenerOptions, handler: OutboundHandler) => Connection;
|
|
38
38
|
/** Get Client (Outbound) connection by name.
|
|
@@ -59,7 +59,7 @@ declare module 'fastify' {
|
|
|
59
59
|
}
|
|
60
60
|
interface FastifyInstance {
|
|
61
61
|
/** Main Decorator for Fastify
|
|
62
|
-
|
|
62
|
+
*@remarks hl7 is the decorator that everything hangs off.
|
|
63
63
|
* @since 1.0.0 **/
|
|
64
64
|
hl7: HL7;
|
|
65
65
|
}
|
|
@@ -10,14 +10,14 @@ export declare class HL7Client {
|
|
|
10
10
|
closeAll(): Promise<boolean>;
|
|
11
11
|
/**
|
|
12
12
|
* Build a HL7 Batch
|
|
13
|
-
|
|
13
|
+
*@remarks Create a properly formatted HL7 Batch.
|
|
14
14
|
* @since 1.0.0
|
|
15
15
|
* @param props
|
|
16
16
|
*/
|
|
17
17
|
buildBatch(props?: ClientBuilderOptions): Batch;
|
|
18
18
|
/**
|
|
19
19
|
* Build Date
|
|
20
|
-
|
|
20
|
+
*@remarks Build a date string based off HL7 Standards
|
|
21
21
|
* @since 2.1.0
|
|
22
22
|
* @param date
|
|
23
23
|
* @param length Options are 8, 12, or 14 (default)
|
|
@@ -25,14 +25,14 @@ export declare class HL7Client {
|
|
|
25
25
|
buildDate(date: Date, length?: string): string;
|
|
26
26
|
/**
|
|
27
27
|
* Build a HL7 File Batch
|
|
28
|
-
|
|
28
|
+
*@remarks Create a properly formatted HL7 File Batch.
|
|
29
29
|
* @since 1.0.0
|
|
30
30
|
* @param props
|
|
31
31
|
*/
|
|
32
32
|
buildFileBatch(props?: ClientBuilderFileOptions): FileBatch;
|
|
33
33
|
/**
|
|
34
34
|
* Build a HL7 Message
|
|
35
|
-
|
|
35
|
+
*@remarks Create a properly formatted HL7 message.
|
|
36
36
|
* @since 1.0.0
|
|
37
37
|
* @param props
|
|
38
38
|
*/
|
|
@@ -45,7 +45,7 @@ export declare class HL7Client {
|
|
|
45
45
|
createClient(name: string, props: ClientOptions): Client;
|
|
46
46
|
/**
|
|
47
47
|
* Create an HL7 Outbound Connection
|
|
48
|
-
|
|
48
|
+
*@remarks Connect to an HL7 Server/Broker
|
|
49
49
|
* @since 1.0.0
|
|
50
50
|
* @param name The name stored within created client connections.
|
|
51
51
|
* @param props
|
|
@@ -66,14 +66,14 @@ export declare class HL7Client {
|
|
|
66
66
|
getClientConnectionByPort(port: string): Connection | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* Process a HL7
|
|
69
|
-
|
|
69
|
+
*@remarks A HL7 message that could either be a Message (MSH) or Batch (BHS)
|
|
70
70
|
* @since 1.0.0
|
|
71
71
|
* @param text Raw HL& String
|
|
72
72
|
*/
|
|
73
73
|
processHL7(text: string): Message | Batch;
|
|
74
74
|
/**
|
|
75
75
|
* Read File
|
|
76
|
-
|
|
76
|
+
*@remarks Pass the correct path of the file you want to read.
|
|
77
77
|
* @since 1.0.0
|
|
78
78
|
* @param fullFilePath
|
|
79
79
|
* @returns FileBatch
|
|
@@ -85,7 +85,7 @@ export declare class HL7Client {
|
|
|
85
85
|
readFile(fullFilePath: string): FileBatch;
|
|
86
86
|
/**
|
|
87
87
|
* Read a File Buffer
|
|
88
|
-
|
|
88
|
+
*@remarks Translate an already Buffered HL7 FHS segment to decode it.
|
|
89
89
|
* @since 1.0.0
|
|
90
90
|
* @param fileBuffer
|
|
91
91
|
* @returns FileBatch
|
package/lib/types/types.d.ts
CHANGED
|
@@ -25,14 +25,14 @@ declare module 'fastify' {
|
|
|
25
25
|
* @since 1.0.0 */
|
|
26
26
|
closeServerAll: () => Promise<boolean>;
|
|
27
27
|
/** Create Client
|
|
28
|
-
|
|
28
|
+
*@remarks Connecting to a remote server/broker that accepts connections.
|
|
29
29
|
* @since 1.0.0 */
|
|
30
30
|
createClient: (name: string, props: ClientOptions) => Client;
|
|
31
31
|
/** Create an incoming port connection on the server.
|
|
32
32
|
* @since 1.0.0 */
|
|
33
33
|
createInbound: (name: string, props: ListenerOptions, handler: InboundHandler) => Inbound;
|
|
34
34
|
/** Create Outgoing Client Port
|
|
35
|
-
|
|
35
|
+
*@remarks This is on the established client that we are already a part off.
|
|
36
36
|
* @since 1.0.0 */
|
|
37
37
|
createConnection: (name: string, props: ClientListenerOptions, handler: OutboundHandler) => Connection;
|
|
38
38
|
/** Get Client (Outbound) connection by name.
|
|
@@ -59,7 +59,7 @@ declare module 'fastify' {
|
|
|
59
59
|
}
|
|
60
60
|
interface FastifyInstance {
|
|
61
61
|
/** Main Decorator for Fastify
|
|
62
|
-
|
|
62
|
+
*@remarks hl7 is the decorator that everything hangs off.
|
|
63
63
|
* @since 1.0.0 **/
|
|
64
64
|
hl7: HL7;
|
|
65
65
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastify-hl7",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A Fastify HL7 Plugin Developed in Pure TypeScript.",
|
|
5
5
|
"module": "./lib/esm/index.js",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"lib/"
|
|
18
18
|
],
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=20.
|
|
20
|
+
"node": ">=20.15.0"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"clean": "rm -rf lib coverage docs",
|
|
@@ -58,36 +58,37 @@
|
|
|
58
58
|
"homepage": "https://github.com/Bugs5382/fastify-hl7#readme",
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@fastify/error": "^4.0.0",
|
|
61
|
-
"fastify-plugin": "^
|
|
62
|
-
"node-hl7-client": "^2.3.
|
|
63
|
-
"node-hl7-server": "^
|
|
61
|
+
"fastify-plugin": "^5.0.1",
|
|
62
|
+
"node-hl7-client": "^2.3.1",
|
|
63
|
+
"node-hl7-server": "^3.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@semantic-release/changelog": "^6.0.3",
|
|
67
|
-
"@semantic-release/commit-analyzer": "^
|
|
67
|
+
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
68
68
|
"@semantic-release/git": "^10.0.1",
|
|
69
|
-
"@semantic-release/release-notes-generator": "^
|
|
69
|
+
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
70
|
+
"@shipgirl/typedoc-plugin-versions": "^0.2.7",
|
|
70
71
|
"@the-rabbit-hole/semantic-release-config": "^1.5.0",
|
|
71
|
-
"@types/node": "^
|
|
72
|
+
"@types/node": "^22.8.6",
|
|
72
73
|
"@types/randomstring": "^1.3.0",
|
|
73
74
|
"@types/tcp-port-used": "^1.0.4",
|
|
74
|
-
"@typescript-eslint/parser": "^
|
|
75
|
-
"@vitest/coverage-v8": "^1.
|
|
76
|
-
"@vitest/ui": "^1.
|
|
77
|
-
"fastify": "^
|
|
78
|
-
"npm-check-updates": "^
|
|
75
|
+
"@typescript-eslint/parser": "^8.12.2",
|
|
76
|
+
"@vitest/coverage-v8": "^2.1.4",
|
|
77
|
+
"@vitest/ui": "^2.1.4",
|
|
78
|
+
"fastify": "^5.0.0",
|
|
79
|
+
"npm-check-updates": "^17.1.9",
|
|
79
80
|
"npm-package-json-lint": "^8.0.0",
|
|
80
81
|
"portfinder": "^1.0.32",
|
|
81
82
|
"pre-commit": "^1.2.2",
|
|
82
|
-
"semantic-release": "^
|
|
83
|
+
"semantic-release": "^24.2.0",
|
|
83
84
|
"snazzy": "^9.0.0",
|
|
84
85
|
"tcp-port-used": "^1.0.2",
|
|
85
86
|
"ts-node": "^10.9.2",
|
|
86
87
|
"ts-standard": "^12.0.2",
|
|
87
|
-
"tsd": "^0.31.
|
|
88
|
-
"typedoc": "^0.26.
|
|
89
|
-
"typescript": "^5.
|
|
90
|
-
"vitest": "^1.
|
|
88
|
+
"tsd": "^0.31.2",
|
|
89
|
+
"typedoc": "^0.26.10",
|
|
90
|
+
"typescript": "^5.6.3",
|
|
91
|
+
"vitest": "^2.1.4"
|
|
91
92
|
},
|
|
92
93
|
"precommit": [
|
|
93
94
|
"lint:fix",
|