fastify-hl7 2.0.0 → 2.1.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.
@@ -113,6 +113,16 @@ var HL7Client = /** @class */ (function () {
113
113
  }
114
114
  return new node_hl7_client_1.Batch(__assign({}, props));
115
115
  };
116
+ /**
117
+ * Build Date
118
+ * @description Build a date string based off HL7 Standards
119
+ * @since 2.1.0
120
+ * @param date
121
+ * @param length Options are 8, 12, or 14 (default)
122
+ */
123
+ HL7Client.prototype.buildDate = function (date, length) {
124
+ return (0, node_hl7_client_1.createHL7Date)(date, length);
125
+ };
116
126
  /**
117
127
  * Build a HL7 File Batch
118
128
  * @description Create a properly formatted HL7 File Batch.
package/lib/cjs/index.js CHANGED
@@ -133,6 +133,9 @@ var fastifyHL7 = (0, fastify_plugin_1.default)(function (fastify, opts) { return
133
133
  buildBatch: function (props) {
134
134
  return client.buildBatch(props);
135
135
  },
136
+ buildDate: function (date, length) {
137
+ return client.buildDate(date, length);
138
+ },
136
139
  buildFileBatch: function (props) {
137
140
  return client.buildFileBatch(props);
138
141
  },
@@ -1,4 +1,4 @@
1
- import Client, { Batch, FileBatch, Connection, isBatch, Message } from 'node-hl7-client';
1
+ import Client, { Batch, FileBatch, Connection, isBatch, Message, createHL7Date } from 'node-hl7-client';
2
2
  import { errors } from '../errors.js';
3
3
  export class HL7Client {
4
4
  /** @internal */
@@ -30,6 +30,16 @@ export class HL7Client {
30
30
  }
31
31
  return new Batch({ ...props });
32
32
  }
33
+ /**
34
+ * Build Date
35
+ * @description Build a date string based off HL7 Standards
36
+ * @since 2.1.0
37
+ * @param date
38
+ * @param length Options are 8, 12, or 14 (default)
39
+ */
40
+ buildDate(date, length) {
41
+ return createHL7Date(date, length);
42
+ }
33
43
  /**
34
44
  * Build a HL7 File Batch
35
45
  * @description Create a properly formatted HL7 File Batch.
package/lib/esm/index.js CHANGED
@@ -55,6 +55,9 @@ const fastifyHL7 = fp(async (fastify, opts) => {
55
55
  buildBatch: function (props) {
56
56
  return client.buildBatch(props);
57
57
  },
58
+ buildDate: function (date, length) {
59
+ return client.buildDate(date, length);
60
+ },
58
61
  buildFileBatch: function (props) {
59
62
  return client.buildFileBatch(props);
60
63
  },
@@ -14,6 +14,14 @@ export declare class HL7Client {
14
14
  * @param props
15
15
  */
16
16
  buildBatch(props?: ClientBuilderOptions): Batch;
17
+ /**
18
+ * Build Date
19
+ * @description Build a date string based off HL7 Standards
20
+ * @since 2.1.0
21
+ * @param date
22
+ * @param length Options are 8, 12, or 14 (default)
23
+ */
24
+ buildDate(date: Date, length?: string): string;
17
25
  /**
18
26
  * Build a HL7 File Batch
19
27
  * @description Create a properly formatted HL7 File Batch.
@@ -9,6 +9,10 @@ declare module 'fastify' {
9
9
  /** Build HL7 Batch
10
10
  * @since 1.0.0 */
11
11
  buildBatch: (props?: ClientBuilderOptions) => Batch;
12
+ /** BBuild Date
13
+ * @since 2.1.0
14
+ */
15
+ buildDate: (date: Date, length?: string) => string;
12
16
  /** Build HL7 File Batch
13
17
  * @since 1.0.0 */
14
18
  buildFileBatch: (props?: ClientBuilderFileOptions) => FileBatch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify-hl7",
3
- "version": "2.0.0",
3
+ "version": "2.1.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",
@@ -68,15 +68,15 @@
68
68
  "@semantic-release/git": "^10.0.1",
69
69
  "@semantic-release/release-notes-generator": "^12.1.0",
70
70
  "@the-rabbit-hole/semantic-release-config": "^1.5.0",
71
- "@types/node": "^20.11.16",
71
+ "@types/node": "^20.11.19",
72
72
  "@types/randomstring": "^1.1.11",
73
73
  "@types/tcp-port-used": "^1.0.4",
74
- "@typescript-eslint/parser": "^6.20.0",
75
- "@vitest/coverage-v8": "^1.2.2",
76
- "@vitest/ui": "^1.2.2",
74
+ "@typescript-eslint/parser": "^7.0.2",
75
+ "@vitest/coverage-v8": "^1.3.1",
76
+ "@vitest/ui": "^1.3.1",
77
77
  "clean-publish": "^4.2.0",
78
- "fastify": "^4.26.0",
79
- "npm-check-updates": "^16.14.14",
78
+ "fastify": "^4.26.1",
79
+ "npm-check-updates": "^16.14.15",
80
80
  "npm-package-json-lint": "^7.1.0",
81
81
  "portfinder": "^1.0.32",
82
82
  "pre-commit": "^1.2.2",
@@ -85,10 +85,10 @@
85
85
  "tcp-port-used": "^1.0.2",
86
86
  "ts-node": "^10.9.2",
87
87
  "ts-standard": "^12.0.2",
88
- "tsd": "^0.30.4",
89
- "typedoc": "^0.25.7",
88
+ "tsd": "^0.30.5",
89
+ "typedoc": "^0.25.8",
90
90
  "typescript": "^5.3.3",
91
- "vitest": "^1.2.2"
91
+ "vitest": "^1.3.1"
92
92
  },
93
93
  "precommit": [
94
94
  "lint:fix",