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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@synanetics/fhir-name-formatter

v1.0.0-beta

Published

> TODO: description

Downloads

4

Readme

@synanetics/fhir-name-formatter

Formats primitive strings or FHIR HumanName data types into strings, formatted according to the supplied options.

The default options format HumanNames according to NHS standards so, in many cases, it's not necessary to pass in any options

Usage

import formatName from '@synanetics/fhir-name-formatter';

const patient = {
  resourceType: 'Patient',
  name: [{
    use: 'maiden',
    family: 'Doe',
    given: ['Jane'],
  }, {
    use: 'official',
    family: 'Smith',
    given: ['Jane'],
  }]
};

const patientName = formatName(patient.name);

console.log(patientName); // 'Jane SMITH'

const organisation = {
  resourceType: 'Organization',
  name: 'Synanetics Ltd',
};

const organisationName = formatName(organisation.name);

console.log(organisationName); // 'Synanetics Ltd' -- this just returns the string, so you don't have to think about using it.

Options

It is worth noting that the options described below only apply to HumanNames (or arrays thereof).

If empty selection options are supplied, for an array of HumanNames, the first element will be formatted.

| Option | Type | Description | Default | | ----------------- | --------- | ----------- | ------- | | includePrefixes | boolean | If true, prefixes (e.g. "Mrs", "Dr", "Lord") will be included in the returned formatted string. | false | | includeSuffixes | boolean | If true, suffixes (e.g. "esq.", "MPhys", "BA") will be included in the returned formatted string. | false | | upperCaseFamilyName | boolean | If true, the "family" part of the HumanName will be made upper case. | true | | preferUse | string[] | If this property is set, the function will iterate through these preferences, in order, and select the first matching "use" as the HumanName to format and return. | ['official', 'usual'] | | dispreferUse | string[] | If this property is set, the fuction will attempt not to use names whose "use" matches these values. Values earlier in the list are least preferred. So, using the supplied defaults, if a supplied HumanName array contains only a "maiden" and a "temp" name, the "temp" will be chosen. Names with no "use" defined are chosen ahead of all of these values. | ['old', 'maiden', 'temp', 'nickname'] | | removeUse | string[] | Names matching these "use" types are removed from the HumanName array completely. | undefined | | allowExpired | boolean | Allow expired names, that is, names where the "end" of the period has elapsed. | false | | allowFuture | boolean | Allow future names, that is, names where the "start" of the period has not yet occurred. | false |