@lowlysre/icd-10-cm 0.0.4 → 1.0.1

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
@@ -1,6 +1,11 @@
1
1
  # icd-10-cm
2
2
 
3
- A data package containing the latest ICD-10 CM codes and descriptions, types included.
3
+ ![NPM Version](https://img.shields.io/npm/v/%40lowlysre%2Ficd-10-cm)
4
+ [![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)
5
+ [![sustainable-npm](https://img.shields.io/badge/sustainable--npm-🌱-blue?style=flat)](https://github.com/lowlysre/sustainable-npm)
6
+
7
+
8
+ A data package containing the latest ICD-10 CM codes and descriptions, types included!
4
9
 
5
10
  * ⚡ Fast, lookups via dictionary of minified json
6
11
  * 🔒 Secure, a zero dependency package with provenance
@@ -13,10 +18,30 @@ A data package containing the latest ICD-10 CM codes and descriptions, types inc
13
18
  npm install @lowlysre/icd-10-cm
14
19
  ```
15
20
 
21
+ ## Usage
22
+
23
+ ```ts
24
+ import getICD10Description, { normalizeICD10Code } from "@lowlysre/icd-10-cm";
25
+
26
+ // Lookups normalize dots, casing, and whitespace automatically
27
+ const description = getICD10Description("A00.0");
28
+ // "Cholera due to Vibrio cholerae 01, biovar cholerae"
29
+
30
+ // Handle missing codes by checking for undefined
31
+ const maybeDescription = getICD10Description("Z999");
32
+ if (!maybeDescription) {
33
+ // fallback logic here
34
+ }
35
+
36
+ // You can normalize a code explicitly if you store normalized keys elsewhere
37
+ const normalized = normalizeICD10Code(" a00.1 "); // "A001"
38
+ ```
39
+
16
40
  ## Data Source
17
41
 
18
42
  [www.cdc.gov/nchs](https://www.cdc.gov/nchs/icd/icd-10-cm/files.html)
19
43
 
20
44
  ## Versions
21
45
 
46
+ * v1.0.0 - Normalized lookups, data load guard, bundled ESM/CJS build, flat ESLint 9 config, 100% tests/coverage
22
47
  * v0.x.x - April 1, 2024, ICD-10-CM update
@@ -0,0 +1,6 @@
1
+ type ICD10Dictionary = { [code: string]: string };
2
+
3
+ declare const normalizeICD10Code: (code: string) => string;
4
+ declare const getICD10Description: (code: string) => string | undefined;
5
+
6
+ export { type ICD10Dictionary, getICD10Description as default, getICD10Description, normalizeICD10Code };
@@ -0,0 +1,6 @@
1
+ type ICD10Dictionary = { [code: string]: string };
2
+
3
+ declare const normalizeICD10Code: (code: string) => string;
4
+ declare const getICD10Description: (code: string) => string | undefined;
5
+
6
+ export { type ICD10Dictionary, getICD10Description as default, getICD10Description, normalizeICD10Code };