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

fhirpath-editor

v0.10.5

Published

A React component library for editing and evaluating FHIRPath expressions with real-time feedback.

Readme

FHIRPath Editor

A React component library for editing and evaluating FHIRPath expressions with real-time feedback.

Online Demo

Try the interactive demo at https://healthsamurai.github.io/fhirpath-editor/

Installation

npm install fhirpath-editor
# or
yarn add fhirpath-editor

Usage

The library provides an Editor component for working with FHIRPath expressions:

Uncontrolled Component (with defaultValue)

import { Editor } from "fhirpath-editor";
import r4 from "fhirpath/fhir-context/r4";

function MyFhirPathEditor() {
  // FHIRPath expression to evaluate
  const defaultExpr = "(1 + 2) * 3";
  const handleChange = (newValue) =>
    console.log("Expression changed:", newValue);

  // Simple FHIR resource to evaluate FHIRPath against
  const data = {
    resourceType: "Patient",
    id: "example",
    name: [
      {
        family: "Smith",
        given: ["John"],
      },
    ],
    birthDate: "1970-01-01",
  };

  const fhirSchema = []; // Replace with actual schema data

  return (
    <Editor
      defaultValue={defaultExpr}
      onChange={handleChange}
      data={data}
      schema={fhirSchema}
      model={r4}
    />
  );
}

Controlled Component (with value)

import { Editor } from "fhirpath-editor";
import r4 from "fhirpath/fhir-context/r4";
import { useState } from "react";

function MyFhirPathEditor() {
  // FHIRPath expression state
  const [expression, setExpression] = useState("(1 + 2) * 3");

  // Simple FHIR resource to evaluate FHIRPath against
  const data = {
    resourceType: "Patient",
    id: "example",
    name: [
      {
        family: "Smith",
        given: ["John"],
      },
    ],
    birthDate: "1970-01-01",
  };

  const fhirSchema = []; // Replace with actual schema data

  return (
    <Editor
      value={expression}
      onChange={setExpression}
      data={data}
      schema={fhirSchema}
      model={r4}
    />
  );
}

Props

| Prop | Type | Required | Description | | -------------- | ----------------------- | -------- | ----------------------------------------------- | | value | string | No | Current FHIRPath expression (controlled mode) | | defaultValue | string | No | Initial FHIRPath expression (uncontrolled mode) | | onChange | (value: string) => void | No | Callback for expression changes | | data | any | Yes | The context data to evaluate FHIRPath against | | variables | Record<string, any> | No | External bindings available to expressions | | schema | FhirSchema[] | Yes | FHIR schema definitions for validation | | model | Model | Yes | FHIR version model data | | debug | boolean | No | Enable debug mode |

Component Modes

The Editor component supports both controlled and uncontrolled modes:

  • Controlled Mode: Provide the value prop and handle changes with onChange.
  • Uncontrolled Mode: Provide only the defaultValue prop (initial value) and optionally handle changes with onChange.

Note: Do not provide both value and defaultValue at the same time. If both are provided, defaultValue will be ignored and a warning will be logged to the console.

Features

  • Low-code environment for developing and testing FHIRPath expressions
  • Interactive visual editor with instant feedback
  • Real-time evaluation against FHIR resources
  • Support for external variable bindings
  • Schema-based validation with autocomplete suggestions
  • Syntax highlighting and error detection
  • Reduces development time for complex FHIRPath queries

Todo

  • [x] Support $total special variable
  • [x] Support type evaluation of aggregate call
  • [ ] Support dynamic index access
  • [ ] Support unit token