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