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

@beparallel/grouping

v0.5.19

Published

Node.js wrapper for the official ATIH grouping engine (PMSI GHM/GHS) used in French hospital medical coding. This package provides access to the native C groupage module for classifying inpatient stays into GHM and GHS codes as part of the PMSI/T2A system

Readme

grouping

A Node.js wrapper for the official ATIH grouping engine used in the French PMSI (Programme de Médicalisation des Systèmes d'Information).

This package allows integration of the native C-based groupage module to classify hospital stays into GHM (Groupe Homogène de Malades) and GHS (Groupe Homogène de Séjours) codes, in compliance with the T2A billing system in France.

Overview

This project implements a Node.js native addon using Node-API to wrap the official ATIH (Agence Technique de l'Information sur l'Hospitalisation) grouping engine. The grouping engine is a critical component of the French healthcare system's billing and classification infrastructure.

French Medical Coding Context

The French healthcare system uses the PMSI (Programme de Médicalisation des Systèmes d'Information) for medical activity coding and hospital billing under the T2A (Tarification À l'Activité) system. This project specifically addresses the need for automated grouping of medical stays into standardized categories.

For comprehensive background on grouping algorithms and medical coding in France, refer to this detailed overview.

Technical Architecture

This package consists of:

  1. Native C/C++ Module: The core ATIH grouping engine in the atih folder (see doc/grouping_method.md)
  2. JavaScript Interface: High-level Node.js API for application integration
  3. Type Definitions: TypeScript definitions for development support

Installation

  1. Install the package
pnpm add @beparallel/grouping
  1. Export Github Token
export GITHUB_TOKEN=your_github_token

or set it in the .env.dev file and run dotenv -f .env.dev run XXX

  1. Build the native module
cd node_modules/@beparallel/grouping && pnpm prebuild:install

Requirements

  • Node.js 22.0.0 or higher
  • Compatible with macOS and Linux
  • Native compilation tools (node-gyp)

📚 Additional Resources

Release process

Atih

API Reference

Basic Usage

import { grp } from '@beparallel/grouping'

const result = grp.grp2025({...})

Input Format

The module expects RSS (Résumé de Sortie Standardisé) formatted data conforming to ATIH specifications:

const rssData = {
  // Patient demographics
  age: 65,
  sex: 'M',

  // Medical coding
  mainDiagnosis: 'I21.0',
  secondaryDiagnoses: ['E11.9', 'N18.6'],
  procedures: ['DEQP003'],

  // Stay information
  entryMode: '6',
  exitMode: '9',
  lengthOfStay: 7,

  // Additional classification data
  severity: 2,
  complexity: 1
}

Output Format

{
  ghm: 'GHM_CODE',        // Groupe Homogène de Malades
  ghs: 'GHS_CODE',        // Groupe Homogène de Séjours
  severity: 2,            // Severity level
  complexity: 1,          // Complexity level
  errors: [],             // Array of error codes/messages
  warnings: [],           // Array of warning messages
  processingTime: 1.2     // Processing time in milliseconds
}