@rethinkhealth/hl7v2-ast 0.2.17 → 0.2.19

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.
Files changed (3) hide show
  1. package/README.md +3 -0
  2. package/index.d.ts +11 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -86,12 +86,15 @@ Root of an HL7v2 AST. Can represent a full message or a fragment.
86
86
  ```idl
87
87
  interface Segment <: Parent {
88
88
  type: 'segment'
89
+ name?: string
89
90
  children: [Field]
90
91
  }
91
92
  ```
92
93
 
93
94
  Represents an HL7v2 segment such as `MSH`, `PID`, or `OBX`.
94
95
 
96
+ The `name` property can be used to identify the segment without traversing the field hierarchy. When present, it contains the segment identifier (e.g., "MSH", "PID", "OBX").
97
+
95
98
  ### `Group`
96
99
 
97
100
  ```idl
package/index.d.ts CHANGED
@@ -180,6 +180,11 @@ export interface Segment extends Parent {
180
180
  * Node type of HL7v2 segment.
181
181
  */
182
182
  type: "segment";
183
+ /**
184
+ * Name identifier for the segment (e.g., "MSH", "PID", "OBX").
185
+ * Used for querying specific segments without traversing the field hierarchy.
186
+ */
187
+ name?: string | undefined;
183
188
  /**
184
189
  * Children of block quote.
185
190
  */
@@ -210,7 +215,12 @@ export interface Group extends Parent {
210
215
  */
211
216
  type: "group";
212
217
  /**
213
- * Children of block quote.
218
+ * Name identifier for the group (e.g., "ORDER", "OBSERVATION").
219
+ * Used for querying specific groups in nested structures.
220
+ */
221
+ name?: string | undefined;
222
+ /**
223
+ * Children of group.
214
224
  */
215
225
  children: Array<Segment | Group>;
216
226
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rethinkhealth/hl7v2-ast",
3
3
  "description": "HL7v2 is a specification for representing HL7v2 messages as an abstract syntax tree. It implements the unist spec.",
4
- "version": "0.2.17",
4
+ "version": "0.2.19",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Melek Somai",