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

questionnaire-version-converter

v1.1.0

Published

For converting FHIR questionnaires between FHIR versions.

Downloads

57

Readme

Questionnaire Version Converter

This questionnaire converter converts FHIR© Questionnaire resources between different FHIR versions. It includes a library and a command line tool. The FHIR versions currently supported include STU3, R4, and R5, and the support for R6 is being considered.

A few general notes:

  • The converter assumes that the input questionnaires are valid, and if not, the results may be corrupted.
  • The converter continues on in the face of errors, e.g., when a data element from the source version cannot be converted to the target version and will report such incidents at the item level.
  • The intention is to always produce a valid questionnaire if the input is valid, although there may be data losses, e.g., data elements unable to convert.
  • The resulting resource will have the same resource id and url (if present) as the input resource.

Installing the package

As with any npm packages, it needs to be installed before use:

Using the Questionnaire Conversion Library

To make a conversion within javascript apps/code:

or,

Where the result object has 3 fields:

  • status: the status code:
    • 1: conversion completed with success
    • 0: conversion completed with warning
    • -1: conversion completed with data loss, i.e., some elements may have been dropped.
    • -2: conversion aborted due to unexpected errors.
  • message: a list of message objects (may not present) each has the following fields:
    • ctxId: the context id, usually the linkId of the item the message is about, but it can also be the questionnaire id if the issue is at the top level.
    • status: statue code or nature of the message, can be 0, -1, or -2 as described above.
    • text: the message text.
  • data: the converted questionnaire

Using the Command Line Tool

The command line tool may be used to convert questionnaire files, either single resource files or resource bundle files, and the result files are written to the output directory specified on the command line.

  • Only .json files will be processed.
  • JSON files that aren't FHIR resources or aren't Questionnaire resources will still be written to the output directory, as is.
  • For resources in a bundle, the resources that aren't Questionnaire resources will be copied as is to the output file.

To get detailed usage instructions, run

  • node src/qnvconv_cli.js --help

For examples:

  • node src/qnvconv_cli.js R4 R5 /tmp/my-questionnaire.json /tmp

Will convert the given questionnaire file (single Questionnaire or bundle) from R4 to R5 and write to the output file /tmp/my-questionnaire-R5.json (note the -R5 suffix in the result file name).

  • node src/qnvconv_cli.js R4 R5 /tmp/my-source-dir/ /tmp/output

Will process every .json file under /tmp/my-source-dir/ (recursively) and write the output files to /tmp/output, with the same subdirectory structure as the source directory.