From 787dc1655004ee01ccdc99fe68b149cad5670f70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:29:51 +0000 Subject: [PATCH 1/3] chore(deps-dev): bump @typescript-eslint/parser from 6.21.0 to 7.0.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.21.0 to 7.0.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.0.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c560f7..d2d7f04 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@types/node": "^20.11.16", "@types/randomstring": "^1.1.11", "@types/tcp-port-used": "^1.0.4", - "@typescript-eslint/parser": "^6.20.0", + "@typescript-eslint/parser": "^7.0.1", "@vitest/coverage-v8": "^1.2.2", "@vitest/ui": "^1.2.2", "clean-publish": "^4.2.0", From 0b62522921c5e6c1439d4895cd6bf41dcf573d23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:46:48 +0000 Subject: [PATCH 2/3] chore(deps-dev): bump @typescript-eslint/parser from 6.21.0 to 7.0.2 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.21.0 to 7.0.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.0.2/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c560f7..89e0773 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@types/node": "^20.11.16", "@types/randomstring": "^1.1.11", "@types/tcp-port-used": "^1.0.4", - "@typescript-eslint/parser": "^6.20.0", + "@typescript-eslint/parser": "^7.0.2", "@vitest/coverage-v8": "^1.2.2", "@vitest/ui": "^1.2.2", "clean-publish": "^4.2.0", From 58e3573215fd4249625bb27fdf22ecac750cdc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CBugs5382=E2=80=9D?= Date: Thu, 22 Feb 2024 09:49:37 -0500 Subject: [PATCH 3/3] feat: added buildDate - updated deps at the same time - update ci --- .github/dependabot.yml | 1 + .github/workflows/ci.yaml | 4 ++-- package.json | 16 ++++++++-------- src/class/hL7Client.ts | 13 ++++++++++++- src/index.ts | 3 +++ src/types.ts | 4 ++++ 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8e7c591..aad6462 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,6 +2,7 @@ version: 2 updates: - package-ecosystem: npm directory: "/" + target-branch: 'develop' schedule: interval: daily time: "10:00" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ae0d901..b38db8e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,7 @@ jobs: matrix: node-version: [ 20.x, 'lts/*' ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Use Node.js ${{ matrix.node-version }} @@ -37,7 +37,7 @@ jobs: pull-requests: write id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false - name: Use Node.js diff --git a/package.json b/package.json index 89e0773..6b4a0a2 100644 --- a/package.json +++ b/package.json @@ -68,15 +68,15 @@ "@semantic-release/git": "^10.0.1", "@semantic-release/release-notes-generator": "^12.1.0", "@the-rabbit-hole/semantic-release-config": "^1.5.0", - "@types/node": "^20.11.16", + "@types/node": "^20.11.19", "@types/randomstring": "^1.1.11", "@types/tcp-port-used": "^1.0.4", "@typescript-eslint/parser": "^7.0.2", - "@vitest/coverage-v8": "^1.2.2", - "@vitest/ui": "^1.2.2", + "@vitest/coverage-v8": "^1.3.1", + "@vitest/ui": "^1.3.1", "clean-publish": "^4.2.0", - "fastify": "^4.26.0", - "npm-check-updates": "^16.14.14", + "fastify": "^4.26.1", + "npm-check-updates": "^16.14.15", "npm-package-json-lint": "^7.1.0", "portfinder": "^1.0.32", "pre-commit": "^1.2.2", @@ -85,10 +85,10 @@ "tcp-port-used": "^1.0.2", "ts-node": "^10.9.2", "ts-standard": "^12.0.2", - "tsd": "^0.30.4", - "typedoc": "^0.25.7", + "tsd": "^0.30.5", + "typedoc": "^0.25.8", "typescript": "^5.3.3", - "vitest": "^1.2.2" + "vitest": "^1.3.1" }, "precommit": [ "lint:fix", diff --git a/src/class/hL7Client.ts b/src/class/hL7Client.ts index f9b9854..32c4fa5 100644 --- a/src/class/hL7Client.ts +++ b/src/class/hL7Client.ts @@ -9,7 +9,7 @@ import Client, { Connection, isBatch, Message, - OutboundHandler + OutboundHandler, createHL7Date } from 'node-hl7-client' import { AClients } from '../decorate.js' import { errors } from '../errors.js' @@ -48,6 +48,17 @@ export class HL7Client { return new Batch({ ...props }) } + /** + * Build Date + * @description Build a date string based off HL7 Standards + * @since 2.1.0 + * @param date + * @param length Options are 8, 12, or 14 (default) + */ + buildDate (date: Date, length?: string): string { + return createHL7Date(date, length) + } + /** * Build a HL7 File Batch * @description Create a properly formatted HL7 File Batch. diff --git a/src/index.ts b/src/index.ts index edef76c..6e88929 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,6 +76,9 @@ const fastifyHL7 = fp(async (fastify, opts) => { buildBatch: function (props: ClientBuilderOptions | undefined): Batch { return client.buildBatch(props) }, + buildDate: function (date: Date, length?: string): string { + return client.buildDate(date, length) + }, buildFileBatch: function (props: ClientBuilderFileOptions | undefined): FileBatch { return client.buildFileBatch(props) }, diff --git a/src/types.ts b/src/types.ts index b7a3543..65293a1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,6 +17,10 @@ declare module 'fastify' { /** Build HL7 Batch * @since 1.0.0 */ buildBatch: (props?: ClientBuilderOptions) => Batch + /** BBuild Date + * @since 2.1.0 + */ + buildDate: (date: Date, length?: string) => string /** Build HL7 File Batch * @since 1.0.0 */ buildFileBatch: (props?: ClientBuilderFileOptions) => FileBatch