From a5d4541d9f8c1183e5aade8bf69c2a73e10bbeee Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Mon, 16 Jun 2025 12:12:03 -0400 Subject: [PATCH] update product ndc name to package ndc name --- README.md | 4 ++-- src/data.ts | 10 +++++----- src/server.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3bb4fd1..46907a9 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ Query the server running on http://localhost:33333/ (or whichever port it was ru ### Example query endpoint: -This will search for the listing for the drug with the product_ndc of 0591-2433 (Isotretinoin) +This will search for the listing for the drug with the package_ndc of 0245-0571-01 (Isotretinoin) -- `http://localhost:33333/drug/ndc.json?search=product_ndc=%220591-2433%22` +- `http://localhost:33333/drug/ndc.json?search=package_ndc=%220591-2433%22` ## Environment Variables diff --git a/src/data.ts b/src/data.ts index da55f66..1fa610e 100644 --- a/src/data.ts +++ b/src/data.ts @@ -3,7 +3,7 @@ import * as env from 'env-var'; export type Medication = { brand_name: string; generic_name: string, - product_ndc: string, + package_ndc: string, rems_administrator: string, rems_cds_endpoint: string | undefined, rems_fhir_base_url: string | undefined, @@ -16,7 +16,7 @@ export const medications : Medication[] = [ { brand_name: "ADDYI", generic_name: "FLIBANSERINE", - product_ndc: "58604-214-30", + package_ndc: "58604-214-30", rems_administrator: "REMS Prototype Admin 1", rems_cds_endpoint: env.get('REMS_ADMIN_1_CDS_URL').asString(), rems_fhir_base_url: env.get('REMS_ADMIN_1_FHIR_URL').asString(), @@ -25,7 +25,7 @@ export const medications : Medication[] = [ }, { brand_name: "Isotretinoin", generic_name: "ISOTRETINOIN", - product_ndc: "0245-0571-01", + package_ndc: "0245-0571-01", rems_administrator: "REMS Prototype Admin 2", rems_cds_endpoint: env.get('REMS_ADMIN_2_CDS_URL').asString(), rems_fhir_base_url: env.get('REMS_ADMIN_2_FHIR_URL').asString(), @@ -35,7 +35,7 @@ export const medications : Medication[] = [ }, { brand_name: "Fentanyl Citrate", generic_name: "FENTANYL CITRATE", - product_ndc: "63459-502-30", + package_ndc: "63459-502-30", rems_administrator: "REMS Prototype Admin 1", rems_cds_endpoint: env.get('REMS_ADMIN_1_CDS_URL').asString(), rems_fhir_base_url: env.get('REMS_ADMIN_1_FHIR_URL').asString(), @@ -45,7 +45,7 @@ export const medications : Medication[] = [ }, { brand_name: "Turalio", generic_name: "PEXIDARTINIB HYDROCHLORIDE", - product_ndc: "65597-407-20", + package_ndc: "65597-407-20", rems_administrator: "REMS Prototype Admin 2", rems_cds_endpoint: env.get('REMS_ADMIN_2_CDS_URL').asString(), rems_fhir_base_url: env.get('REMS_ADMIN_2_FHIR_URL').asString(), diff --git a/src/server.ts b/src/server.ts index 5afb448..88a154a 100644 --- a/src/server.ts +++ b/src/server.ts @@ -44,8 +44,8 @@ const server = createServer((req: IncomingMessage, res: ServerResponse) => { foundElement = medications.find(element => element.generic_name.toLowerCase() === searchValue.toLowerCase()); } else if (searchKey === 'brand_name') { foundElement = medications.find(element => element.brand_name.toLowerCase() === searchValue.toLowerCase()); - } else if (searchKey === 'product_ndc') { - foundElement = medications.find(element => element.product_ndc.toLowerCase() === searchValue.toLowerCase()); + } else if (searchKey === 'package_ndc') { + foundElement = medications.find(element => element.package_ndc.toLowerCase() === searchValue.toLowerCase()); } if (foundElement) {