@lowlysre/icd-10-cm 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,11 +5,12 @@
5
5
  </p>
6
6
 
7
7
  [![NPM Version](https://img.shields.io/npm/v/%40lowlysre%2Ficd-10-cm)](https://www.npmjs.com/package/@lowlysre/icd-10-cm)
8
+ [![downloads](https://img.shields.io/npm/dm/@lowlysre/icd-10-cm)](https://npm-stat.com/charts.html?package=@lowlysre/icd-10-cm)
9
+ [![jsDelivr](https://data.jsdelivr.com/v1/stats/packages/npm/@lowlysre/icd-10-cm/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@lowlysre/icd-10-cm)
8
10
  [![Test](https://github.com/lowlysre/icd-10-cm/actions/workflows/test.yml/badge.svg)](https://github.com/lowlysre/icd-10-cm/actions/workflows/test.yml)
9
11
  [![sustainable-npm](https://img.shields.io/badge/sustainable--npm-🌱-blue?style=flat)](https://github.com/lowlysre/sustainable-npm)
10
- [![immutable releases](https://img.shields.io/badge/immutable%20releases-active-green?logo=github)](https://github.com/lowlysre/icd-10-cm/releases)
11
12
 
12
- A data package containing the latest ICD-10 CM codes and descriptions, types included!
13
+ A data package containing the FY2027 ICD-10-CM diagnosis codes and descriptions (effective October 1, 2026), types included!
13
14
 
14
15
  - ⚡ Fast, lookups via dictionary of minified json
15
16
  - 🔒 Secure, a zero dependency package with provenance
@@ -41,26 +42,67 @@ if (!maybeDescription) {
41
42
  const normalized = normalizeICD10Code(" a00.1 "); // "A001"
42
43
  ```
43
44
 
44
- ## Data Source
45
+ CommonJS works too:
46
+
47
+ ```js
48
+ const { getICD10Description } = require("@lowlysre/icd-10-cm");
49
+ ```
50
+
51
+ ### Checking which release is bundled
52
+
53
+ `ICD10_CM_RELEASE` describes the code set shipped in the installed version, so an app can log it, show it, or fail fast when it expects a different year:
54
+
55
+ ```ts
56
+ import { ICD10_CM_RELEASE } from "@lowlysre/icd-10-cm";
57
+
58
+ ICD10_CM_RELEASE.fiscalYear; // 2027
59
+ ICD10_CM_RELEASE.effectiveDate; // "2026-10-01"
60
+ ICD10_CM_RELEASE.codeCount; // 74879
61
+ ```
62
+
63
+ ## API
45
64
 
46
- [www.cdc.gov/nchs](https://www.cdc.gov/nchs/icd/icd-10-cm/files.html)
65
+ - `getICD10Description(code)` (also the default export) returns the description for a code, or `undefined` when the code isn't in the bundled release. Input is normalized first.
66
+ - `normalizeICD10Code(code)` trims whitespace, strips dots, and uppercases, matching the dataset keys.
67
+ - `ICD10_CM_RELEASE` is a frozen object with the bundled release's `fiscalYear`, `effectiveDate`, and `codeCount`.
68
+ - `ensureICD10DatasetLoaded(data)` returns `data`, or throws when it's empty or missing.
69
+ - Types: `ICD10Dictionary`, `ICD10CMRelease`.
47
70
 
48
- ## Development
71
+ The package supports Node.js 22 or later.
72
+
73
+ ## Raw data via CDN
74
+
75
+ The dataset is a flat JSON object of normalized code to description. Browsers and other runtimes can fetch it straight from jsDelivr without installing anything:
76
+
77
+ ```js
78
+ const res = await fetch(
79
+ "https://cdn.jsdelivr.net/npm/@lowlysre/icd-10-cm@3/data/icd10.min.json",
80
+ );
81
+ const codes = await res.json();
82
+ codes["A000"]; // "Cholera due to Vibrio cholerae 01, biovar cholerae"
83
+ ```
84
+
85
+ Pin the major version in the URL so the code set only changes when you choose to upgrade.
86
+
87
+ ## Versioning
88
+
89
+ Each new ICD-10-CM release (the annual October 1 update, and any April 1 update) ships as a new major version. A release can delete or redefine codes, so a caret range like `^3.0.0` never silently changes the code set underneath an app. Upgrade the major version deliberately to pick up a new year.
90
+
91
+ Minor and patch versions contain code and tooling changes only; the data stays the same.
92
+
93
+ ## Data Source
49
94
 
50
- For regenerating `data/icd10.min.json` via `npm run parse-icd`, use Node.js v22+ (required for `--experimental-strip-types`).
95
+ ICD-10-CM is maintained by the CDC's National Center for Health Statistics (NCHS), which publishes the code files for free public use: [ICD-10-CM files](https://www.cdc.gov/nchs/icd/icd-10-cm/files.html). The MIT license covers this package's code.
51
96
 
52
- ### Updating the ICD-10-CM data
97
+ This package is not affiliated with or endorsed by the CDC, NCHS, or CMS.
53
98
 
54
- CDC/NCHS publishes a new code set annually (effective October 1) and occasionally a mid-year update (effective April 1). Check the [CDC files page](https://www.cdc.gov/nchs/icd/icd-10-cm/files.html) or the [CMS ICD-10 page](https://www.cms.gov/medicare/coding-billing/icd-10-codes) for the latest "Code Descriptions in Tabular Order" archive.
99
+ ## Contributing
55
100
 
56
- 1. Download the latest Code Descriptions in Tabular Order zip
57
- 2. Extract `icd10cm_codes_<year>.txt` and save it as `scripts/icd10cm.txt` (format: code, whitespace, description per line)
58
- 3. Run `npm run parse-icd` to regenerate `data/icd10.min.json`
59
- 4. Run `npm test` and verify the reported code count matches the addenda
60
- 5. Bump the package version and publish
101
+ See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for setup and the yearly data update steps.
61
102
 
62
103
  ## Versions
63
104
 
105
+ - v3.1.0 - `ICD10_CM_RELEASE` export with the bundled fiscal year, effective date, and code count. Node.js 22+ declared in `engines`, `package.json` exported, expanded npm keywords. API, CDN, and versioning docs, plus contributing and security guides
64
106
  - v3.0.0 - Data updated to the October 1, 2026 ICD-10-CM release (74,879 codes, from the FY2027 set)
65
107
  - v2.0.0 - Data updated to the April 1, 2026 ICD-10-CM release (74,719 codes, from the FY2024 set). TypeScript 7 (native compiler) toolchain, ESLint replaced with oxlint + Prettier, dropped tsup for plain tsc (zero-bundler dual ESM/CJS), dataset shipped once and lazy-loaded (~50% smaller install, faster imports), fixed broken `require()` entry point
66
108
  - v1.1.5 - Dependency and toolchain maintenance
package/dist/index.cjs CHANGED
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getICD10Description = exports.normalizeICD10Code = exports.ensureICD10DatasetLoaded = void 0;
3
+ exports.getICD10Description = exports.normalizeICD10Code = exports.ensureICD10DatasetLoaded = exports.ICD10_CM_RELEASE = void 0;
4
4
  const node_fs_1 = require("node:fs");
5
5
  const node_path_1 = require("node:path");
6
+ exports.ICD10_CM_RELEASE = Object.freeze({
7
+ fiscalYear: 2027,
8
+ effectiveDate: "2026-10-01",
9
+ codeCount: 74879,
10
+ });
6
11
  const ensureICD10DatasetLoaded = (data) => {
7
12
  const datasetHasEntries = data && Object.keys(data).length > 0;
8
13
  if (!datasetHasEntries) {
package/dist/index.d.cts CHANGED
@@ -1,6 +1,12 @@
1
1
  export type ICD10Dictionary = {
2
2
  [code: string]: string;
3
3
  };
4
+ export type ICD10CMRelease = {
5
+ readonly fiscalYear: number;
6
+ readonly effectiveDate: string;
7
+ readonly codeCount: number;
8
+ };
9
+ export declare const ICD10_CM_RELEASE: ICD10CMRelease;
4
10
  export declare const ensureICD10DatasetLoaded: (data: ICD10Dictionary) => ICD10Dictionary;
5
11
  export declare const normalizeICD10Code: (code: string) => string;
6
12
  export declare const getICD10Description: (code: string) => string | undefined;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { getICD10Description } from "./index.cjs";
2
- export { getICD10Description, ensureICD10DatasetLoaded, normalizeICD10Code, } from "./index.cjs";
3
- export type { ICD10Dictionary } from "./index.cjs";
2
+ export { getICD10Description, ensureICD10DatasetLoaded, normalizeICD10Code, ICD10_CM_RELEASE, } from "./index.cjs";
3
+ export type { ICD10Dictionary, ICD10CMRelease } from "./index.cjs";
4
4
  export default getICD10Description;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { getICD10Description } from "./index.cjs";
2
- export { getICD10Description, ensureICD10DatasetLoaded, normalizeICD10Code, } from "./index.cjs";
2
+ export { getICD10Description, ensureICD10DatasetLoaded, normalizeICD10Code, ICD10_CM_RELEASE, } from "./index.cjs";
3
3
  export default getICD10Description;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lowlysre/icd-10-cm",
3
- "version": "3.0.0",
4
- "description": "ICD-10-CM (Clinical Modification) data for use in the US healthcare system",
3
+ "version": "3.1.0",
4
+ "description": "FY2027 ICD-10-CM diagnosis codes and descriptions (CDC/NCHS, effective October 1, 2026) with TypeScript types and zero dependencies",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.cts",
@@ -23,9 +23,13 @@
23
23
  "types": "./dist/index.d.cts",
24
24
  "default": "./dist/index.cjs"
25
25
  }
26
- }
26
+ },
27
+ "./package.json": "./package.json"
27
28
  },
28
29
  "sideEffects": false,
30
+ "engines": {
31
+ "node": ">=22"
32
+ },
29
33
  "author": "John McCall",
30
34
  "license": "MIT",
31
35
  "files": [
@@ -38,7 +42,12 @@
38
42
  "tag": "latest"
39
43
  },
40
44
  "repository": {
41
- "url": "https://github.com/lowlysre/icd-10-cm"
45
+ "type": "git",
46
+ "url": "git+https://github.com/lowlysre/icd-10-cm.git"
47
+ },
48
+ "homepage": "https://github.com/lowlysre/icd-10-cm#readme",
49
+ "bugs": {
50
+ "url": "https://github.com/lowlysre/icd-10-cm/issues"
42
51
  },
43
52
  "keywords": [
44
53
  "icd",
@@ -46,10 +55,21 @@
46
55
  "icd-code",
47
56
  "icd10",
48
57
  "icd-10-cm",
58
+ "icd10cm",
59
+ "icd-10-cm-codes",
60
+ "diagnosis",
61
+ "diagnosis-codes",
49
62
  "medical",
63
+ "medical-coding",
64
+ "medical-billing",
50
65
  "healthcare",
51
- "diagnosis",
52
- "who"
66
+ "health-data",
67
+ "cdc",
68
+ "nchs",
69
+ "cms",
70
+ "fhir",
71
+ "fy2027",
72
+ "typescript"
53
73
  ],
54
74
  "devDependencies": {
55
75
  "@types/node": "^26.1.1",