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

@synanetics/fhir-fml-convert

v0.3.0

Published

Converts StructureMaps written in FML to JSON ($convert operation)

Readme

@synanetics/fhir-fml-convert

Converts FHIR StructureMaps from FML format to deserialised FHIR StructureMap objects, using the @types/fhir NPM package.

Usage

import convert from '@synanetics/fhir-convert';

const fml = `
map "http://example.org/StructureMap/MyMap" = MyMap

group PatientToPerson(source src : Patient, target tgt : Person) {
}
`;

const structureMap = convert(fml);
assert(structureMap.name).toEqual('MyMap');

Detailed description

This package has been created to support the Interweave NRL project. Namely, to convert FML StructureMaps to JSON so that:

  1. they can be stored in the Interweave Connect Appliance's data store
  2. they can be parsed by the existing StructureMap transformer

This package makes use of "antlr4ts" to automatically generate some code that helps us parse the ANTLR4 grammar for the FHIR Mapping Language. The ANTLR4 grammar supplied by HL7 is riddled with mistakes and oversights that have been corrected in the file FhirMapper.g4 in this package. So that the grammar can be properly parsed, the fhirpath.g4 grammar has also been included. Without the inclusion of this grammar, the inclusion of any FHIR path expressions in the FML causes a parsing error.

Note: this is a CommonJS package, because the generated ANTLR helpers are CommonJS (and no ESM generation option is available).

Development dependencies

The "antlr4ts-cli", which is used to generate the ANTLR parser helpers depends on JRE 1.6 or above. Note that this is only a development dependency, and not a runtime dependency (the generated files are a runtime dependency).

Supported features

  • Choice of output FHIR version for the StructureMap.
  • Uses FHIR Path-style default value parsing. As such, all default values map to the defaultValueString choice element in produced STU3 and R4 StructureMaps, and the result is expected to be evaluated as a FHIR Path expression. Default values were always intended to be parsed as FHIR Path expressions and the inclusion of the choice element defaultValue[x] in STU3 and R4 was essentially a mistake, rectified in R5.
  • Primitive metadata parsing: metadata elements in FML begin ///, and complex elements may be defined using the syntax described in the specification. In this implementation, only primitive values (e.g. 'url', 'name', 'title', 'experimental' and 'status' from the specification) are supported, whereas complex types (e.g. 'jurisdiction' from the specification) are not.

Unsupported features

  • Constants are not currently supported, as we do not yet need them.
  • list-option in source transformations, as we do not yet need this (side note: it is unclear how this actually works).
  • check: StructureMap rules offer a "check" condition, which, if failed, should cause the program that evaluates the map to throw an exception. These instructions are not currently being parsed from the FML into the deserialised StructureMap object.
  • list_modes have not been implemented and, like list-option, it is unclear how these work.