@rethinkhealth/hl7v2-builder 0.2.16
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/LICENSE +21 -0
- package/README.md +121 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Rethink Health
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# HL7v2 Builder
|
|
2
|
+
|
|
3
|
+
`@rethinkhealth/hl7v2-builder` provides a tiny set of helpers for assembling HL7v2 abstract syntax trees that follow the [`@rethinkhealth/hl7v2-ast`](../hl7v2-ast/) schema. The helpers wrap [`unist-builder`](https://github.com/syntax-tree/unist-builder) so you can build trees with a couple of function calls instead of manually nesting nodes.
|
|
4
|
+
|
|
5
|
+
## Why it helps
|
|
6
|
+
|
|
7
|
+
- Work directly with typed nodes while avoiding the repetitive `u('node-type', …)` boilerplate from `unist-builder`.
|
|
8
|
+
- Describe complex segments declaratively without worrying about separator placement or empty components.
|
|
9
|
+
|
|
10
|
+
## Philosophy
|
|
11
|
+
|
|
12
|
+
- Stay explicit: you build the same AST shape you would by hand, so there is no hidden serialization logic or format guessing.
|
|
13
|
+
- Compose freely: each helper is a thin wrapper over `unist-builder`, making it easy to mix raw nodes and other utilities when needed.
|
|
14
|
+
- Keep things minimal: a small surface area means fewer abstractions to learn and less room for divergent interpretations of the HL7v2 model.
|
|
15
|
+
|
|
16
|
+
## Functions at a glance
|
|
17
|
+
|
|
18
|
+
- `m(...segments)` – build a `root` (i.e. message) node from any number of segments.
|
|
19
|
+
- `s(...fields)` – build a `segment` node from one or more `Field` nodes.
|
|
20
|
+
- `f(...values)` – build a `field` node from strings, components, repetitions, or arrays thereof.
|
|
21
|
+
- `r(...components)` – build a `field-repetition` node from strings or components.
|
|
22
|
+
- `c(...values)` – build a `component` node from strings or arrays of strings.
|
|
23
|
+
|
|
24
|
+
Each helper returns objects typed from `@rethinkhealth/hl7v2-ast`, so the resulting tree can be consumed by any package in the ecosystem (parsers, linters, etc.).
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
This package is ESM-only. In Node.js 18+ run one of:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @rethinkhealth/hl7v2-builder
|
|
32
|
+
# or
|
|
33
|
+
yarn add @rethinkhealth/hl7v2-builder
|
|
34
|
+
# or
|
|
35
|
+
pnpm add @rethinkhealth/hl7v2-builder
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { c, f, m, s } from '@rethinkhealth/hl7v2-builder';
|
|
42
|
+
|
|
43
|
+
const tree = m(
|
|
44
|
+
s(
|
|
45
|
+
f('MSH'), // include the segment header explicitly
|
|
46
|
+
f('^~\\&')
|
|
47
|
+
),
|
|
48
|
+
s(
|
|
49
|
+
f('PID'),
|
|
50
|
+
f(), // empty field
|
|
51
|
+
f([
|
|
52
|
+
c(['123456', 'DOE', 'JOHN']), // accept arrays or individual args interchangeably
|
|
53
|
+
])
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`tree` is now a `Root` node with two segments (`MSH`, `PID`). You can serialise it, transform it, or feed it into other HL7v2 utilities.
|
|
59
|
+
|
|
60
|
+
## API
|
|
61
|
+
|
|
62
|
+
### `m(...children: RootContent[]): Root`
|
|
63
|
+
|
|
64
|
+
- No arguments → empty root.
|
|
65
|
+
- Pass any number of `RootContent` nodes (segments, fragments, etc.); they are appended in order.
|
|
66
|
+
- Arguments are used as-is, so pass concrete AST nodes rather than nested arrays.
|
|
67
|
+
|
|
68
|
+
### `s(...fields: Field[]): Segment`
|
|
69
|
+
|
|
70
|
+
- No arguments → empty segment.
|
|
71
|
+
- Provide the header field yourself, typically with `f('PID')`, and include it as the first argument.
|
|
72
|
+
- Fields are appended in the order provided; the helper does not do any automatic flattening.
|
|
73
|
+
|
|
74
|
+
### `f(...values: Array<string | Component | FieldRepetition | Array<string | Component | FieldRepetition>>): Field`
|
|
75
|
+
|
|
76
|
+
- No arguments → empty field with a single empty repetition.
|
|
77
|
+
- Strings become components with a single subcomponent containing the value.
|
|
78
|
+
- `Component` instances are added directly.
|
|
79
|
+
- `FieldRepetition` instances are preserved and allow you to control repetitions explicitly.
|
|
80
|
+
- Arrays are flattened one level so you can pass a mixture of individual values and grouped lists.
|
|
81
|
+
- Sequences of strings/components are grouped into a single repetition unless you introduce a `FieldRepetition` explicitly.
|
|
82
|
+
|
|
83
|
+
### `r(...components: Array<string | Component | Array<string | Component>>): FieldRepetition`
|
|
84
|
+
|
|
85
|
+
- No arguments → repetition with an empty component.
|
|
86
|
+
- Strings become components with a single subcomponent containing the value.
|
|
87
|
+
- Components are inserted as-is.
|
|
88
|
+
- Arrays are flattened one level for convenience.
|
|
89
|
+
|
|
90
|
+
### `c(...values: Array<string | string[]>): Component`
|
|
91
|
+
|
|
92
|
+
- No arguments → component with an empty subcomponent.
|
|
93
|
+
- Strings become subcomponents.
|
|
94
|
+
- Arrays are flattened one level so you can pass `c('DOE', ['JOHN', 'Q'])`.
|
|
95
|
+
|
|
96
|
+
> **Note**
|
|
97
|
+
> These helpers are intentionally minimal. For advanced scenarios—multiple repetitions per field, custom metadata, or node reuse—you can still drop down to `unist-builder` (`u`) directly and mix those nodes with the helpers above.
|
|
98
|
+
|
|
99
|
+
## Contributing
|
|
100
|
+
|
|
101
|
+
We welcome contributions! Please see our [Contributing Guide][github-contributing] for more details.
|
|
102
|
+
|
|
103
|
+
1. Fork the repository
|
|
104
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
105
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
106
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
107
|
+
5. Open a Pull Request
|
|
108
|
+
|
|
109
|
+
## Code of Conduct
|
|
110
|
+
|
|
111
|
+
To ensure a welcoming and positive environment, we have a [Code of Conduct][github-code-of-conduct] that all contributors and participants are expected to adhere to.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
Copyright 2025 Rethink Health, SUARL. All rights reserved.
|
|
116
|
+
|
|
117
|
+
This program is licensed to you under the terms of the [MIT License](https://opensource.org/licenses/MIT). This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [LICENSE][github-license] file for details.
|
|
118
|
+
|
|
119
|
+
[github-code-of-conduct]: https://github.com/rethinkhealth/hl7v2/blob/main/CODE_OF_CONDUCT.md
|
|
120
|
+
[github-license]: https://github.com/rethinkhealth/hl7v2/blob/main/LICENSE
|
|
121
|
+
[github-contributing]: https://github.com/rethinkhealth/hl7v2/blob/main/CONTRIBUTING.md
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** biome-ignore-all lint/style/useUnifiedTypeSignatures: fine */
|
|
2
|
+
import type { Component, Field, FieldRepetition, Root, RootContent, Segment } from "@rethinkhealth/hl7v2-ast";
|
|
3
|
+
export declare function m(...children: RootContent[]): Root;
|
|
4
|
+
export declare function s(...fields: Field[]): Segment;
|
|
5
|
+
type FieldValue = FieldRepetition | Component | string;
|
|
6
|
+
type Flattenable<T> = T | T[];
|
|
7
|
+
/** Empty field */
|
|
8
|
+
export declare function f(): Field;
|
|
9
|
+
export declare function f(...values: Flattenable<FieldValue>[]): Field;
|
|
10
|
+
export declare function r(): FieldRepetition;
|
|
11
|
+
export declare function r(...components: Flattenable<Component | string>[]): FieldRepetition;
|
|
12
|
+
export declare function c(): Component;
|
|
13
|
+
export declare function c(...values: Flattenable<string>[]): Component;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,KAAK,EACV,SAAS,EACT,KAAK,EACL,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACR,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,CAAC,CAAC,GAAG,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAElD;AAED,wBAAgB,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAE7C;AAED,KAAK,UAAU,GAAG,eAAe,GAAG,SAAS,GAAG,MAAM,CAAC;AACvD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAoB9B,kBAAkB;AAClB,wBAAgB,CAAC,IAAI,KAAK,CAAC;AAC3B,wBAAgB,CAAC,CAAC,GAAG,MAAM,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,GAAG,KAAK,CAAC;AA2C/D,wBAAgB,CAAC,IAAI,eAAe,CAAC;AACrC,wBAAgB,CAAC,CACf,GAAG,UAAU,EAAE,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,EAAE,GAC/C,eAAe,CAAC;AAmBnB,wBAAgB,CAAC,IAAI,SAAS,CAAC;AAC/B,wBAAgB,CAAC,CAAC,GAAG,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { u } from "unist-builder";
|
|
3
|
+
function m(...children) {
|
|
4
|
+
return u("root", children);
|
|
5
|
+
}
|
|
6
|
+
function s(...fields) {
|
|
7
|
+
return u("segment", fields);
|
|
8
|
+
}
|
|
9
|
+
function flatten(values) {
|
|
10
|
+
return values.flatMap((value) => Array.isArray(value) ? value : [value]);
|
|
11
|
+
}
|
|
12
|
+
function isFieldRepetition(value) {
|
|
13
|
+
return typeof value === "object" && value !== null && value.type === "field-repetition";
|
|
14
|
+
}
|
|
15
|
+
function isComponent(value) {
|
|
16
|
+
return typeof value === "object" && value !== null && value.type === "component";
|
|
17
|
+
}
|
|
18
|
+
function f(...values) {
|
|
19
|
+
if (values.length === 0) {
|
|
20
|
+
return u("field", [r()]);
|
|
21
|
+
}
|
|
22
|
+
const flat = flatten(values);
|
|
23
|
+
if (flat.length === 0) {
|
|
24
|
+
return u("field", [r()]);
|
|
25
|
+
}
|
|
26
|
+
const repetitions = [];
|
|
27
|
+
let pendingComponents = [];
|
|
28
|
+
const flushPending = () => {
|
|
29
|
+
if (pendingComponents.length === 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
repetitions.push(r(...pendingComponents));
|
|
33
|
+
pendingComponents = [];
|
|
34
|
+
};
|
|
35
|
+
for (const value of flat) {
|
|
36
|
+
if (isFieldRepetition(value)) {
|
|
37
|
+
flushPending();
|
|
38
|
+
repetitions.push(value);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (isComponent(value) || typeof value === "string") {
|
|
42
|
+
pendingComponents.push(value);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
flushPending();
|
|
46
|
+
if (repetitions.length === 0) {
|
|
47
|
+
return u("field", [r()]);
|
|
48
|
+
}
|
|
49
|
+
return u("field", repetitions);
|
|
50
|
+
}
|
|
51
|
+
function r(...components) {
|
|
52
|
+
if (components.length === 0) {
|
|
53
|
+
return u("field-repetition", [c()]);
|
|
54
|
+
}
|
|
55
|
+
const flat = flatten(components);
|
|
56
|
+
if (flat.length === 0) {
|
|
57
|
+
return u("field-repetition", [c()]);
|
|
58
|
+
}
|
|
59
|
+
return u(
|
|
60
|
+
"field-repetition",
|
|
61
|
+
flat.map((value) => typeof value === "string" ? c(value) : value)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function c(...values) {
|
|
65
|
+
if (values.length === 0) {
|
|
66
|
+
return u("component", [u("subcomponent", "")]);
|
|
67
|
+
}
|
|
68
|
+
const flat = flatten(values);
|
|
69
|
+
if (flat.length === 0) {
|
|
70
|
+
return u("component", [u("subcomponent", "")]);
|
|
71
|
+
}
|
|
72
|
+
return u(
|
|
73
|
+
"component",
|
|
74
|
+
flat.map((subcomponent) => u("subcomponent", subcomponent))
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
c,
|
|
79
|
+
f,
|
|
80
|
+
m,
|
|
81
|
+
r,
|
|
82
|
+
s
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/** biome-ignore-all lint/style/useUnifiedTypeSignatures: fine */\nimport type {\n Component,\n Field,\n FieldRepetition,\n Root,\n RootContent,\n Segment,\n} from \"@rethinkhealth/hl7v2-ast\";\nimport { u } from \"unist-builder\";\n\nexport function m(...children: RootContent[]): Root {\n return u(\"root\", children);\n}\n\nexport function s(...fields: Field[]): Segment {\n return u(\"segment\", fields);\n}\n\ntype FieldValue = FieldRepetition | Component | string;\ntype Flattenable<T> = T | T[];\n\nfunction flatten<T>(values: Flattenable<T>[]): T[] {\n return values.flatMap((value) => (Array.isArray(value) ? value : [value]));\n}\n\nfunction isFieldRepetition(value: FieldValue): value is FieldRepetition {\n return (\n typeof value === \"object\" &&\n value !== null &&\n value.type === \"field-repetition\"\n );\n}\n\nfunction isComponent(value: FieldValue): value is Component {\n return (\n typeof value === \"object\" && value !== null && value.type === \"component\"\n );\n}\n\n/** Empty field */\nexport function f(): Field;\nexport function f(...values: Flattenable<FieldValue>[]): Field;\nexport function f(...values: Flattenable<FieldValue>[]): Field {\n if (values.length === 0) {\n return u(\"field\", [r()]);\n }\n\n const flat = flatten<FieldValue>(values);\n if (flat.length === 0) {\n return u(\"field\", [r()]);\n }\n\n const repetitions: FieldRepetition[] = [];\n let pendingComponents: Array<Component | string> = [];\n\n const flushPending = () => {\n if (pendingComponents.length === 0) {\n return;\n }\n repetitions.push(r(...pendingComponents));\n pendingComponents = [];\n };\n\n for (const value of flat) {\n if (isFieldRepetition(value)) {\n flushPending();\n repetitions.push(value);\n continue;\n }\n\n if (isComponent(value) || typeof value === \"string\") {\n pendingComponents.push(value);\n }\n }\n\n flushPending();\n\n if (repetitions.length === 0) {\n return u(\"field\", [r()]);\n }\n\n return u(\"field\", repetitions);\n}\n\nexport function r(): FieldRepetition;\nexport function r(\n ...components: Flattenable<Component | string>[]\n): FieldRepetition;\nexport function r(\n ...components: Flattenable<Component | string>[]\n): FieldRepetition {\n if (components.length === 0) {\n return u(\"field-repetition\", [c()]);\n }\n\n const flat = flatten<Component | string>(components);\n if (flat.length === 0) {\n return u(\"field-repetition\", [c()]);\n }\n\n return u(\n \"field-repetition\",\n flat.map((value) => (typeof value === \"string\" ? c(value) : value))\n );\n}\n\nexport function c(): Component;\nexport function c(...values: Flattenable<string>[]): Component;\nexport function c(...values: Flattenable<string>[]): Component {\n if (values.length === 0) {\n return u(\"component\", [u(\"subcomponent\", \"\")]);\n }\n\n const flat = flatten<string>(values);\n if (flat.length === 0) {\n return u(\"component\", [u(\"subcomponent\", \"\")]);\n }\n\n return u(\n \"component\",\n flat.map((subcomponent) => u(\"subcomponent\", subcomponent))\n );\n}\n"],"mappings":";AASA,SAAS,SAAS;AAEX,SAAS,KAAK,UAA+B;AAClD,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,SAAS,KAAK,QAA0B;AAC7C,SAAO,EAAE,WAAW,MAAM;AAC5B;AAKA,SAAS,QAAW,QAA+B;AACjD,SAAO,OAAO,QAAQ,CAAC,UAAW,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAE;AAC3E;AAEA,SAAS,kBAAkB,OAA6C;AACtE,SACE,OAAO,UAAU,YACjB,UAAU,QACV,MAAM,SAAS;AAEnB;AAEA,SAAS,YAAY,OAAuC;AAC1D,SACE,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,SAAS;AAElE;AAKO,SAAS,KAAK,QAA0C;AAC7D,MAAI,OAAO,WAAW,GAAG;AACvB,WAAO,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAAA,EACzB;AAEA,QAAM,OAAO,QAAoB,MAAM;AACvC,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAAA,EACzB;AAEA,QAAM,cAAiC,CAAC;AACxC,MAAI,oBAA+C,CAAC;AAEpD,QAAM,eAAe,MAAM;AACzB,QAAI,kBAAkB,WAAW,GAAG;AAClC;AAAA,IACF;AACA,gBAAY,KAAK,EAAE,GAAG,iBAAiB,CAAC;AACxC,wBAAoB,CAAC;AAAA,EACvB;AAEA,aAAW,SAAS,MAAM;AACxB,QAAI,kBAAkB,KAAK,GAAG;AAC5B,mBAAa;AACb,kBAAY,KAAK,KAAK;AACtB;AAAA,IACF;AAEA,QAAI,YAAY,KAAK,KAAK,OAAO,UAAU,UAAU;AACnD,wBAAkB,KAAK,KAAK;AAAA,IAC9B;AAAA,EACF;AAEA,eAAa;AAEb,MAAI,YAAY,WAAW,GAAG;AAC5B,WAAO,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AAAA,EACzB;AAEA,SAAO,EAAE,SAAS,WAAW;AAC/B;AAMO,SAAS,KACX,YACc;AACjB,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO,EAAE,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAAA,EACpC;AAEA,QAAM,OAAO,QAA4B,UAAU;AACnD,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO,EAAE,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAAA,EACpC;AAEA,SAAO;AAAA,IACL;AAAA,IACA,KAAK,IAAI,CAAC,UAAW,OAAO,UAAU,WAAW,EAAE,KAAK,IAAI,KAAM;AAAA,EACpE;AACF;AAIO,SAAS,KAAK,QAA0C;AAC7D,MAAI,OAAO,WAAW,GAAG;AACvB,WAAO,EAAE,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAAA,EAC/C;AAEA,QAAM,OAAO,QAAgB,MAAM;AACnC,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO,EAAE,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAAA,EAC/C;AAEA,SAAO;AAAA,IACL;AAAA,IACA,KAAK,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,YAAY,CAAC;AAAA,EAC5D;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rethinkhealth/hl7v2-builder",
|
|
3
|
+
"description": "Build HL7v2 AST nodes",
|
|
4
|
+
"version": "0.2.16",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Melek Somai",
|
|
8
|
+
"email": "melek@rethinkhealth.io"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"unist-builder": "4.0.0",
|
|
20
|
+
"@rethinkhealth/hl7v2-ast": "0.2.16"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "24.5.2",
|
|
24
|
+
"@types/unist": "^3.0.3",
|
|
25
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
26
|
+
"tsup": "8.5.0",
|
|
27
|
+
"typescript": "^5.8.3",
|
|
28
|
+
"unified": "^11.0.5",
|
|
29
|
+
"vitest": "^3.2.4",
|
|
30
|
+
"@rethinkhealth/testing": "0.0.1",
|
|
31
|
+
"@rethinkhealth/tsconfig": "0.0.1",
|
|
32
|
+
"@rethinkhealth/hl7v2-to-hl7v2": "0.2.16"
|
|
33
|
+
},
|
|
34
|
+
"repository": "rethinkhealth/hl7v2.git",
|
|
35
|
+
"homepage": "https://www.rethinkhealth.io/hl7v2/docs",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"health",
|
|
38
|
+
"healthcare",
|
|
39
|
+
"hl7",
|
|
40
|
+
"hl7v2",
|
|
41
|
+
"nodejs",
|
|
42
|
+
"typescript"
|
|
43
|
+
],
|
|
44
|
+
"packageManager": "pnpm@10.14.0",
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsup && tsc --emitDeclarationOnly",
|
|
50
|
+
"check-types": "tsc --noEmit",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:coverage": "vitest run --coverage",
|
|
53
|
+
"test:watch": "vitest"
|
|
54
|
+
}
|
|
55
|
+
}
|