Package Exports
- @beparallel/grouping
- @beparallel/grouping/package.json
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:
- Native C/C++ Module: The core ATIH grouping engine in the
srcfolder - JavaScript Interface: High-level Node.js API for application integration
- Type Definitions: TypeScript definitions for development support
Installation
pnpm add @beparallel/groupingRequirements
- Node.js 22.0.0 or higher
- Compatible with Windows, macOS, and Linux
- Native compilation tools (node-gyp)
📚 Additional Resources
- Format of the RSS non grouped data: doc/022_format.md
- Format of the RSS grouped data: doc/122_format.md
- Grouping algorithm: doc/grouping_method.md
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
}