npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@glion/preset-annotate-profile-recommended

v0.16.0

Published

Preset bundling all HL7v2 profile annotation plugins

Readme

@glion/preset-annotate-profile-recommended

Preset bundling every profile-based annotation plugin so the AST carries full profile metadata after a single .use(...) call.

What it does

This preset wires the five profile annotation plugins plus the annotate-profile-context loader into a single unified plugin. One .use(...) call enriches every segment, field, field-repetition, component, sub-component, and coded value in the AST with its HL7v2 profile metadata — names, datatypes, required flags, repeatability, max lengths, table references, and code-system displays. The annotated tree is self-describing and can be walked without loading any profiles yourself.

Install

npm install @glion/preset-annotate-profile-recommended

Use

import hl7v2PresetAnnotateProfileRecommended from "@glion/preset-annotate-profile-recommended";
import { hl7v2Parser } from "@glion/parser";
import { visit } from "@glion/util-visit";
import { unified } from "unified";

const processor = unified()
  .use(hl7v2Parser)
  .use(hl7v2PresetAnnotateProfileRecommended);

const file = await processor.process(
  "MSH|^~\\&|SENDER||RECEIVER||20250601120000||ADT^A01|MSG00001|P|2.5\rPID|1||12345||Doe^John"
);

visit(file.result, "field", (node) => {
  if (node.data?.required && node.data.name) {
    console.log(`Required: ${node.data.id} (${node.data.name})`);
  }
});

API

unified().use(hl7v2PresetAnnotateProfileRecommended)

Default export is a Preset (unified's { plugins: [...] } shape). No options — to annotate selectively, compose individual plugins from their own packages instead.

What's bundled

The preset applies these plugins in order. annotate-profile-context runs first so each subsequent plugin reads the pre-resolved profile from file.data.profile.

| Plugin | Annotates | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | @glion/annotate-profile-context | Loads the HL7v2 profile for the message version onto file.data. | | @glion/annotate-profile-segments | Annotates Segment nodes with their human-readable title (e.g. MSH"Message Header"). | | @glion/annotate-profile-fields | Annotates Field nodes with name, required, repeatable, datatype, maxLength, table. | | @glion/annotate-profile-datatypes | Annotates FieldRepetition, Component, and Subcomponent nodes with datatype metadata. | | @glion/annotate-profile-fields-code-systems | Annotates coded fields with UTG code-system identity and resolved display values. |

All five plugins read the HL7v2 version from MSH-12 and load profiles via @glion/profiles. Unknown segments (Z-segments) are silently skipped so non-standard content passes through unchanged.

Part of Glion

@glion/preset-annotate-profile-recommended is part of Glion, the application framework for HL7v2. See the Glion README for the full package catalog and architecture.