@pipeworx/mcp-medicare-pricing 0.1.6 → 0.2.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/tools.json ADDED
@@ -0,0 +1,262 @@
1
+ [
2
+ {
3
+ "name": "medicare_physician_payment",
4
+ "description": "What does Medicare pay a doctor for a procedure code, in a specific place? Returns the relative value units (work, practice expense, malpractice) and the actual dollar payment for a HCPCS/CPT code, adjusted for the Medicare LOCALITY — payment varies geographically, not just by state. Answers \"how much does Medicare pay for 99213\", \"what is code 27130 worth in Los Angeles\", \"reimbursement rate for an office visit in Texas\", and fee-schedule or contract-rate benchmarking. Gives both the facility and non-facility amount (a procedure pays less in a hospital, because the hospital bills the overhead separately), the global period, and the status code saying whether the code is separately payable at all. States the fee-schedule YEAR and the locality it resolved to on every response, because a rate quoted for the wrong year or locality is a wrong number. Sourced from the CMS Physician Fee Schedule relative value files.",
5
+ "inputSchema": {
6
+ "type": "object",
7
+ "properties": {
8
+ "code": {
9
+ "type": "string",
10
+ "description": "HCPCS or CPT code, e.g. \"99213\" (office visit) or \"27130\" (hip replacement)."
11
+ },
12
+ "locality": {
13
+ "type": "string",
14
+ "description": "Where the service is provided — a state code (\"CA\"), state name, or Medicare locality name (\"Bakersfield\", \"Manhattan\"). Payment varies by locality; omit only if you want the national picture."
15
+ },
16
+ "year": {
17
+ "type": "number",
18
+ "description": "Fee-schedule year, e.g. 2026. Omit to use the newest loaded year, which is stated in the response."
19
+ },
20
+ "modifier": {
21
+ "type": "string",
22
+ "description": "Optional HCPCS modifier, e.g. \"26\" (professional component) or \"TC\" (technical component)."
23
+ }
24
+ },
25
+ "required": [
26
+ "code"
27
+ ]
28
+ }
29
+ },
30
+ {
31
+ "name": "medicare_lab_rate",
32
+ "description": "What does Medicare pay for a laboratory test? Returns the national Clinical Laboratory Fee Schedule rate for a lab HCPCS/CPT code — lab tests are paid from their own national fee schedule rather than the physician schedule, so there is one rate and no locality adjustment. Answers \"how much does Medicare pay for a comprehensive metabolic panel\", \"CLFS rate for 80053\", \"what does a lipid panel reimburse\". States the year and quarter of the schedule used, since lab rates are republished quarterly. Sourced from the CMS Clinical Laboratory Fee Schedule.",
33
+ "inputSchema": {
34
+ "type": "object",
35
+ "properties": {
36
+ "code": {
37
+ "type": "string",
38
+ "description": "Lab HCPCS/CPT code, e.g. \"80053\" (comprehensive metabolic panel) or \"85025\" (complete blood count)."
39
+ },
40
+ "year": {
41
+ "type": "number",
42
+ "description": "Schedule year. Omit for the newest loaded, which is stated in the response."
43
+ }
44
+ },
45
+ "required": [
46
+ "code"
47
+ ]
48
+ }
49
+ },
50
+ {
51
+ "name": "medicare_lab_test_lookup",
52
+ "description": "Resolve a branded molecular or genomic lab test by its commercial name (e.g. Signatera, Guardant360 CDx, FoundationOne CDx, FoundationOne Liquid CDx, Tempus xT CDx, DecisionDx-Melanoma, Envisia, Shield) to its CPT PLA / HCPCS billing code, the lab that runs it, what Medicare pays for it now on the Clinical Laboratory Fee Schedule, and the MolDX local coverage determinations (LCDs) and billing-and-coding articles for its test category. Answers \"what does Medicare pay for Signatera\", \"what is the PLA code for Guardant360\", \"which MolDX LCD covers this test\". Also accepts a lab name (e.g. \"Natera\") or a code. Also covers non-ADLT branded MAAA tests (Oncotype DX, Prosigna, MammaPrint, EndoPredict, Breast Cancer Index, Cologuard, Prolaris, Decipher, Afirma, ConfirmMDx, 4Kscore) and any test whose lab registered its code in the NCBI Genetic Testing Registry. Resolves in order: the CMS list of Advanced Diagnostic Laboratory Tests (ADLTs), a brand-to-code table of MAAA tests with MolDX billing articles, then NCBI GTR live; a test found in none returns brand_not_found naming every source checked. Sourced from CMS (ADLT list, Clinical Laboratory Fee Schedule, Medicare Coverage Database) and NCBI GTR.",
53
+ "inputSchema": {
54
+ "type": "object",
55
+ "properties": {
56
+ "test": {
57
+ "type": "string",
58
+ "description": "The test's brand or commercial name (\"Signatera\", \"Guardant360 CDx\"), the lab (\"Natera\"), or its code (\"0340U\")."
59
+ },
60
+ "include_retired": {
61
+ "type": "boolean",
62
+ "description": "Also list retired LCDs/articles for the test category (default false). Contractors re-issue MolDX policies under new numbers, so an older citation may be a retired document."
63
+ }
64
+ },
65
+ "required": [
66
+ "test"
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "name": "medicare_dmepos_rate",
72
+ "description": "What does Medicare pay for a piece of durable medical equipment, prosthetic, orthotic, or medical supply (DMEPOS)? Returns the fee-schedule amount for a HCPCS Level II code (E/K/L/A-codes — CPAP machines, wheelchairs, ostomy supplies, braces, oxygen equipment...) in a given US state, with SEPARATE rural and non-rural amounts, since Medicare pays DMEPOS by state rather than by the physician-fee-schedule locality. Answers \"how much does Medicare pay for a CPAP machine (E0601)\", \"DMEPOS rate for a wheelchair in Texas\", \"what is the rural rate for this HCPCS code in Montana\". Unlike medicare_physician_payment, this DOES include the HCPCS code description — DMEPOS uses HCPCS Level II, which CMS itself maintains and is not AMA copyright (CPT/HCPCS Level I is). States the fee-schedule YEAR and RELEASE (quarterly-ish: A=January, B=April, C=July, D=October) used on every response, and the modifier resolved (many DMEPOS codes price differently for rental \"RR\" vs. new purchase \"NU\" vs. used \"UE\" — pass one if you know it, otherwise the first modifier on file for the code is used and stated).",
73
+ "inputSchema": {
74
+ "type": "object",
75
+ "properties": {
76
+ "code": {
77
+ "type": "string",
78
+ "description": "HCPCS Level II code, e.g. \"E0601\" (CPAP device) or \"E1390\" (oxygen concentrator)."
79
+ },
80
+ "state": {
81
+ "type": "string",
82
+ "description": "US state, DC, or territory (PR/VI) where the equipment is furnished — a 2-letter code (\"TX\") or full name (\"Texas\"). DMEPOS is priced by STATE, not by Medicare locality. Omit only for the raw record without a resolved dollar amount."
83
+ },
84
+ "modifier": {
85
+ "type": "string",
86
+ "description": "Optional HCPCS modifier, e.g. \"RR\" (rental), \"NU\" (purchase, new), \"UE\" (purchase, used). Many DMEPOS codes are priced only under one modifier; omit to use whichever is on file (stated in the response)."
87
+ },
88
+ "year": {
89
+ "type": "number",
90
+ "description": "Fee-schedule year, e.g. 2026. Omit to use the newest loaded year, which is stated in the response."
91
+ },
92
+ "release": {
93
+ "type": "string",
94
+ "description": "Quarterly release letter within the year: \"A\" (Jan), \"B\" (Apr), \"C\" (Jul), or \"D\" (Oct). Omit to use the newest loaded release for the resolved year."
95
+ }
96
+ },
97
+ "required": [
98
+ "code"
99
+ ]
100
+ }
101
+ },
102
+ {
103
+ "name": "medicare_opps_rate",
104
+ "description": "What does Medicare pay a HOSPITAL OUTPATIENT department for a procedure, device, or drug code? Returns the status indicator, Ambulatory Payment Classification (APC), relative weight, national payment rate, and beneficiary copayment for a HCPCS/CPT code under the Hospital Outpatient Prospective Payment System (OPPS) — the schedule that applies when the same service is billed by a hospital's outpatient department rather than a physician office (medicare_physician_payment) or a lab (medicare_lab_rate). Answers \"what does Medicare pay for CPT 33289 in a hospital outpatient setting\", \"what is the APC for C2624\", \"is this device on pass-through status\", \"what is the OPPS payment rate and copay for this code\". Flags device_pass_through and drug_or_biological_pass_through — whether the code is CURRENTLY in a CMS pass-through category (status indicator H or G), meaning it is paid separately, outside the normal APC amount, rather than packaged into the procedure it goes with. A packaged code (status indicator N, among others) still has a valid status_indicator but no apc/payment_rate_usd, because OPPS pays for it only as part of whatever procedure it is billed with — that is a normal result, not a missing one. States the fee-schedule YEAR and QUARTER (Q1=Jan, Q2=Apr, Q3=Jul, Q4=Oct) used on every response. Sourced from CMS, OPPS Addendum B.",
105
+ "inputSchema": {
106
+ "type": "object",
107
+ "properties": {
108
+ "code": {
109
+ "type": "string",
110
+ "description": "HCPCS or CPT code, e.g. \"33289\" (CardioMEMS implant procedure) or \"C2624\" (implantable wireless pulmonary artery pressure sensor)."
111
+ },
112
+ "year": {
113
+ "type": "number",
114
+ "description": "Calendar year, e.g. 2026. Omit to use the newest loaded year, which is stated in the response."
115
+ },
116
+ "quarter": {
117
+ "type": "string",
118
+ "description": "Which quarterly release: \"Q1\"..\"Q4\", or the release month CMS actually uses (\"january\"/\"april\"/\"july\"/\"october\"). Omit to use the newest loaded quarter for the resolved year."
119
+ }
120
+ },
121
+ "required": [
122
+ "code"
123
+ ]
124
+ }
125
+ },
126
+ {
127
+ "name": "medicare_code_units_limit",
128
+ "description": "How many units of a procedure code will Medicare pay for one patient in one day? Returns the NCCI Medically Unlikely Edit (MUE) — the maximum units allowed — with the adjudication indicator saying whether the limit is absolute or can be overridden with documentation, and the rationale for it. Answers \"what is the MUE for 99213\", \"how many units of this code can I bill\", \"why was my claim denied for units\". Available for practitioner, outpatient hospital and DME settings, which have different limits for the same code. States the quarterly edit vintage in force. Sourced from the CMS National Correct Coding Initiative.",
129
+ "inputSchema": {
130
+ "type": "object",
131
+ "properties": {
132
+ "code": {
133
+ "type": "string",
134
+ "description": "HCPCS/CPT code, e.g. \"99213\"."
135
+ },
136
+ "setting": {
137
+ "type": "string",
138
+ "description": "Which MUE table: \"practitioner\" (default), \"outpatient_hospital\", or \"dme\". The same code can carry different limits in each."
139
+ }
140
+ },
141
+ "required": [
142
+ "code"
143
+ ]
144
+ }
145
+ },
146
+ {
147
+ "name": "check_code_pair",
148
+ "description": "Can two procedure codes be billed together on the same day? Checks the CMS National Correct Coding Initiative procedure-to-procedure (PTP) edit for a pair of HCPCS/CPT codes and returns the modifier indicator saying whether the pair can never be unbundled, can be unbundled with an appropriate modifier and documentation, or carries no edit in the loaded data. Answers \"can I bill 99214 and 93000 together\", \"is there an NCCI edit between these two codes\", \"do I need a modifier for this code combination\". Built from CMS's FULL NCCI PTP edit baseline (2026q3, v322r0), not just a rolling change window — a pair not found here has never had a CMS-recorded PTP edit as of the loaded vintage. The response always states the loaded vintage and setting resolved.",
149
+ "inputSchema": {
150
+ "type": "object",
151
+ "properties": {
152
+ "code_a": {
153
+ "type": "string",
154
+ "description": "First HCPCS/CPT code, e.g. \"99214\"."
155
+ },
156
+ "code_b": {
157
+ "type": "string",
158
+ "description": "Second HCPCS/CPT code, e.g. \"93000\"."
159
+ },
160
+ "setting": {
161
+ "type": "string",
162
+ "description": "Which edit table: \"practitioner\" (default) or \"hospital\" (outpatient facility). Edits can differ between them."
163
+ }
164
+ },
165
+ "required": [
166
+ "code_a",
167
+ "code_b"
168
+ ]
169
+ }
170
+ },
171
+ {
172
+ "name": "explain_ncci_edit",
173
+ "description": "What NCCI procedure-to-procedure edits exist for a single code? Lists the other codes this HCPCS/CPT code has a recorded PTP edit with — whether it is the code you bill (Column 1) or the one bundled into another (Column 2) — with each pair's modifier indicator. Answers \"what codes conflict with 99214\", \"what is bundled into this procedure\", \"why would this code be denied when billed with something else\". Same full-baseline coverage as check_code_pair (CMS's FULL NCCI PTP edit baseline, 2026q3 v322r0, not just a rolling change window) — an empty result means no PTP edit has ever been recorded for this code, not merely \"no recent change\".",
174
+ "inputSchema": {
175
+ "type": "object",
176
+ "properties": {
177
+ "code": {
178
+ "type": "string",
179
+ "description": "HCPCS/CPT code, e.g. \"99214\"."
180
+ },
181
+ "setting": {
182
+ "type": "string",
183
+ "description": "Which edit table: \"practitioner\" (default) or \"hospital\"."
184
+ },
185
+ "status": {
186
+ "type": "string",
187
+ "description": "Filter to \"active\" (default — currently in effect) or \"all\" (include deleted edits too)."
188
+ }
189
+ },
190
+ "required": [
191
+ "code"
192
+ ]
193
+ }
194
+ },
195
+ {
196
+ "name": "medicare_fqhc_pps_rate",
197
+ "description": "What does Medicare pay a Federally Qualified Health Center (FQHC) per visit? Returns the CMS FQHC Prospective Payment System (PPS) national BASE payment rate for a calendar year — the figure CMS publishes once a year, before any per-FQHC Geographic Adjustment Factor (GAF) is applied. Answers \"what is the FQHC PPS base rate\", \"how much does Medicare pay an FQHC per encounter\", \"FQHC PPS rate for 2025 vs 2026\". Medicare pays an FQHC the LESSER of its actual charges or this PPS rate for all FQHC services furnished to a beneficiary on a day with a qualifying face-to-face visit — it is a per-DAY encounter rate, not a fee per procedure code (unlike medicare_physician_payment/medicare_lab_rate). This tool returns only the national base rate before the geographic adjustment; for the GAF-adjusted amount in a named locality use medicare_fqhc_gaf. Omit year for the newest loaded year plus the full known history (small — CMS publishes one number a year); pass year for one row.",
198
+ "inputSchema": {
199
+ "type": "object",
200
+ "properties": {
201
+ "year": {
202
+ "type": "number",
203
+ "description": "Calendar year, e.g. 2026. Omit to get the newest loaded year AND the full history table."
204
+ }
205
+ }
206
+ }
207
+ },
208
+ {
209
+ "name": "medicare_gpci_lookup",
210
+ "description": "What are the Medicare geographic adjustment indices (GPCIs) for a place — with NO procedure code needed? Returns the work, practice-expense and malpractice GPCI for a Medicare payment locality (or every locality in a state), for a calendar year. Answers \"GPCI for Rest of Florida locality 99\", \"Medicare geographic practice cost index for San Francisco\", \"work GPCI Manhattan 2025\", \"which Medicare localities does California have\". Medicare pays by LOCALITY, not state (California has nine), so a state or ambiguous name returns every matching locality rather than one chosen quietly, and the resolution is stated. The work GPCI is the floored value CMS pays on (1.0 floor where it applies). Pass state (\"FL\" or \"Florida\"), a locality name (\"Bakersfield\"), and/or locality_number (\"99\"); year defaults to the newest loaded and is stated. For the FQHC-specific adjustment see medicare_fqhc_gaf; for a dollar payment see medicare_physician_payment. Sourced from the CMS Physician Fee Schedule geographic practice cost indices.",
211
+ "inputSchema": {
212
+ "type": "object",
213
+ "properties": {
214
+ "locality": {
215
+ "type": "string",
216
+ "description": "State code (\"FL\"), state name (\"Florida\"), or Medicare locality name (\"Bakersfield\", \"Manhattan\", \"Rest of Florida\")."
217
+ },
218
+ "state": {
219
+ "type": "string",
220
+ "description": "Optional state code or name; combine with locality_number to pin one locality."
221
+ },
222
+ "locality_number": {
223
+ "type": "string",
224
+ "description": "Optional Medicare locality number, e.g. \"99\" (Rest of Florida) — needs state or locality to say which state."
225
+ },
226
+ "year": {
227
+ "type": "number",
228
+ "description": "Calendar year, e.g. 2025. Omit for the newest loaded year (stated in the response)."
229
+ }
230
+ }
231
+ }
232
+ },
233
+ {
234
+ "name": "medicare_fqhc_gaf",
235
+ "description": "What is the FQHC Geographic Adjustment Factor (GAF) for a place, and what does Medicare pay a Federally Qualified Health Center per visit THERE? Returns the official CMS FQHC PPS GAF for a Medicare locality and calendar year, and the GAF-adjusted per-visit rate (national base rate x GAF). Answers \"FQHC PPS GAF for Orlando, Florida 2025\", \"CY2026 FQHC geographic adjustment Rest of California\", \"what is the FQHC PPS rate in Alaska\". The GAF is CMS's own published number per locality (adapted from the work and practice-expense GPCIs, with the 1.0 floor), not something this tool estimates. A state returns all its localities; a city is not a locality, so name the locality or pick from the list (Florida has Fort Lauderdale, Miami and Rest of Florida). Complements medicare_fqhc_pps_rate (national base rate) and medicare_gpci_lookup (the underlying GPCIs). Years 2018-2026 loaded; the GAF-adjusted rate is returned for 2022-2026 (years whose national base rate this pack carries) and is null with a stated reason for 2018-2021. Sourced from the CMS FQHC PPS geographic adjustment factor tables.",
236
+ "inputSchema": {
237
+ "type": "object",
238
+ "properties": {
239
+ "locality": {
240
+ "type": "string",
241
+ "description": "State code (\"FL\"), state name (\"Florida\"), or Medicare locality name (\"Fort Lauderdale\", \"Rest of Florida\"). A bare state returns all of its localities."
242
+ },
243
+ "locality_number": {
244
+ "type": "string",
245
+ "description": "Optional Medicare locality number, e.g. \"99\"; with a state it pins one locality."
246
+ },
247
+ "year": {
248
+ "type": "number",
249
+ "description": "Calendar year, 2018-2026. Omit for the newest loaded year (stated in the response)."
250
+ }
251
+ }
252
+ }
253
+ },
254
+ {
255
+ "name": "medicare_pricing_coverage",
256
+ "description": "What Medicare pricing data is loaded and how current it is: the fee-schedule years and quarters held, how many codes are in each dataset, how many localities, and the PTP pair-edit change window. Use to check a vintage is current enough to quote before relying on a rate, and to see the scope limit on check_code_pair / explain_ncci_edit — they see only pairs that changed within the loaded quarterly window, not the full AMA-licence-gated PTP baseline.",
257
+ "inputSchema": {
258
+ "type": "object",
259
+ "properties": {}
260
+ }
261
+ }
262
+ ]
package/src/adlt.ts DELETED
@@ -1,96 +0,0 @@
1
- /**
2
- * CMS's list of Advanced Diagnostic Laboratory Tests (ADLTs) — the one public,
3
- * licence-clean list that maps a lab test's BRAND name to its billing code
4
- * (fleet #2426: "Signatera" -> 0340U).
5
- *
6
- * Source: https://www.cms.gov/files/document/advanced-diagnostic-laboratory-tests-under-medicare-clfs.pdf
7
- * (linked from cms.gov "ADLT Information"; embedded source name
8
- * "2025.3.10_List of Approved ADLTs.xlsx"; HTTP Last-Modified
9
- * Tue, 11 Mar 2025 15:10:55 GMT, 118,376 bytes — checked 2026-09-25).
10
- *
11
- * WHY IT IS BAKED, NOT FETCHED. The list is a two-page PDF that changes a few
12
- * times a year and has no API; the gateway carries no PDF parser. It is a US
13
- * federal work (17 USC 105), so a copy is fine (CLAUDE.md, "build the copy").
14
- * The refresh path is the live Last-Modified check in the tool itself
15
- * (SNAPSHOT_LAST_MODIFIED below): when CMS republishes, every response says
16
- * so, and the README section "ADLT list" says how to re-extract.
17
- *
18
- * WHAT IS NOT HERE. The PDF's "Test Descriptor" column is the AMA's CPT PLA
19
- * descriptor text ("CPT Copyright ... American Medical Association. All rights
20
- * reserved") — the same text this pack already refuses to store. Only the CMS
21
- * facts are kept: code, lab, proprietary test name, approval date, the new-ADLT
22
- * initial period and its payment.
23
- *
24
- * `coverage_topic` is OURS, not CMS's: a phrase that matches the title of the
25
- * MolDX LCD / billing article for the test's category (each checked against the
26
- * live LCD title list on 2026-09-25). It finds the policy family; whether this
27
- * specific test is listed in the article's code table is a separate question
28
- * the article answers. null where no local policy title fits.
29
- */
30
-
31
- export interface AdltTest {
32
- code: string;
33
- code_note: string | null;
34
- lab: string;
35
- test_name: string;
36
- aliases: string[];
37
- adlt_approval_date: string;
38
- new_adlt_initial_period: string | null;
39
- initial_period_payment_usd: number | null;
40
- existing_adlt: boolean;
41
- coverage_topic: string | null;
42
- }
43
-
44
- export const ADLT_SOURCE_URL = 'https://www.cms.gov/files/document/advanced-diagnostic-laboratory-tests-under-medicare-clfs.pdf';
45
- export const ADLT_DATA_AS_OF = '2025-03-10';
46
- export const SNAPSHOT_LAST_MODIFIED = 'Tue, 11 Mar 2025 15:10:55 GMT';
47
-
48
- export const ADLT_TESTS: AdltTest[] = [
49
- { code: '0537U', code_note: null, lab: 'Guardant Health, Inc.', test_name: 'Shield', aliases: ['Guardant Shield'], adlt_approval_date: '2025-03-10', new_adlt_initial_period: '2025-04-01 to 2025-12-31', initial_period_payment_usd: 1495, existing_adlt: false, coverage_topic: null },
50
- { code: '0473U', code_note: null, lab: 'Tempus AI, Inc.', test_name: 'xT CDx', aliases: ['Tempus xT', 'Tempus xT CDx'], adlt_approval_date: '2024-06-26', new_adlt_initial_period: '2024-07-01 to 2025-03-31', initial_period_payment_usd: 4500, existing_adlt: false, coverage_topic: 'Next-Generation Sequencing for Solid Tumors' },
51
- { code: '0356U', code_note: null, lab: 'Naveris, Inc.', test_name: 'NavDx', aliases: [], adlt_approval_date: '2024-03-18', new_adlt_initial_period: '2024-04-01 to 2024-12-31', initial_period_payment_usd: 1800, existing_adlt: false, coverage_topic: 'Minimal Residual Disease' },
52
- { code: '0315U', code_note: null, lab: 'Castle Biosciences, Inc.', test_name: 'DecisionDx-SCC', aliases: ['DecisionDx SCC'], adlt_approval_date: '2023-06-30', new_adlt_initial_period: '2023-07-01 to 2024-03-31', initial_period_payment_usd: 8500, existing_adlt: false, coverage_topic: 'Risk Stratification of Cutaneous Squamous Cell Carcinoma' },
53
- { code: '0360U', code_note: null, lab: 'Biodesix, Inc.', test_name: 'Nodify CDT', aliases: [], adlt_approval_date: '2023-06-30', new_adlt_initial_period: null, initial_period_payment_usd: null, existing_adlt: true, coverage_topic: null },
54
- { code: '0295U', code_note: null, lab: 'Prelude Corporation', test_name: 'DCISionRT', aliases: [], adlt_approval_date: '2023-03-23', new_adlt_initial_period: '2023-04-01 to 2023-12-31', initial_period_payment_usd: 5435, existing_adlt: false, coverage_topic: null },
55
- { code: '0108U', code_note: null, lab: 'Castle Biosciences, Inc. / Cernostics, Inc.', test_name: "TissueCypher Barrett's Esophagus Assay", aliases: ['TissueCypher'], adlt_approval_date: '2022-03-24', new_adlt_initial_period: '2022-04-01 to 2022-12-31', initial_period_payment_usd: 2350, existing_adlt: false, coverage_topic: 'Upper Gastrointestinal Metaplasia, Dysplasia, and Neoplasia' },
56
- { code: '0340U', code_note: null, lab: 'Natera, Inc.', test_name: 'Signatera', aliases: [], adlt_approval_date: '2021-06-17', new_adlt_initial_period: '2021-07-01 to 2022-03-31', initial_period_payment_usd: 3500, existing_adlt: false, coverage_topic: 'Minimal Residual Disease' },
57
- { code: '0242U', code_note: null, lab: 'Guardant Health, Inc.', test_name: 'Guardant360 CDx', aliases: ['Guardant360', 'Guardant 360'], adlt_approval_date: '2021-03-18', new_adlt_initial_period: '2021-04-01 to 2021-12-31', initial_period_payment_usd: 5000, existing_adlt: false, coverage_topic: 'Plasma-Based Genomic Profiling in Solid Tumors' },
58
- { code: '0239U', code_note: null, lab: 'Foundation Medicine, Inc.', test_name: 'FoundationOne Liquid CDx', aliases: ['F1 Liquid CDx', 'FoundationOne Liquid'], adlt_approval_date: '2021-01-25', new_adlt_initial_period: '2021-04-01 to 2021-12-31', initial_period_payment_usd: 3500, existing_adlt: false, coverage_topic: 'Plasma-Based Genomic Profiling in Solid Tumors' },
59
- { code: '81554', code_note: 'Effective 2021-01-01', lab: 'Veracyte', test_name: 'Envisia Genomic Classifier', aliases: ['Envisia'], adlt_approval_date: '2020-09-17', new_adlt_initial_period: '2020-10-01 to 2021-06-30', initial_period_payment_usd: 5500, existing_adlt: false, coverage_topic: 'Idiopathic Pulmonary Fibrosis' },
60
- { code: '0172U', code_note: 'Effective 2020-07-01', lab: 'Myriad', test_name: 'myChoice CDx', aliases: ['Myriad myChoice'], adlt_approval_date: '2019-12-11', new_adlt_initial_period: '2020-01-01 to 2020-09-30', initial_period_payment_usd: 4040, existing_adlt: false, coverage_topic: 'Next-Generation Sequencing for Solid Tumors' },
61
- { code: '0090U', code_note: null, lab: 'Myriad', test_name: 'myPath Melanoma', aliases: ['Myriad myPath'], adlt_approval_date: '2019-09-06', new_adlt_initial_period: '2019-10-01 to 2020-06-30', initial_period_payment_usd: 1950, existing_adlt: false, coverage_topic: 'Molecular Assays for the Diagnosis of Cutaneous Melanoma' },
62
- { code: '0080U', code_note: null, lab: 'Biodesix, Inc.', test_name: 'BDX-XL2', aliases: ['BDX XL2'], adlt_approval_date: '2019-05-17', new_adlt_initial_period: '2019-07-01 to 2020-03-31', initial_period_payment_usd: 3520, existing_adlt: false, coverage_topic: null },
63
- { code: '81529', code_note: 'Effective 2021-01-01', lab: 'Castle Biosciences, Inc.', test_name: 'DecisionDx-Melanoma', aliases: ['DecisionDx Melanoma'], adlt_approval_date: '2019-05-17', new_adlt_initial_period: '2019-07-01 to 2020-03-31', initial_period_payment_usd: 7193, existing_adlt: false, coverage_topic: 'Melanoma Risk Stratification' },
64
- { code: '81552', code_note: 'Effective 2020-01-01; CMS lists an earlier code for this test ("Previously ...")', lab: 'Castle Biosciences, Inc.', test_name: 'DecisionDx-UM', aliases: ['DecisionDx UM', 'Decision Dx-UM'], adlt_approval_date: '2019-05-17', new_adlt_initial_period: null, initial_period_payment_usd: null, existing_adlt: true, coverage_topic: 'Uveal Melanoma' },
65
- { code: '81538', code_note: null, lab: 'Biodesix, Inc.', test_name: 'VeriStrat', aliases: [], adlt_approval_date: '2018-12-21', new_adlt_initial_period: null, initial_period_payment_usd: null, existing_adlt: true, coverage_topic: null },
66
- { code: '0037U', code_note: null, lab: 'Foundation Medicine, Inc.', test_name: 'FoundationOne CDx', aliases: ['F1CDx', 'F1 CDx'], adlt_approval_date: '2018-05-18', new_adlt_initial_period: '2018-07-01 to 2019-03-31', initial_period_payment_usd: 3500, existing_adlt: false, coverage_topic: 'Next-Generation Sequencing for Solid Tumors' },
67
- ];
68
-
69
- const norm = (s: string) => s.toLowerCase().replace(/[^a-z0-9]/g, '');
70
-
71
- /**
72
- * Match a caller's free text to ADLT rows: by code, then by test name/alias
73
- * (either contains the other, so "Signatera MRD test" still resolves), then by
74
- * lab. A test-name hit wins over a lab hit — "Guardant360" must not return
75
- * Shield just because both are Guardant's.
76
- */
77
- export function matchAdlt(query: string): { matched_by: 'code' | 'test_name' | 'lab' | null; tests: AdltTest[] } {
78
- const q = norm(query);
79
- if (q.length < 3) return { matched_by: null, tests: [] };
80
- const byCode = ADLT_TESTS.filter((t) => norm(t.code) === q);
81
- if (byCode.length) return { matched_by: 'code', tests: byCode };
82
- const names = (t: AdltTest) => [t.test_name, ...t.aliases].map(norm);
83
- const exact = ADLT_TESTS.filter((t) => names(t).includes(q));
84
- if (exact.length) return { matched_by: 'test_name', tests: exact };
85
- const byName = ADLT_TESTS.filter((t) => names(t).some((n) => n.length >= 4 && (n.includes(q) || q.includes(n))));
86
- if (byName.length) {
87
- // "Guardant360 CDx" contains "guardant360", and so does nothing else; but a
88
- // query that CONTAINS two names ("FoundationOne CDx") keeps only the longest.
89
- const longest = Math.max(...byName.map((t) => Math.max(...names(t).filter((n) => q.includes(n)).map((n) => n.length), 0)));
90
- const narrowed = longest > 0 ? byName.filter((t) => names(t).some((n) => n.length === longest && q.includes(n))) : byName;
91
- return { matched_by: 'test_name', tests: narrowed };
92
- }
93
- const byLab = ADLT_TESTS.filter((t) => q.length >= 4 && norm(t.lab).includes(q));
94
- if (byLab.length) return { matched_by: 'lab', tests: byLab };
95
- return { matched_by: null, tests: [] };
96
- }
@@ -1,113 +0,0 @@
1
- /**
2
- * Branded lab tests that are NOT ADLTs but carry their own code (fleet #2458).
3
- *
4
- * #2426 resolved brand names only through the CMS ADLT list, so the most-asked
5
- * branded test of all -- Oncotype DX, a Category I MAAA code (81519) -- came
6
- * back found:false. Two more sources close the class:
7
- *
8
- * 1. THIS TABLE: the Category I MAAA tests whose proprietary name is tied to
9
- * its code in CPT Appendix O, each also the subject of a brand-named MolDX
10
- * billing-and-coding article on the CMS Medicare Coverage Database. What is
11
- * kept is the FACT (brand -> code -> lab), never the AMA descriptor text,
12
- * under the same rule as adlt.ts. Every code here was checked on
13
- * 2026-09-26 to carry a rate on the loaded CLFS.
14
- * 2. NCBI GTR (Genetic Testing Registry), fetched LIVE per request: labs
15
- * register their tests there and many state the CPT code. US government
16
- * work, keyless E-utilities. It is lab-reported, so the answer says so.
17
- *
18
- * `coverage_topic` is a phrase from the title of the test's MolDX policy (a
19
- * brand-named billing article where one exists), matched live against the CMS
20
- * Coverage API title list -- ours, not CMS's, checked 2026-09-26.
21
- */
22
-
23
- export interface BrandTest {
24
- code: string;
25
- lab: string;
26
- test_name: string;
27
- aliases: string[];
28
- coverage_topic: string | null;
29
- }
30
-
31
- export const BRAND_SOURCE = 'CPT Appendix O (MAAA) proprietary-name-to-code pairs, each with a brand-named or category MolDX billing article on the CMS Medicare Coverage Database';
32
- export const BRAND_DATA_AS_OF = '2026-09-26';
33
-
34
- export const BRAND_TESTS: BrandTest[] = [
35
- { code: '81519', lab: 'Genomic Health (Exact Sciences)', test_name: 'Oncotype DX Breast Recurrence Score', aliases: ['Oncotype DX', 'Oncotype DX Breast', 'Oncotype DX Breast Cancer Assay', 'Oncotype'], coverage_topic: 'Oncotype DX Breast Cancer Assay' },
36
- { code: '0045U', lab: 'Genomic Health (Exact Sciences)', test_name: 'Oncotype DX Breast DCIS Score', aliases: ['Oncotype DX DCIS', 'Oncotype DCIS'], coverage_topic: 'Oncotype DX Breast Cancer for DCIS' },
37
- { code: '81525', lab: 'Genomic Health (Exact Sciences)', test_name: 'Oncotype DX Colon Recurrence Score', aliases: ['Oncotype DX Colon', 'Oncotype DX Colon Cancer Assay'], coverage_topic: 'Oncotype DX Colon Cancer' },
38
- { code: '0047U', lab: 'Genomic Health (Exact Sciences)', test_name: 'Oncotype DX Genomic Prostate Score', aliases: ['Oncotype DX Prostate', 'Genomic Prostate Score', 'Oncotype GPS'], coverage_topic: 'Prostate Cancer Genomic Classifier Assay' },
39
- { code: '81518', lab: 'Biotheranostics (Hologic)', test_name: 'Breast Cancer Index', aliases: ['BCI'], coverage_topic: 'Breast Cancer Index' },
40
- { code: '81520', lab: 'NanoString Technologies (Veracyte)', test_name: 'Prosigna', aliases: ['Prosigna Breast Cancer Prognostic Gene Signature Assay', 'PAM50'], coverage_topic: 'Prosigna' },
41
- { code: '81521', lab: 'Agendia', test_name: 'MammaPrint', aliases: [], coverage_topic: 'MammaPrint' },
42
- { code: '81522', lab: 'Myriad Genetics', test_name: 'EndoPredict', aliases: [], coverage_topic: 'EndoPredict' },
43
- { code: '81528', lab: 'Exact Sciences', test_name: 'Cologuard', aliases: [], coverage_topic: null },
44
- { code: '81541', lab: 'Myriad Genetics', test_name: 'Prolaris', aliases: [], coverage_topic: 'Prostate Cancer Genomic Classifier Assay' },
45
- { code: '81542', lab: 'Veracyte (Decipher Biosciences)', test_name: 'Decipher Prostate', aliases: ['Decipher', 'Decipher Prostate Genomic Classifier'], coverage_topic: 'Prostate Cancer Genomic Classifier Assay' },
46
- { code: '81546', lab: 'Veracyte', test_name: 'Afirma Genomic Sequencing Classifier', aliases: ['Afirma', 'Afirma GSC'], coverage_topic: 'Molecular Testing for Risk Stratification of Thyroid Nodules' },
47
- { code: '81551', lab: 'MDxHealth', test_name: 'ConfirmMDx', aliases: ['ConfirmMDx for Prostate Cancer'], coverage_topic: 'Molecular Biomarkers to Risk-Stratify Patients at Increased Risk for Prostate Cancer' },
48
- { code: '81539', lab: 'OPKO Health (BioReference)', test_name: '4Kscore', aliases: ['4K score', '4Kscore Test'], coverage_topic: 'Molecular Biomarkers to Risk-Stratify Patients at Increased Risk for Prostate Cancer' },
49
- ];
50
-
51
- export const norm = (s: string) => s.toLowerCase().replace(/[®™]/g, '').replace(/[^a-z0-9]/g, '');
52
-
53
- type Named = { code: string; test_name: string; aliases: string[]; lab: string };
54
-
55
- /**
56
- * Match free text to rows: by code, then exact name/alias, then containment
57
- * (either way, longest name wins so "Oncotype DX colon" is colon, not breast),
58
- * then lab. A name hit beats a lab hit.
59
- */
60
- export function matchTests<T extends Named>(rows: T[], query: string): { matched_by: 'code' | 'test_name' | 'lab' | null; tests: T[] } {
61
- const q = norm(query);
62
- if (q.length < 3) return { matched_by: null, tests: [] };
63
- const byCode = rows.filter((t) => norm(t.code) === q);
64
- if (byCode.length) return { matched_by: 'code', tests: byCode };
65
- const names = (t: T) => [t.test_name, ...t.aliases].map(norm);
66
- const exact = rows.filter((t) => names(t).includes(q));
67
- if (exact.length) return { matched_by: 'test_name', tests: exact };
68
- const byName = rows.filter((t) => names(t).some((n) => n.length >= 4 && (n.includes(q) || q.includes(n))));
69
- if (byName.length) {
70
- const longest = Math.max(...byName.map((t) => Math.max(...names(t).filter((n) => q.includes(n)).map((n) => n.length), 0)));
71
- const narrowed = longest > 0 ? byName.filter((t) => names(t).some((n) => n.length === longest && q.includes(n))) : byName;
72
- return { matched_by: 'test_name', tests: narrowed };
73
- }
74
- const byLab = rows.filter((t) => q.length >= 4 && norm(t.lab).includes(q));
75
- if (byLab.length) return { matched_by: 'lab', tests: byLab };
76
- return { matched_by: null, tests: [] };
77
- }
78
-
79
- export interface GtrHit { code: string; test_name: string; lab: string; gtr_accession: string; url: string }
80
-
81
- /**
82
- * NCBI GTR, live: tests whose registered name matches the query AND whose lab
83
- * stated a CPT code. null when NCBI did not answer (distinct from "no hit").
84
- */
85
- export async function gtrLookup(query: string, fetcher: typeof fetch): Promise<GtrHit[] | null> {
86
- const q = norm(query);
87
- if (q.length < 4) return [];
88
- const base = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils';
89
- const tool = '&tool=pipeworx&email=support%40pipeworx.io';
90
- try {
91
- const s = await fetcher(`${base}/esearch.fcgi?db=gtr&retmode=json&retmax=40&term=${encodeURIComponent(query)}${tool}`);
92
- if (!s.ok) return null;
93
- const ids = ((await s.json()) as { esearchresult?: { idlist?: string[] } }).esearchresult?.idlist ?? [];
94
- if (!ids.length) return [];
95
- const r = await fetcher(`${base}/esummary.fcgi?db=gtr&retmode=json&id=${ids.join(',')}${tool}`);
96
- if (!r.ok) return null;
97
- const res = ((await r.json()) as { result?: Record<string, any> }).result ?? {};
98
- const hits: GtrHit[] = [];
99
- for (const id of ids) {
100
- const x = res[id];
101
- if (!x || typeof x.testname !== 'string') continue;
102
- const n = norm(x.testname);
103
- if (!(n.includes(q) || (n.length >= 4 && q.includes(n)))) continue;
104
- const codes = String(x.cptcode ?? '').split(/[^0-9A-Za-z]+/).map((c: string) => c.toUpperCase()).filter((c: string) => /^(\d{5}|\d{4}U)$/.test(c));
105
- for (const code of codes) {
106
- hits.push({ code, test_name: x.testname, lab: String(x.offerer ?? ''), gtr_accession: String(x.accession ?? ''), url: `https://www.ncbi.nlm.nih.gov/gtr/tests/${id}/` });
107
- }
108
- }
109
- return hits;
110
- } catch {
111
- return null;
112
- }
113
- }