@sequoiaport/codes 0.1.2-beta.2 → 0.1.4-beta.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/dist/index.js CHANGED
@@ -28,6 +28,7 @@ __export(index_exports, {
28
28
  LifeExpectancyCategory: () => LifeExpectancyCategory,
29
29
  LoincCategory: () => LoincCategory,
30
30
  NcdCategory: () => NcdCategory,
31
+ NdcCategory: () => NdcCategory,
31
32
  RxnormCategory: () => RxnormCategory,
32
33
  SequoiaCodesClient: () => SequoiaCodesClient,
33
34
  SnomedCategory: () => SnomedCategory
@@ -350,6 +351,97 @@ var LifeExpectancyCategory = class {
350
351
  return this.request("lifeExpectancy/health", {});
351
352
  }
352
353
  };
354
+ var NdcLookupInputSchema = import_zod.z.object({
355
+ ndc: import_zod.z.string().min(1)
356
+ });
357
+ var NdcBatchLookupInputSchema = import_zod.z.object({
358
+ ndcs: import_zod.z.array(import_zod.z.string().min(1)).min(1).max(25)
359
+ });
360
+ var NdcSearchInputSchema = import_zod.z.object({
361
+ query: import_zod.z.string().min(1),
362
+ productType: import_zod.z.string().optional(),
363
+ limit: import_zod.z.number().int().min(1).max(100).optional()
364
+ });
365
+ var NdcFuzzySearchInputSchema = import_zod.z.object({
366
+ query: import_zod.z.string().min(1),
367
+ limit: import_zod.z.number().int().min(1).max(50).optional()
368
+ });
369
+ var NdcGetProductInputSchema = import_zod.z.object({
370
+ productNdc: import_zod.z.string().min(1)
371
+ });
372
+ var NdcGetLabelerInputSchema = import_zod.z.object({
373
+ labeler: import_zod.z.string().min(1),
374
+ limit: import_zod.z.number().int().min(1).max(100).optional()
375
+ });
376
+ var NdcGetPackagesInputSchema = import_zod.z.object({
377
+ productNdc: import_zod.z.string().min(1)
378
+ });
379
+ var NdcCrossRefInputSchema = import_zod.z.object({
380
+ ndc: import_zod.z.string().min(1)
381
+ });
382
+ var NdcCategory = class {
383
+ constructor(request) {
384
+ this.request = request;
385
+ }
386
+ async lookupNdc(input) {
387
+ const validated = NdcLookupInputSchema.parse(input);
388
+ return this.request("ndc/lookupNdc", {
389
+ ndc: validated.ndc
390
+ });
391
+ }
392
+ async lookupBatch(input) {
393
+ const validated = NdcBatchLookupInputSchema.parse(input);
394
+ return this.request("ndc/lookupBatch", {
395
+ ndcs: validated.ndcs
396
+ });
397
+ }
398
+ async searchProducts(input) {
399
+ const validated = NdcSearchInputSchema.parse(input);
400
+ return this.request("ndc/searchProducts", {
401
+ query: validated.query,
402
+ product_type: validated.productType,
403
+ limit: validated.limit
404
+ });
405
+ }
406
+ async searchFuzzy(input) {
407
+ const validated = NdcFuzzySearchInputSchema.parse(input);
408
+ return this.request("ndc/searchFuzzy", {
409
+ query: validated.query,
410
+ limit: validated.limit
411
+ });
412
+ }
413
+ async getProduct(input) {
414
+ const validated = NdcGetProductInputSchema.parse(input);
415
+ return this.request("ndc/getProduct", {
416
+ product_ndc: validated.productNdc
417
+ });
418
+ }
419
+ async getLabeler(input) {
420
+ const validated = NdcGetLabelerInputSchema.parse(input);
421
+ return this.request("ndc/getLabeler", {
422
+ labeler: validated.labeler,
423
+ limit: validated.limit
424
+ });
425
+ }
426
+ async getPackages(input) {
427
+ const validated = NdcGetPackagesInputSchema.parse(input);
428
+ return this.request("ndc/getPackages", {
429
+ product_ndc: validated.productNdc
430
+ });
431
+ }
432
+ async crossRefRxcui(input) {
433
+ const validated = NdcCrossRefInputSchema.parse(input);
434
+ return this.request("ndc/crossRefRxcui", {
435
+ ndc: validated.ndc
436
+ });
437
+ }
438
+ async getStats() {
439
+ return this.request("ndc/getStats", {});
440
+ }
441
+ async health() {
442
+ return this.request("ndc/health", {});
443
+ }
444
+ };
353
445
 
354
446
  // src/schemas/clinical.ts
355
447
  var import_zod2 = require("zod");
@@ -469,6 +561,8 @@ var SequoiaCodesClient = class {
469
561
  loinc;
470
562
  /** RxNorm drug/medication codes */
471
563
  rxnorm;
564
+ /** FDA NDC Directory - drug product identification (133K products, 248K packages) */
565
+ ndc;
472
566
  // ==========================================================================
473
567
  // Actuarial / Reference Data Categories
474
568
  // ==========================================================================
@@ -494,6 +588,7 @@ var SequoiaCodesClient = class {
494
588
  this.hcpcs = new HcpcsCategory(boundRequest);
495
589
  this.loinc = new LoincCategory(boundRequest);
496
590
  this.rxnorm = new RxnormCategory(boundRequest);
591
+ this.ndc = new NdcCategory(boundRequest);
497
592
  this.lifeExpectancy = new LifeExpectancyCategory(boundRequest);
498
593
  this.lcd = new LcdCategory(boundRequest);
499
594
  this.ncd = new NcdCategory(boundRequest);
@@ -548,6 +643,7 @@ var SequoiaCodesClient = class {
548
643
  LifeExpectancyCategory,
549
644
  LoincCategory,
550
645
  NcdCategory,
646
+ NdcCategory,
551
647
  RxnormCategory,
552
648
  SequoiaCodesClient,
553
649
  SnomedCategory
package/dist/index.mjs CHANGED
@@ -314,6 +314,97 @@ var LifeExpectancyCategory = class {
314
314
  return this.request("lifeExpectancy/health", {});
315
315
  }
316
316
  };
317
+ var NdcLookupInputSchema = z.object({
318
+ ndc: z.string().min(1)
319
+ });
320
+ var NdcBatchLookupInputSchema = z.object({
321
+ ndcs: z.array(z.string().min(1)).min(1).max(25)
322
+ });
323
+ var NdcSearchInputSchema = z.object({
324
+ query: z.string().min(1),
325
+ productType: z.string().optional(),
326
+ limit: z.number().int().min(1).max(100).optional()
327
+ });
328
+ var NdcFuzzySearchInputSchema = z.object({
329
+ query: z.string().min(1),
330
+ limit: z.number().int().min(1).max(50).optional()
331
+ });
332
+ var NdcGetProductInputSchema = z.object({
333
+ productNdc: z.string().min(1)
334
+ });
335
+ var NdcGetLabelerInputSchema = z.object({
336
+ labeler: z.string().min(1),
337
+ limit: z.number().int().min(1).max(100).optional()
338
+ });
339
+ var NdcGetPackagesInputSchema = z.object({
340
+ productNdc: z.string().min(1)
341
+ });
342
+ var NdcCrossRefInputSchema = z.object({
343
+ ndc: z.string().min(1)
344
+ });
345
+ var NdcCategory = class {
346
+ constructor(request) {
347
+ this.request = request;
348
+ }
349
+ async lookupNdc(input) {
350
+ const validated = NdcLookupInputSchema.parse(input);
351
+ return this.request("ndc/lookupNdc", {
352
+ ndc: validated.ndc
353
+ });
354
+ }
355
+ async lookupBatch(input) {
356
+ const validated = NdcBatchLookupInputSchema.parse(input);
357
+ return this.request("ndc/lookupBatch", {
358
+ ndcs: validated.ndcs
359
+ });
360
+ }
361
+ async searchProducts(input) {
362
+ const validated = NdcSearchInputSchema.parse(input);
363
+ return this.request("ndc/searchProducts", {
364
+ query: validated.query,
365
+ product_type: validated.productType,
366
+ limit: validated.limit
367
+ });
368
+ }
369
+ async searchFuzzy(input) {
370
+ const validated = NdcFuzzySearchInputSchema.parse(input);
371
+ return this.request("ndc/searchFuzzy", {
372
+ query: validated.query,
373
+ limit: validated.limit
374
+ });
375
+ }
376
+ async getProduct(input) {
377
+ const validated = NdcGetProductInputSchema.parse(input);
378
+ return this.request("ndc/getProduct", {
379
+ product_ndc: validated.productNdc
380
+ });
381
+ }
382
+ async getLabeler(input) {
383
+ const validated = NdcGetLabelerInputSchema.parse(input);
384
+ return this.request("ndc/getLabeler", {
385
+ labeler: validated.labeler,
386
+ limit: validated.limit
387
+ });
388
+ }
389
+ async getPackages(input) {
390
+ const validated = NdcGetPackagesInputSchema.parse(input);
391
+ return this.request("ndc/getPackages", {
392
+ product_ndc: validated.productNdc
393
+ });
394
+ }
395
+ async crossRefRxcui(input) {
396
+ const validated = NdcCrossRefInputSchema.parse(input);
397
+ return this.request("ndc/crossRefRxcui", {
398
+ ndc: validated.ndc
399
+ });
400
+ }
401
+ async getStats() {
402
+ return this.request("ndc/getStats", {});
403
+ }
404
+ async health() {
405
+ return this.request("ndc/health", {});
406
+ }
407
+ };
317
408
 
318
409
  // src/schemas/clinical.ts
319
410
  import { z as z2 } from "zod";
@@ -433,6 +524,8 @@ var SequoiaCodesClient = class {
433
524
  loinc;
434
525
  /** RxNorm drug/medication codes */
435
526
  rxnorm;
527
+ /** FDA NDC Directory - drug product identification (133K products, 248K packages) */
528
+ ndc;
436
529
  // ==========================================================================
437
530
  // Actuarial / Reference Data Categories
438
531
  // ==========================================================================
@@ -458,6 +551,7 @@ var SequoiaCodesClient = class {
458
551
  this.hcpcs = new HcpcsCategory(boundRequest);
459
552
  this.loinc = new LoincCategory(boundRequest);
460
553
  this.rxnorm = new RxnormCategory(boundRequest);
554
+ this.ndc = new NdcCategory(boundRequest);
461
555
  this.lifeExpectancy = new LifeExpectancyCategory(boundRequest);
462
556
  this.lcd = new LcdCategory(boundRequest);
463
557
  this.ncd = new NcdCategory(boundRequest);
@@ -511,6 +605,7 @@ export {
511
605
  LifeExpectancyCategory,
512
606
  LoincCategory,
513
607
  NcdCategory,
608
+ NdcCategory,
514
609
  RxnormCategory,
515
610
  SequoiaCodesClient,
516
611
  SnomedCategory
package/dist/mcp.js CHANGED
@@ -322,6 +322,97 @@ var LifeExpectancyCategory = class {
322
322
  return this.request("lifeExpectancy/health", {});
323
323
  }
324
324
  };
325
+ var NdcLookupInputSchema = import_zod.z.object({
326
+ ndc: import_zod.z.string().min(1)
327
+ });
328
+ var NdcBatchLookupInputSchema = import_zod.z.object({
329
+ ndcs: import_zod.z.array(import_zod.z.string().min(1)).min(1).max(25)
330
+ });
331
+ var NdcSearchInputSchema = import_zod.z.object({
332
+ query: import_zod.z.string().min(1),
333
+ productType: import_zod.z.string().optional(),
334
+ limit: import_zod.z.number().int().min(1).max(100).optional()
335
+ });
336
+ var NdcFuzzySearchInputSchema = import_zod.z.object({
337
+ query: import_zod.z.string().min(1),
338
+ limit: import_zod.z.number().int().min(1).max(50).optional()
339
+ });
340
+ var NdcGetProductInputSchema = import_zod.z.object({
341
+ productNdc: import_zod.z.string().min(1)
342
+ });
343
+ var NdcGetLabelerInputSchema = import_zod.z.object({
344
+ labeler: import_zod.z.string().min(1),
345
+ limit: import_zod.z.number().int().min(1).max(100).optional()
346
+ });
347
+ var NdcGetPackagesInputSchema = import_zod.z.object({
348
+ productNdc: import_zod.z.string().min(1)
349
+ });
350
+ var NdcCrossRefInputSchema = import_zod.z.object({
351
+ ndc: import_zod.z.string().min(1)
352
+ });
353
+ var NdcCategory = class {
354
+ constructor(request) {
355
+ this.request = request;
356
+ }
357
+ async lookupNdc(input) {
358
+ const validated = NdcLookupInputSchema.parse(input);
359
+ return this.request("ndc/lookupNdc", {
360
+ ndc: validated.ndc
361
+ });
362
+ }
363
+ async lookupBatch(input) {
364
+ const validated = NdcBatchLookupInputSchema.parse(input);
365
+ return this.request("ndc/lookupBatch", {
366
+ ndcs: validated.ndcs
367
+ });
368
+ }
369
+ async searchProducts(input) {
370
+ const validated = NdcSearchInputSchema.parse(input);
371
+ return this.request("ndc/searchProducts", {
372
+ query: validated.query,
373
+ product_type: validated.productType,
374
+ limit: validated.limit
375
+ });
376
+ }
377
+ async searchFuzzy(input) {
378
+ const validated = NdcFuzzySearchInputSchema.parse(input);
379
+ return this.request("ndc/searchFuzzy", {
380
+ query: validated.query,
381
+ limit: validated.limit
382
+ });
383
+ }
384
+ async getProduct(input) {
385
+ const validated = NdcGetProductInputSchema.parse(input);
386
+ return this.request("ndc/getProduct", {
387
+ product_ndc: validated.productNdc
388
+ });
389
+ }
390
+ async getLabeler(input) {
391
+ const validated = NdcGetLabelerInputSchema.parse(input);
392
+ return this.request("ndc/getLabeler", {
393
+ labeler: validated.labeler,
394
+ limit: validated.limit
395
+ });
396
+ }
397
+ async getPackages(input) {
398
+ const validated = NdcGetPackagesInputSchema.parse(input);
399
+ return this.request("ndc/getPackages", {
400
+ product_ndc: validated.productNdc
401
+ });
402
+ }
403
+ async crossRefRxcui(input) {
404
+ const validated = NdcCrossRefInputSchema.parse(input);
405
+ return this.request("ndc/crossRefRxcui", {
406
+ ndc: validated.ndc
407
+ });
408
+ }
409
+ async getStats() {
410
+ return this.request("ndc/getStats", {});
411
+ }
412
+ async health() {
413
+ return this.request("ndc/health", {});
414
+ }
415
+ };
325
416
 
326
417
  // src/schemas/clinical.ts
327
418
  var import_zod2 = require("zod");
@@ -441,6 +532,8 @@ var SequoiaCodesClient = class {
441
532
  loinc;
442
533
  /** RxNorm drug/medication codes */
443
534
  rxnorm;
535
+ /** FDA NDC Directory - drug product identification (133K products, 248K packages) */
536
+ ndc;
444
537
  // ==========================================================================
445
538
  // Actuarial / Reference Data Categories
446
539
  // ==========================================================================
@@ -466,6 +559,7 @@ var SequoiaCodesClient = class {
466
559
  this.hcpcs = new HcpcsCategory(boundRequest);
467
560
  this.loinc = new LoincCategory(boundRequest);
468
561
  this.rxnorm = new RxnormCategory(boundRequest);
562
+ this.ndc = new NdcCategory(boundRequest);
469
563
  this.lifeExpectancy = new LifeExpectancyCategory(boundRequest);
470
564
  this.lcd = new LcdCategory(boundRequest);
471
565
  this.ncd = new NcdCategory(boundRequest);
@@ -628,6 +722,61 @@ server.tool(
628
722
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
629
723
  }
630
724
  );
725
+ server.tool(
726
+ "ndcLookup",
727
+ "Look up, search, or explore the FDA NDC Directory. Actions: lookup (by NDC code), lookupBatch (multiple NDCs), search (by drug name), fuzzy (misspelling-tolerant search), getProduct (by product NDC), getLabeler (by manufacturer), getPackages (by product NDC), crossRef (NDC-to-RxNorm).",
728
+ {
729
+ action: import_zod4.z.enum(["lookup", "lookupBatch", "search", "fuzzy", "getProduct", "getLabeler", "getPackages", "crossRef", "stats"]).default("lookup").describe("The NDC action to perform"),
730
+ ndc: import_zod4.z.string().optional().describe("NDC code (for lookup, crossRef)"),
731
+ ndcs: import_zod4.z.array(import_zod4.z.string()).optional().describe("Array of NDC codes (for lookupBatch)"),
732
+ query: import_zod4.z.string().optional().describe("Drug name to search (for search, fuzzy)"),
733
+ productNdc: import_zod4.z.string().optional().describe("Product NDC in 5-4 format (for getProduct, getPackages)"),
734
+ labeler: import_zod4.z.string().optional().describe("Manufacturer name (for getLabeler)"),
735
+ productType: import_zod4.z.string().optional().describe("Filter by product type (for search)"),
736
+ limit: import_zod4.z.number().int().min(1).max(100).optional().describe("Max results")
737
+ },
738
+ async ({ action, ndc, ndcs, query, productNdc, labeler, productType, limit }) => {
739
+ let result;
740
+ switch (action) {
741
+ case "lookup":
742
+ if (!ndc) return { content: [{ type: "text", text: "ndc is required for lookup" }] };
743
+ result = await client.ndc.lookupNdc({ ndc });
744
+ break;
745
+ case "lookupBatch":
746
+ if (!ndcs || ndcs.length === 0) return { content: [{ type: "text", text: "ndcs array is required for lookupBatch" }] };
747
+ result = await client.ndc.lookupBatch({ ndcs });
748
+ break;
749
+ case "search":
750
+ if (!query) return { content: [{ type: "text", text: "query is required for search" }] };
751
+ result = await client.ndc.searchProducts({ query, productType, limit });
752
+ break;
753
+ case "fuzzy":
754
+ if (!query) return { content: [{ type: "text", text: "query is required for fuzzy search" }] };
755
+ result = await client.ndc.searchFuzzy({ query, limit });
756
+ break;
757
+ case "getProduct":
758
+ if (!productNdc) return { content: [{ type: "text", text: "productNdc is required for getProduct" }] };
759
+ result = await client.ndc.getProduct({ productNdc });
760
+ break;
761
+ case "getLabeler":
762
+ if (!labeler) return { content: [{ type: "text", text: "labeler is required for getLabeler" }] };
763
+ result = await client.ndc.getLabeler({ labeler, limit });
764
+ break;
765
+ case "getPackages":
766
+ if (!productNdc) return { content: [{ type: "text", text: "productNdc is required for getPackages" }] };
767
+ result = await client.ndc.getPackages({ productNdc });
768
+ break;
769
+ case "crossRef":
770
+ if (!ndc) return { content: [{ type: "text", text: "ndc is required for crossRef" }] };
771
+ result = await client.ndc.crossRefRxcui({ ndc });
772
+ break;
773
+ case "stats":
774
+ result = await client.ndc.getStats();
775
+ break;
776
+ }
777
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
778
+ }
779
+ );
631
780
  async function main() {
632
781
  const transport = new import_stdio.StdioServerTransport();
633
782
  await server.connect(transport);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sequoiaport/codes",
3
- "version": "0.1.2-beta.2",
4
- "description": "Retrieve ICD-10, CPT, SNOMED, and more medical codes via the Sequoia Codes API.",
3
+ "version": "0.1.4-beta.1",
4
+ "description": "Retrieve ICD-10, CPT, SNOMED, RxNorm, LOINC, NDC, cost projections, and more medical codes via the Sequoia Codes API.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -19,10 +19,14 @@
19
19
  "hcpcs",
20
20
  "loinc",
21
21
  "rxnorm",
22
+ "ndc",
22
23
  "snomed",
23
24
  "lcd",
24
25
  "ncd",
25
26
  "life-expectancy",
27
+ "cost-projection",
28
+ "medicare",
29
+ "drg",
26
30
  "actuarial",
27
31
  "clinical",
28
32
  "codes",