@glion/annotate-profile-context 0.20.0 → 0.22.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAOzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC7C,uEAAuE;IACvE,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACnD,uEAAuE;IACvE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC7C,8DAA8D;IAC9D,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,OAAO;QACf,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;KACtC;CACF;AAUD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CA2B5D,CAAC;AA+IJ,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAOzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC7C,uEAAuE;IACvE,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACnD,uEAAuE;IACvE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC7C,8DAA8D;IAC9D,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,OAAO;QACf,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;KACtC;CACF;AAUD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CA2B5D,CAAC;AA0IJ,eAAe,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -94,24 +94,17 @@ function loadTables(fields, version) {
94
94
  * Returns an empty definition if the version is unknown.
95
95
  */
96
96
  async function loadSegments$1(version) {
97
- try {
98
- return await loadSegments(version);
99
- } catch {
100
- return { byId: /* @__PURE__ */ new Map() };
101
- }
97
+ return await loadSegments(version) ?? { byId: /* @__PURE__ */ new Map() };
102
98
  }
103
99
  /**
104
- * Load profiles in parallel. Unknown profiles (errors starting with "Unknown ")
105
- * are silently skipped. All other errors are also silently skipped per R4.
100
+ * Load profiles in parallel. A profile the version does not bundle is
101
+ * skipped; a profile that fails to load rejects.
106
102
  */
107
103
  async function resolveAll(ids, loader) {
108
104
  const entries = [...ids];
109
- const results = await Promise.allSettled(entries.map(loader));
105
+ const results = await Promise.all(entries.map(loader));
110
106
  const resolved = /* @__PURE__ */ new Map();
111
- for (let i = 0; i < results.length; i++) {
112
- const result = results[i];
113
- if (result.status === "fulfilled") resolved.set(entries[i], result.value);
114
- }
107
+ for (const [i, result] of results.entries()) if (result !== void 0) resolved.set(entries[i], result);
115
108
  return resolved;
116
109
  }
117
110
  /** Merge source map entries into target. */
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["loadSegments","loadSegmentDefinitions"],"sources":["../src/index.ts"],"sourcesContent":["import type { Root } from \"@glion/ast\";\nimport type {\n DatatypeDefinition,\n FieldDefinition,\n SegmentDefinition,\n TableDefinition,\n} from \"@glion/profiles\";\nimport {\n loadSegments as loadSegmentDefinitions,\n profiles,\n} from \"@glion/profiles\";\nimport { value } from \"@glion/util-query\";\nimport { visit } from \"@glion/util-visit\";\nimport type { Plugin } from \"unified\";\nimport type { VFile } from \"vfile\";\n\n/** Resolved profile data attached to `file.data.profile` by this plugin. */\nexport interface ProfileContext {\n /** HL7v2 version extracted from MSH-12.1. */\n version: string;\n /** Field definitions indexed by segment name (e.g., \"MSH\", \"PID\"). */\n fields: ReadonlyMap<string, FieldDefinition>;\n /** Datatype definitions indexed by datatype ID (e.g., \"ST\", \"CWE\"). */\n datatypes: ReadonlyMap<string, DatatypeDefinition>;\n /** Table definitions indexed by normalized table ID (e.g., \"0001\"). */\n tables: ReadonlyMap<string, TableDefinition>;\n /** Segment definitions with titles, indexed by segment ID. */\n segments: SegmentDefinition;\n}\n\ndeclare module \"vfile\" {\n interface DataMap {\n profile?: ProfileContext | undefined;\n }\n}\n\n/**\n * Strip the \"HL7\" prefix from table IDs in field profiles.\n * Field profiles reference tables as \"HL70001\"; the tables store uses \"0001\".\n */\nfunction normalizeTableId(tableRef: string): string {\n return tableRef.replace(/^HL7/, \"\");\n}\n\n/**\n * Unified plugin that loads HL7v2 profile data (fields, datatypes, tables)\n * and attaches them to `file.data` for downstream consumers.\n *\n * Extracts the HL7v2 version from MSH-12.1, then loads all relevant\n * field definitions, datatype definitions (with cascading resolution),\n * and table definitions in a single pass. Unknown profiles are silently\n * skipped.\n *\n * The plugin is idempotent — if `file.data.fields` is already populated,\n * it returns immediately without reloading.\n *\n * @example\n * ```typescript\n * import { unified } from \"unified\";\n * import { hl7v2Parser } from \"@glion/parser\";\n * import { hl7v2AnnotateProfileContext } from \"@glion/annotate-profile-context\";\n *\n * const processor = unified()\n * .use(hl7v2Parser)\n * .use(hl7v2AnnotateProfileContext);\n * ```;\n */\nexport const hl7v2AnnotateProfileContext: Plugin<[], Root, Root> =\n () => async (tree: Root, file: VFile) => {\n // Idempotency: skip if already populated\n if (file.data.profile) {\n return tree;\n }\n\n const version = value(tree, \"MSH-12.1\")?.value;\n if (!version) {\n return tree;\n }\n\n // Load fields and segments in parallel (segments don't depend on fields)\n const [fields, segments] = await Promise.all([\n loadFields(tree, version),\n loadSegments(version),\n ]);\n\n // Derive datatype + table definitions from fields in parallel\n const [datatypes, tables] = await Promise.all([\n loadDatatypes(fields, version),\n loadTables(fields, version),\n ]);\n\n file.data.profile = { datatypes, fields, segments, tables, version };\n\n return tree;\n };\n\n// ---------------------------------------------------------------------------\n// Field loading\n// ---------------------------------------------------------------------------\n\n/**\n * Collect unique segment names from the tree and load their field definitions.\n * Unknown segments (Z-segments, etc.) are silently omitted.\n */\nfunction loadFields(\n tree: Root,\n version: string\n): Promise<Map<string, FieldDefinition>> {\n const names = new Set<string>();\n visit(tree, \"segment\", (node) => {\n names.add(node.name);\n });\n\n return resolveAll(names, (name) => profiles.fields.load(version, name));\n}\n\n// ---------------------------------------------------------------------------\n// Datatype loading (cascading resolution)\n// ---------------------------------------------------------------------------\n\n/**\n * Load all datatype definitions referenced by field profiles, cascading\n * through composite datatypes to resolve component and subcomponent\n * datatypes (max 2 additional levels).\n */\n// oxlint-disable-next-line complexity/complexity -- cold-path profile loading: extracting the nested component scan regressed the cold-cache lint-profile bench 34% under CodSpeed, so it stays inline\nasync function loadDatatypes(\n fields: Map<string, FieldDefinition>,\n version: string\n): Promise<Map<string, DatatypeDefinition>> {\n const datatypes = new Map<string, DatatypeDefinition>();\n const load = (id: string) => profiles.datatypes.load(version, id);\n\n // Level 1: field-level datatypes\n const fieldDatatypeIds = new Set<string>();\n for (const def of fields.values()) {\n for (const field of def.bySequence.values()) {\n fieldDatatypeIds.add(field.datatype);\n }\n }\n merge(datatypes, await resolveAll(fieldDatatypeIds, load));\n\n // Levels 2-3: component and subcomponent datatypes\n for (let depth = 0; depth < 2; depth++) {\n const childIds = new Set<string>();\n for (const dtDef of datatypes.values()) {\n if (dtDef.kind !== \"composite\") {\n continue;\n }\n for (const comp of dtDef.componentsBySequence.values()) {\n if (!datatypes.has(comp.datatypeId)) {\n childIds.add(comp.datatypeId);\n }\n }\n }\n if (childIds.size === 0) {\n break;\n }\n merge(datatypes, await resolveAll(childIds, load));\n }\n\n return datatypes;\n}\n\n// ---------------------------------------------------------------------------\n// Table loading\n// ---------------------------------------------------------------------------\n\n/**\n * Load all table definitions referenced by field profiles.\n * Table IDs are normalized by stripping the \"HL7\" prefix.\n */\nfunction loadTables(\n fields: Map<string, FieldDefinition>,\n version: string\n): Promise<Map<string, TableDefinition>> {\n const tableIds = new Set<string>();\n for (const def of fields.values()) {\n for (const field of def.bySequence.values()) {\n if (field.table) {\n tableIds.add(normalizeTableId(field.table));\n }\n }\n }\n\n return resolveAll(tableIds, (id) => profiles.tables.load(version, id));\n}\n\n// ---------------------------------------------------------------------------\n// Segment loading\n// ---------------------------------------------------------------------------\n\n/**\n * Load all segment definitions for a version.\n * Returns an empty definition if the version is unknown.\n */\nasync function loadSegments(version: string): Promise<SegmentDefinition> {\n try {\n return await loadSegmentDefinitions(version);\n } catch {\n return { byId: new Map() };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Load profiles in parallel. Unknown profiles (errors starting with \"Unknown \")\n * are silently skipped. All other errors are also silently skipped per R4.\n */\nasync function resolveAll<T>(\n ids: Set<string>,\n loader: (id: string) => Promise<T>\n): Promise<Map<string, T>> {\n const entries = [...ids];\n const results = await Promise.allSettled(entries.map(loader));\n const resolved = new Map<string, T>();\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i]!;\n if (result.status === \"fulfilled\") {\n resolved.set(entries[i]!, result.value);\n }\n }\n\n return resolved;\n}\n\n/** Merge source map entries into target. */\nfunction merge<K, V>(target: Map<K, V>, source: Map<K, V>): void {\n for (const [key, val] of source) {\n target.set(key, val);\n }\n}\n\nexport default hl7v2AnnotateProfileContext;\n"],"mappings":";;;;;;;;AAwCA,SAAS,iBAAiB,UAA0B;AAClD,QAAO,SAAS,QAAQ,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;AA0BrC,MAAa,oCACL,OAAO,MAAY,SAAgB;AAEvC,KAAI,KAAK,KAAK,QACZ,QAAO;CAGT,MAAM,UAAU,MAAM,MAAM,WAAW,EAAE;AACzC,KAAI,CAAC,QACH,QAAO;CAIT,MAAM,CAAC,QAAQ,YAAY,MAAM,QAAQ,IAAI,CAC3C,WAAW,MAAM,QAAQ,EACzBA,eAAa,QAAQ,CACtB,CAAC;CAGF,MAAM,CAAC,WAAW,UAAU,MAAM,QAAQ,IAAI,CAC5C,cAAc,QAAQ,QAAQ,EAC9B,WAAW,QAAQ,QAAQ,CAC5B,CAAC;AAEF,MAAK,KAAK,UAAU;EAAE;EAAW;EAAQ;EAAU;EAAQ;EAAS;AAEpE,QAAO;;;;;;AAWX,SAAS,WACP,MACA,SACuC;CACvC,MAAM,wBAAQ,IAAI,KAAa;AAC/B,OAAM,MAAM,YAAY,SAAS;AAC/B,QAAM,IAAI,KAAK,KAAK;GACpB;AAEF,QAAO,WAAW,QAAQ,SAAS,SAAS,OAAO,KAAK,SAAS,KAAK,CAAC;;;;;;;AAazE,eAAe,cACb,QACA,SAC0C;CAC1C,MAAM,4BAAY,IAAI,KAAiC;CACvD,MAAM,QAAQ,OAAe,SAAS,UAAU,KAAK,SAAS,GAAG;CAGjE,MAAM,mCAAmB,IAAI,KAAa;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AAQ,IAAK,OAAO,MAAM;;AAI3C,QAAO;;;AAIT,SAAS,MAAY,QAAmB,QAAyB;AAC/D,MAAK,MAAM,CAAC,KAAK,QAAQ,OACvB,QAAO,IAAI,KAAK,IAAI"}
1
+ {"version":3,"file":"index.js","names":["loadSegments","loadSegmentDefinitions"],"sources":["../src/index.ts"],"sourcesContent":["import type { Root } from \"@glion/ast\";\nimport type {\n DatatypeDefinition,\n FieldDefinition,\n SegmentDefinition,\n TableDefinition,\n} from \"@glion/profiles\";\nimport {\n loadSegments as loadSegmentDefinitions,\n profiles,\n} from \"@glion/profiles\";\nimport { value } from \"@glion/util-query\";\nimport { visit } from \"@glion/util-visit\";\nimport type { Plugin } from \"unified\";\nimport type { VFile } from \"vfile\";\n\n/** Resolved profile data attached to `file.data.profile` by this plugin. */\nexport interface ProfileContext {\n /** HL7v2 version extracted from MSH-12.1. */\n version: string;\n /** Field definitions indexed by segment name (e.g., \"MSH\", \"PID\"). */\n fields: ReadonlyMap<string, FieldDefinition>;\n /** Datatype definitions indexed by datatype ID (e.g., \"ST\", \"CWE\"). */\n datatypes: ReadonlyMap<string, DatatypeDefinition>;\n /** Table definitions indexed by normalized table ID (e.g., \"0001\"). */\n tables: ReadonlyMap<string, TableDefinition>;\n /** Segment definitions with titles, indexed by segment ID. */\n segments: SegmentDefinition;\n}\n\ndeclare module \"vfile\" {\n interface DataMap {\n profile?: ProfileContext | undefined;\n }\n}\n\n/**\n * Strip the \"HL7\" prefix from table IDs in field profiles.\n * Field profiles reference tables as \"HL70001\"; the tables store uses \"0001\".\n */\nfunction normalizeTableId(tableRef: string): string {\n return tableRef.replace(/^HL7/, \"\");\n}\n\n/**\n * Unified plugin that loads HL7v2 profile data (fields, datatypes, tables)\n * and attaches them to `file.data` for downstream consumers.\n *\n * Extracts the HL7v2 version from MSH-12.1, then loads all relevant\n * field definitions, datatype definitions (with cascading resolution),\n * and table definitions in a single pass. Unknown profiles are silently\n * skipped.\n *\n * The plugin is idempotent — if `file.data.fields` is already populated,\n * it returns immediately without reloading.\n *\n * @example\n * ```typescript\n * import { unified } from \"unified\";\n * import { hl7v2Parser } from \"@glion/parser\";\n * import { hl7v2AnnotateProfileContext } from \"@glion/annotate-profile-context\";\n *\n * const processor = unified()\n * .use(hl7v2Parser)\n * .use(hl7v2AnnotateProfileContext);\n * ```;\n */\nexport const hl7v2AnnotateProfileContext: Plugin<[], Root, Root> =\n () => async (tree: Root, file: VFile) => {\n // Idempotency: skip if already populated\n if (file.data.profile) {\n return tree;\n }\n\n const version = value(tree, \"MSH-12.1\")?.value;\n if (!version) {\n return tree;\n }\n\n // Load fields and segments in parallel (segments don't depend on fields)\n const [fields, segments] = await Promise.all([\n loadFields(tree, version),\n loadSegments(version),\n ]);\n\n // Derive datatype + table definitions from fields in parallel\n const [datatypes, tables] = await Promise.all([\n loadDatatypes(fields, version),\n loadTables(fields, version),\n ]);\n\n file.data.profile = { datatypes, fields, segments, tables, version };\n\n return tree;\n };\n\n// ---------------------------------------------------------------------------\n// Field loading\n// ---------------------------------------------------------------------------\n\n/**\n * Collect unique segment names from the tree and load their field definitions.\n * Unknown segments (Z-segments, etc.) are silently omitted.\n */\nfunction loadFields(\n tree: Root,\n version: string\n): Promise<Map<string, FieldDefinition>> {\n const names = new Set<string>();\n visit(tree, \"segment\", (node) => {\n names.add(node.name);\n });\n\n return resolveAll(names, (name) => profiles.fields.load(version, name));\n}\n\n// ---------------------------------------------------------------------------\n// Datatype loading (cascading resolution)\n// ---------------------------------------------------------------------------\n\n/**\n * Load all datatype definitions referenced by field profiles, cascading\n * through composite datatypes to resolve component and subcomponent\n * datatypes (max 2 additional levels).\n */\n// oxlint-disable-next-line complexity/complexity -- cold-path profile loading: extracting the nested component scan regressed the cold-cache lint-profile bench 34% under CodSpeed, so it stays inline\nasync function loadDatatypes(\n fields: Map<string, FieldDefinition>,\n version: string\n): Promise<Map<string, DatatypeDefinition>> {\n const datatypes = new Map<string, DatatypeDefinition>();\n const load = (id: string) => profiles.datatypes.load(version, id);\n\n // Level 1: field-level datatypes\n const fieldDatatypeIds = new Set<string>();\n for (const def of fields.values()) {\n for (const field of def.bySequence.values()) {\n fieldDatatypeIds.add(field.datatype);\n }\n }\n merge(datatypes, await resolveAll(fieldDatatypeIds, load));\n\n // Levels 2-3: component and subcomponent datatypes\n for (let depth = 0; depth < 2; depth++) {\n const childIds = new Set<string>();\n for (const dtDef of datatypes.values()) {\n if (dtDef.kind !== \"composite\") {\n continue;\n }\n for (const comp of dtDef.componentsBySequence.values()) {\n if (!datatypes.has(comp.datatypeId)) {\n childIds.add(comp.datatypeId);\n }\n }\n }\n if (childIds.size === 0) {\n break;\n }\n merge(datatypes, await resolveAll(childIds, load));\n }\n\n return datatypes;\n}\n\n// ---------------------------------------------------------------------------\n// Table loading\n// ---------------------------------------------------------------------------\n\n/**\n * Load all table definitions referenced by field profiles.\n * Table IDs are normalized by stripping the \"HL7\" prefix.\n */\nfunction loadTables(\n fields: Map<string, FieldDefinition>,\n version: string\n): Promise<Map<string, TableDefinition>> {\n const tableIds = new Set<string>();\n for (const def of fields.values()) {\n for (const field of def.bySequence.values()) {\n if (field.table) {\n tableIds.add(normalizeTableId(field.table));\n }\n }\n }\n\n return resolveAll(tableIds, (id) => profiles.tables.load(version, id));\n}\n\n// ---------------------------------------------------------------------------\n// Segment loading\n// ---------------------------------------------------------------------------\n\n/**\n * Load all segment definitions for a version.\n * Returns an empty definition if the version is unknown.\n */\nasync function loadSegments(version: string): Promise<SegmentDefinition> {\n return (await loadSegmentDefinitions(version)) ?? { byId: new Map() };\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Load profiles in parallel. A profile the version does not bundle is\n * skipped; a profile that fails to load rejects.\n */\nasync function resolveAll<T>(\n ids: Set<string>,\n loader: (id: string) => Promise<T | undefined>\n): Promise<Map<string, T>> {\n const entries = [...ids];\n const results = await Promise.all(entries.map(loader));\n const resolved = new Map<string, T>();\n\n for (const [i, result] of results.entries()) {\n if (result !== undefined) {\n resolved.set(entries[i] as string, result);\n }\n }\n\n return resolved;\n}\n\n/** Merge source map entries into target. */\nfunction merge<K, V>(target: Map<K, V>, source: Map<K, V>): void {\n for (const [key, val] of source) {\n target.set(key, val);\n }\n}\n\nexport default hl7v2AnnotateProfileContext;\n"],"mappings":";;;;;;;;AAwCA,SAAS,iBAAiB,UAA0B;AAClD,QAAO,SAAS,QAAQ,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;AA0BrC,MAAa,oCACL,OAAO,MAAY,SAAgB;AAEvC,KAAI,KAAK,KAAK,QACZ,QAAO;CAGT,MAAM,UAAU,MAAM,MAAM,WAAW,EAAE;AACzC,KAAI,CAAC,QACH,QAAO;CAIT,MAAM,CAAC,QAAQ,YAAY,MAAM,QAAQ,IAAI,CAC3C,WAAW,MAAM,QAAQ,EACzBA,eAAa,QAAQ,CACtB,CAAC;CAGF,MAAM,CAAC,WAAW,UAAU,MAAM,QAAQ,IAAI,CAC5C,cAAc,QAAQ,QAAQ,EAC9B,WAAW,QAAQ,QAAQ,CAC5B,CAAC;AAEF,MAAK,KAAK,UAAU;EAAE;EAAW;EAAQ;EAAU;EAAQ;EAAS;AAEpE,QAAO;;;;;;AAWX,SAAS,WACP,MACA,SACuC;CACvC,MAAM,wBAAQ,IAAI,KAAa;AAC/B,OAAM,MAAM,YAAY,SAAS;AAC/B,QAAM,IAAI,KAAK,KAAK;GACpB;AAEF,QAAO,WAAW,QAAQ,SAAS,SAAS,OAAO,KAAK,SAAS,KAAK,CAAC;;;;;;;AAazE,eAAe,cACb,QACA,SAC0C;CAC1C,MAAM,4BAAY,IAAI,KAAiC;CACvD,MAAM,QAAQ,OAAe,SAAS,UAAU,KAAK,SAAS,GAAG;CAGjE,MAAM,mCAAmB,IAAI,KAAa;AAC1C,MAAK,MAAM,OAAO,OAAO,QAAQ,CAC/B,MAAK,MAAM,SAAS,IAAI,WAAW,QAAQ,CACzC,kBAAiB,IAAI,MAAM,SAAS;AA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  {
2
2
  "name": "@glion/annotate-profile-context",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Unified plugin to centralize HL7v2 profile loading onto file.data",
5
5
  "keywords": [
6
6
  "annotate",
@@ -39,10 +39,10 @@
39
39
  "dependencies": {
40
40
  "unified": "11.0.5",
41
41
  "vfile": "6.0.3",
42
- "@glion/ast": "0.20.0",
43
- "@glion/profiles": "0.20.0",
44
- "@glion/util-query": "0.20.0",
45
- "@glion/util-visit": "0.20.0"
42
+ "@glion/ast": "0.22.0",
43
+ "@glion/profiles": "0.22.0",
44
+ "@glion/util-query": "0.22.0",
45
+ "@glion/util-visit": "0.22.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "25.6.0",
@@ -51,9 +51,9 @@
51
51
  "tsdown": "0.21.10",
52
52
  "typescript": "6.0.3",
53
53
  "vitest": "4.1.11",
54
- "@glion/builder": "0.20.0",
55
- "@glion/testing": "0.18.0",
54
+ "@glion/builder": "0.22.0",
56
55
  "@glion/check-readme": "0.18.0",
56
+ "@glion/testing": "0.18.0",
57
57
  "@glion/tsconfig": "0.18.0"
58
58
  },
59
59
  "engines": {