autoicd-js 0.6.0 → 0.8.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
@@ -4,7 +4,7 @@
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
5
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.5+-blue.svg)](https://www.typescriptlang.org/)
6
6
 
7
- Official TypeScript SDK for the [AutoICD API](https://autoicdapi.com) — clinical text to ICD-10-CM and ICD-11 diagnosis codes, powered by AI and medical NLP.
7
+ Official TypeScript SDK for the [AutoICD API](https://autoicdapi.com) — AI medical coding that converts clinical text to ICD-10-CM, ICD-11, and ICF codes using medical NLP. Automate ICD-10 coding, ICF functioning classification, and disability assessment in your application.
8
8
 
9
9
  Zero dependencies. Works in **Node.js 18+**, **Deno**, **Bun**, and **edge runtimes**.
10
10
 
@@ -16,9 +16,12 @@ Zero dependencies. Works in **Node.js 18+**, **Deno**, **Bun**, and **edge runti
16
16
 
17
17
  | | |
18
18
  |---|---|
19
- | **AI-Powered ICD-10 & ICD-11 Coding** | Clinical NLP extracts diagnoses from free-text notes and maps them to ICD-10-CM or ICD-11 codes — no manual lookup required |
19
+ | **AI-Powered ICD-10, ICD-11 & ICF Coding** | Clinical NLP extracts diagnoses from free-text notes and maps them to ICD-10-CM, ICD-11, or ICF codes — no manual lookup required |
20
+ | **Chart Audit with HCC Gap Capture** | Find missed HCCs, unsupported codes, and specificity upgrades with RAF-weighted revenue estimates (CMS v22 + v28 PY2026). Every finding carries evidence spans |
21
+ | **Cross-Standard Code Translation** | Map a code between ICD-10, ICD-11, SNOMED CT, UMLS, and ICF in one call. Forward ICD-10 → all other systems, plus reverse ICD-11 → ICD-10 and ICF → ICD-10 |
20
22
  | **74,000+ ICD-10-CM Codes** | Full 2025 code set enriched with SNOMED CT synonyms for comprehensive matching |
21
23
  | **ICD-11 Support** | Search and look up ICD-11 codes, with full ICD-10 ↔ ICD-11 crosswalk mappings |
24
+ | **ICF Functioning Codes** | Code clinical text to WHO ICF categories, search 1,400+ codes, and access Core Sets for 12+ conditions |
22
25
  | **Negation & Context Detection** | Knows the difference between "patient has diabetes" and "patient denies diabetes" — flags negated, historical, uncertain, and family-history mentions |
23
26
  | **PHI De-identification** | HIPAA-compliant anonymization of names, dates, SSNs, phone numbers, emails, addresses, MRNs, and ages |
24
27
  | **Confidence Scoring** | Every code match includes a similarity score and confidence level so you can set your own acceptance thresholds |
@@ -69,6 +72,87 @@ for (const entity of result.entities) {
69
72
 
70
73
  ## Features
71
74
 
75
+ ### Chart Audit (HCC gap capture, RADV defense, specificity, denial risk)
76
+
77
+ Audit a chart to surface coding gaps, unsupported codes, specificity upgrades, and denial-risk flags in a single call. Every finding carries extractive evidence spans pointing back to the source text, and HCC gaps include RAF-weighted revenue estimates using the CMS PY2026 V22 and V28 community models.
78
+
79
+ ```ts
80
+ const audit = await autoicd.audit({
81
+ text:
82
+ "68yo M, type 2 diabetes stable on metformin, chronic systolic heart failure " +
83
+ "on furosemide, edema controlled. A1c 7.4 today.",
84
+ codes: [{ code: "E11.9", kind: "icd10" }],
85
+ capabilities: ["hcc", "radv", "specificity", "denial", "problem_list"],
86
+ context: {
87
+ patient: { coverage: "medicare_advantage" },
88
+ hcc_model: "both",
89
+ },
90
+ });
91
+
92
+ console.log(`Missed revenue: $${audit.totals.estimated_revenue_recovery.toFixed(0)}`);
93
+ console.log(`RADV exposure: $${audit.totals.radv_exposure.toFixed(0)}`);
94
+
95
+ for (const m of audit.missed) {
96
+ console.log(
97
+ `MISSED ${m.code} (${m.hcc_category ?? "non-HCC"} ${m.hcc_model ?? ""}) ` +
98
+ `→ $${m.estimated_revenue?.toFixed(0) ?? 0}: ${m.description}`
99
+ );
100
+ for (const span of m.evidence) {
101
+ console.log(` evidence: "${span.quote}" [${span.start}-${span.end}]`);
102
+ }
103
+ }
104
+ ```
105
+
106
+ | Capability | What it surfaces |
107
+ |---|---|
108
+ | `hcc` | Missed HCC codes with `hcc_category`, `raf_weight`, `estimated_revenue` per v22/v28 model |
109
+ | `radv` | Submitted codes with no supporting documentation, with `what_would_support_it` guidance and exposure dollars |
110
+ | `specificity` | Upgrade opportunities from unspecified to more specific child codes |
111
+ | `denial` | Documentation-quality risk flags (missing laterality, missing duration, age/sex mismatches) |
112
+ | `problem_list` | Deduplicated active-conditions list with status (active/historical) and evidence |
113
+
114
+ Default behavior runs all five capabilities. Pass `capabilities: ["hcc"]` to run a targeted audit.
115
+
116
+ > **`hcc_model`:** use `"v22"`, `"v28"`, or `"both"` (default). CMS PY2026 MA payment uses V22 and V28 as the two main community models. V24 is the ESRD-specific model and is not accepted here.
117
+
118
+ Read more about the Audit endpoint at [autoicdapi.com/audit](https://autoicdapi.com/audit).
119
+
120
+ ### Cross-Standard Code Translation
121
+
122
+ Translate a code between healthcare coding systems in one call. Forward from ICD-10 to ICD-11, SNOMED CT, UMLS, and ICF, plus reverse ICD-11 → ICD-10 and ICF → ICD-10. Built on CMS-published crosswalks, code-level SNOMED / UMLS concept IDs, and WHO ICF Core Sets.
123
+
124
+ ```ts
125
+ const mapping = await autoicd.translate({
126
+ from: { code: "E11.9", system: "icd10" },
127
+ });
128
+
129
+ console.log(mapping.mappings.icd11);
130
+ // [{ code: "5A11", description: "Type 2 diabetes mellitus", mapping_type: "equivalent" }]
131
+ console.log(mapping.mappings.snomed);
132
+ // [{ code: "44054006" }, { code: "73211009" }, ...]
133
+ console.log(mapping.mappings.icf);
134
+ // [{ code: "b540", description: "General metabolic functions", component: "b" }, ...]
135
+ ```
136
+
137
+ Narrow the targets when you only need specific systems:
138
+
139
+ ```ts
140
+ const targeted = await autoicd.translate({
141
+ from: { code: "I50.9", system: "icd10" },
142
+ to: ["icd11"],
143
+ });
144
+ ```
145
+
146
+ Requested systems that aren't reachable from the source are returned in `unsupported_targets[]` rather than as errors, so clients can request a broad target list and use whatever comes back.
147
+
148
+ | From | To | Source |
149
+ |------|----|--------|
150
+ | ICD-10-CM | ICD-11, SNOMED, UMLS, ICF | CMS crosswalk + concept refsets + WHO Core Sets |
151
+ | ICD-11 MMS | ICD-10-CM | Reverse CMS crosswalk |
152
+ | ICF | ICD-10-CM | Reverse WHO ICF Core Set index |
153
+
154
+ Read more about the Translate endpoint at [autoicdapi.com/interop](https://autoicdapi.com/interop).
155
+
72
156
  ### Automated ICD-10 Medical Coding
73
157
 
74
158
  Extract diagnosis entities from clinical notes and map them to ICD-10-CM codes. Each entity includes ranked candidates with confidence scores, negation status, and context flags.
@@ -167,6 +251,30 @@ for (const mapping of detail.icd11_mappings ?? []) {
167
251
  }
168
252
  ```
169
253
 
254
+ ### ICF Functioning Codes
255
+
256
+ Code clinical text to WHO ICF categories, look up codes, search, and access ICF Core Sets for 12+ conditions.
257
+
258
+ ```typescript
259
+ // Code clinical text to ICF categories
260
+ const icf = await client.icf.code("Patient with stroke and hemiplegia");
261
+ console.log(icf.results[0].codes);
262
+ // [{ code: "b730", description: "Muscle power functions", component: "b", ... }]
263
+
264
+ // Look up an ICF code
265
+ const code = await client.icf.lookup("d450");
266
+ console.log(code.title); // "Walking"
267
+ console.log(code.definition); // "Moving along a surface on foot..."
268
+
269
+ // Search ICF codes
270
+ const results = await client.icf.search("mobility");
271
+
272
+ // Get ICF Core Set for a diagnosis
273
+ const coreSet = await client.icf.coreSet("E11.9");
274
+ console.log(coreSet.conditionName); // "Diabetes Mellitus"
275
+ console.log(coreSet.brief); // [{ code: "b530", title: "Weight maintenance functions", ... }]
276
+ ```
277
+
170
278
  ### PHI De-identification
171
279
 
172
280
  Strip protected health information from clinical notes before storage or analysis. HIPAA-compliant de-identification for names, dates, SSNs, phone numbers, emails, addresses, MRNs, and ages.
@@ -281,6 +389,10 @@ Full REST API documentation at [autoicdapi.com/docs](https://autoicdapi.com/docs
281
389
  | `autoicd.icd10.get(code)` | Get details for an ICD-10-CM code (incl. ICD-11 crosswalk) |
282
390
  | `autoicd.icd11.search(query, options?)` | Search ICD-11 codes by description |
283
391
  | `autoicd.icd11.get(code)` | Get details for an ICD-11 code (incl. ICD-10 crosswalk) |
392
+ | `autoicd.icf.code(text, options?)` | Code clinical text to ICF functioning categories |
393
+ | `autoicd.icf.lookup(code)` | Get details for an ICF code |
394
+ | `autoicd.icf.search(query, options?)` | Search ICF codes by keyword |
395
+ | `autoicd.icf.coreSet(icd10Code)` | Get ICF Core Set for an ICD-10 diagnosis |
284
396
 
285
397
  ---
286
398
 
@@ -303,6 +415,10 @@ import type {
303
415
  ICD11CodeDetailFull,
304
416
  ICD11CodeSearchResponse,
305
417
  CrosswalkMapping,
418
+ ICFCodingResponse,
419
+ ICFCodeDetail,
420
+ ICFCodeSearchResponse,
421
+ ICFCoreSetResponse,
306
422
  } from "autoicd";
307
423
  ```
308
424