@glion/builder 0.14.1

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 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,140 @@
1
+ # HL7v2 Builder
2
+
3
+ `@glion/builder` provides a tiny set of helpers for assembling HL7v2 abstract syntax trees that follow the [`@glion/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 `@glion/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 @glion/builder
32
+ # or
33
+ yarn add @glion/builder
34
+ # or
35
+ pnpm add @glion/builder
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```typescript
41
+ import { c, f, m, s } from "@glion/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
+ ### Experimental: Empty Mode
61
+
62
+ The builder respects the `emptyMode` experimental setting from `@glion/config`. When `emptyMode: "empty"` is configured in your `.hl7v2rc.json`, empty fields, repetitions, and components will have empty children arrays instead of the legacy full structure.
63
+
64
+ **Legacy mode (default):**
65
+
66
+ ```typescript
67
+ f(); // → Field → Rep → Comp → Sub("")
68
+ ```
69
+
70
+ **Empty mode (via config):**
71
+
72
+ ```typescript
73
+ // With .hl7v2rc.json: { "settings": { "experimental": { "emptyMode": "empty" } } }
74
+ f(); // → Field with children: []
75
+ ```
76
+
77
+ See [`@glion/config`](../hl7v2-config/) for configuration details.
78
+
79
+ ## API
80
+
81
+ ### `m(...children: RootContent[]): Root`
82
+
83
+ - No arguments → empty root.
84
+ - Pass any number of `RootContent` nodes (segments, fragments, etc.); they are appended in order.
85
+ - Arguments are used as-is, so pass concrete AST nodes rather than nested arrays.
86
+
87
+ ### `s(...fields: Field[]): Segment`
88
+
89
+ - No arguments → empty segment.
90
+ - Provide the header field yourself, typically with `f('PID')`, and include it as the first argument.
91
+ - Fields are appended in the order provided; the helper does not do any automatic flattening.
92
+
93
+ ### `f(...values: Array<string | Component | FieldRepetition | Array<string | Component | FieldRepetition>>): Field`
94
+
95
+ - No arguments → empty field with a single empty repetition.
96
+ - Strings become components with a single subcomponent containing the value.
97
+ - `Component` instances are added directly.
98
+ - `FieldRepetition` instances are preserved and allow you to control repetitions explicitly.
99
+ - Arrays are flattened one level so you can pass a mixture of individual values and grouped lists.
100
+ - Sequences of strings/components are grouped into a single repetition unless you introduce a `FieldRepetition` explicitly.
101
+
102
+ ### `r(...components: Array<string | Component | Array<string | Component>>): FieldRepetition`
103
+
104
+ - No arguments → repetition with an empty component.
105
+ - Strings become components with a single subcomponent containing the value.
106
+ - Components are inserted as-is.
107
+ - Arrays are flattened one level for convenience.
108
+
109
+ ### `c(...values: Array<string | string[]>): Component`
110
+
111
+ - No arguments → component with an empty subcomponent.
112
+ - Strings become subcomponents.
113
+ - Arrays are flattened one level so you can pass `c('DOE', ['JOHN', 'Q'])`.
114
+
115
+ > **Note**
116
+ > 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.
117
+
118
+ ## Contributing
119
+
120
+ We welcome contributions! Please see our [Contributing Guide][github-contributing] for more details.
121
+
122
+ 1. Fork the repository
123
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
124
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
125
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
126
+ 5. Open a Pull Request
127
+
128
+ ## Code of Conduct
129
+
130
+ 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.
131
+
132
+ ## License
133
+
134
+ Copyright 2025 Rethink Health, SUARL. All rights reserved.
135
+
136
+ 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.
137
+
138
+ [github-code-of-conduct]: https://github.com/rethinkhealth/glion/blob/main/CODE_OF_CONDUCT.md
139
+ [github-license]: https://github.com/rethinkhealth/glion/blob/main/LICENSE
140
+ [github-contributing]: https://github.com/rethinkhealth/glion/blob/main/CONTRIBUTING.md
@@ -0,0 +1,15 @@
1
+ import type { Component, Field, FieldRepetition, Group, Root, RootContent, Segment } from "@glion/ast";
2
+ export declare function m(...children: RootContent[]): Root;
3
+ export declare function g(name: string, ...children: (Segment | Group)[]): Group;
4
+ export declare function s(name: string, ...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":"AACA,OAAO,KAAK,EACV,SAAS,EACT,KAAK,EACL,eAAe,EACf,KAAK,EACL,IAAI,EACJ,WAAW,EACX,OAAO,EACR,MAAM,YAAY,CAAC;AAapB,wBAAgB,CAAC,CAAC,GAAG,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAElD;AAED,wBAAgB,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE,GAAG,KAAK,CAIvE;AAKD,wBAAgB,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAI3D;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;AAqD/D,wBAAgB,CAAC,IAAI,eAAe,CAAC;AACrC,wBAAgB,CAAC,CACf,GAAG,UAAU,EAAE,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,EAAE,GAC/C,eAAe,CAAC;AA6BnB,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,89 @@
1
+ import { loadConfig } from "@glion/config";
2
+ import { u } from "unist-builder";
3
+ //#region src/index.ts
4
+ /**
5
+ * Get the emptyMode setting from the configuration. Falls back to 'legacy' if
6
+ * no config is found or if the setting is not defined.
7
+ */
8
+ function getEmptyMode() {
9
+ return loadConfig().settings.experimental.emptyMode;
10
+ }
11
+ function m(...children) {
12
+ return u("root", children);
13
+ }
14
+ function g(name, ...children) {
15
+ const group = u("group", children);
16
+ group.name = name;
17
+ return group;
18
+ }
19
+ function s(name, ...fields) {
20
+ const segment = u("segment", fields);
21
+ segment.name = name;
22
+ return segment;
23
+ }
24
+ function flatten(values) {
25
+ return values.flatMap((value) => Array.isArray(value) ? value : [value]);
26
+ }
27
+ function isFieldRepetition(value) {
28
+ return typeof value === "object" && value !== null && value.type === "field-repetition";
29
+ }
30
+ function isComponent(value) {
31
+ return typeof value === "object" && value !== null && value.type === "component";
32
+ }
33
+ function f(...values) {
34
+ if (values.length === 0) {
35
+ if (getEmptyMode() === "empty") return u("field", []);
36
+ return u("field", [r()]);
37
+ }
38
+ const flat = flatten(values);
39
+ if (flat.length === 0) {
40
+ if (getEmptyMode() === "empty") return u("field", []);
41
+ return u("field", [r()]);
42
+ }
43
+ const repetitions = [];
44
+ let pendingComponents = [];
45
+ const flushPending = () => {
46
+ if (pendingComponents.length === 0) return;
47
+ repetitions.push(r(...pendingComponents));
48
+ pendingComponents = [];
49
+ };
50
+ for (const value of flat) {
51
+ if (isFieldRepetition(value)) {
52
+ flushPending();
53
+ repetitions.push(value);
54
+ continue;
55
+ }
56
+ if (isComponent(value) || typeof value === "string") pendingComponents.push(value);
57
+ }
58
+ flushPending();
59
+ if (repetitions.length === 0) return u("field", [r()]);
60
+ return u("field", repetitions);
61
+ }
62
+ function r(...components) {
63
+ if (components.length === 0) {
64
+ if (getEmptyMode() === "empty") return u("field-repetition", []);
65
+ return u("field-repetition", [c()]);
66
+ }
67
+ const flat = flatten(components);
68
+ if (flat.length === 0) {
69
+ if (getEmptyMode() === "empty") return u("field-repetition", []);
70
+ return u("field-repetition", [c()]);
71
+ }
72
+ return u("field-repetition", flat.map((value) => typeof value === "string" ? c(value) : value));
73
+ }
74
+ function c(...values) {
75
+ if (values.length === 0) {
76
+ if (getEmptyMode() === "empty") return u("component", []);
77
+ return u("component", [u("subcomponent", "")]);
78
+ }
79
+ const flat = flatten(values);
80
+ if (flat.length === 0) {
81
+ if (getEmptyMode() === "empty") return u("component", []);
82
+ return u("component", [u("subcomponent", "")]);
83
+ }
84
+ return u("component", flat.map((subcomponent) => u("subcomponent", subcomponent)));
85
+ }
86
+ //#endregion
87
+ export { c, f, g, m, r, s };
88
+
89
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// oxlint-disable typescript/unified-signatures\nimport type {\n Component,\n Field,\n FieldRepetition,\n Group,\n Root,\n RootContent,\n Segment,\n} from \"@glion/ast\";\nimport { loadConfig } from \"@glion/config\";\nimport { u } from \"unist-builder\";\n\n/**\n * Get the emptyMode setting from the configuration. Falls back to 'legacy' if\n * no config is found or if the setting is not defined.\n */\nfunction getEmptyMode() {\n const config = loadConfig();\n return config.settings.experimental.emptyMode;\n}\n\nexport function m(...children: RootContent[]): Root {\n return u(\"root\", children);\n}\n\nexport function g(name: string, ...children: (Segment | Group)[]): Group {\n const group = u(\"group\", children) as Group;\n group.name = name;\n return group;\n}\n\n// TODO: Add support for string[]\n// export function s(name: string, ...fields: string[]): Segment;\n// export function s(name: string, ...fields: string[] | Field[]): Segment {\nexport function s(name: string, ...fields: Field[]): Segment {\n const segment = u(\"segment\", fields) as Segment;\n segment.name = name;\n return segment;\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 // Empty field - check emptyMode from config\n const emptyMode = getEmptyMode();\n if (emptyMode === \"empty\") {\n return u(\"field\", []);\n }\n return u(\"field\", [r()]);\n }\n\n const flat = flatten<FieldValue>(values);\n if (flat.length === 0) {\n // Empty field - check emptyMode from config\n const emptyMode = getEmptyMode();\n if (emptyMode === \"empty\") {\n return u(\"field\", []);\n }\n return u(\"field\", [r()]);\n }\n\n const repetitions: FieldRepetition[] = [];\n let pendingComponents: (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 // Empty repetition - check emptyMode from config\n const emptyMode = getEmptyMode();\n if (emptyMode === \"empty\") {\n return u(\"field-repetition\", []);\n }\n return u(\"field-repetition\", [c()]);\n }\n\n const flat = flatten<Component | string>(components);\n if (flat.length === 0) {\n // Empty repetition - check emptyMode from config\n const emptyMode = getEmptyMode();\n if (emptyMode === \"empty\") {\n return u(\"field-repetition\", []);\n }\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 // Empty component - check emptyMode from config\n const emptyMode = getEmptyMode();\n if (emptyMode === \"empty\") {\n return u(\"component\", []);\n }\n return u(\"component\", [u(\"subcomponent\", \"\")]);\n }\n\n const flat = flatten<string>(values);\n if (flat.length === 0) {\n // Empty component - check emptyMode from config\n const emptyMode = getEmptyMode();\n if (emptyMode === \"empty\") {\n return u(\"component\", []);\n }\n return u(\"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1
+ {
2
+ "name": "@glion/builder",
3
+ "version": "0.14.1",
4
+ "description": "Build HL7v2 AST nodes",
5
+ "keywords": [
6
+ "health",
7
+ "healthcare",
8
+ "hl7",
9
+ "hl7v2",
10
+ "nodejs",
11
+ "typescript"
12
+ ],
13
+ "homepage": "https://glion.dev",
14
+ "license": "MIT",
15
+ "author": {
16
+ "name": "Melek Somai",
17
+ "email": "melek@rethinkhealth.io"
18
+ },
19
+ "repository": "rethinkhealth/glion.git",
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "type": "module",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": "./dist/index.js"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "dependencies": {
32
+ "unist-builder": "4.0.0",
33
+ "@glion/ast": "0.14.1",
34
+ "@glion/config": "0.14.1"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "^25.5.0",
38
+ "@types/unist": "^3.0.3",
39
+ "@vitest/coverage-v8": "4.1.2",
40
+ "tsdown": "0.21.7",
41
+ "typescript": "^5.9.3",
42
+ "unified": "^11.0.5",
43
+ "vitest": "4.1.2",
44
+ "@glion/testing": "0.0.2",
45
+ "@glion/tsconfig": "0.0.1"
46
+ },
47
+ "engines": {
48
+ "node": ">=18"
49
+ },
50
+ "scripts": {
51
+ "build": "tsdown && tsc --emitDeclarationOnly",
52
+ "check-types": "tsc --noEmit",
53
+ "test": "vitest run",
54
+ "test:coverage": "vitest run --coverage",
55
+ "test:watch": "vitest"
56
+ }
57
+ }