diff --git a/.env b/.env index a964798..46693e6 100644 --- a/.env +++ b/.env @@ -1,5 +1,9 @@ SERVER_PORT=3323 SERVER_HOST=0.0.0.0 SPL_ZIP_PATH=/src/spl/TESTDATA_rems_document_and_rems_indexing_spl_files.zip -REMS_ADMIN_1_URL=http://localhost:8090/ -REMS_ADMIN_2_URL=http://localhost:8095/ \ No newline at end of file + +REMS_ADMIN_1_CDS_URL=http://localhost:8090/ +REMS_ADMIN_1_FHIR_URL=http://localhost:8090/ + +REMS_ADMIN_2_CDS_URL=http://localhost:8095/ +REMS_ADMIN_2_FHIR_URL=http://localhost:8095/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d5574fa..f71d82f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,6 @@ FROM node:21-alpine WORKDIR /home/node/app/rems-directory -ARG SERVER_PORT -ENV SERVER_PORT=$SERVER_PORT - -ARG SERVER_HOST -ENV SERVER_HOST=$SERVER_HOST - COPY --chown=node:node . . RUN npm install EXPOSE 3323 diff --git a/Dockerfile.dev b/Dockerfile.dev index 3193473..bca6f12 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,12 +1,6 @@ FROM node:21-alpine WORKDIR /home/node/app/rems-directory -ARG SERVER_PORT -ENV SERVER_PORT=$SERVER_PORT - -ARG SERVER_HOST -ENV SERVER_HOST=$SERVER_HOST - COPY --chown=node:node . . RUN npm install EXPOSE 3323 diff --git a/README.md b/README.md index 14b4268..3bb4fd1 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,10 @@ Following are a list of modifiable paths: | URI Name | Default | Description | | --------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | -| SERVER_PORT | 33333 | The port to run the server on. | +| SERVER_PORT | 3323 | The port to run the server on. | | SERVER_HOST | `127.0.0.1` | The hostname of the server. | | SPL_ZIP_PATH | /src/spl/TESTDATA_rems_document_and_rems_indexing_spl_files.zip | the path to the spl zip | -| REMS_ADMIN_1_URL | http://localhost:8090/ | the base url for the first rems admin | -| REMS_ADMIN_2_URL | http://localhost:8095/ | the base url for the second rems admin | \ No newline at end of file +| REMS_ADMIN_1_CDS_URL | http://localhost:8090/ | the CDS base url for the first rems admin | +| REMS_ADMIN_1_FHIR_URL | http://localhost:8090/ | the FHIR base url for the first rems admin | +| REMS_ADMIN_2_CDS_URL | http://localhost:8095/ | the CDS base url for the second rems admin | +| REMS_ADMIN_2_FHIR_URL | http://localhost:8095/ | the FHIR base url for the second rems admin | \ No newline at end of file diff --git a/src/data.ts b/src/data.ts index 4ebfb80..da55f66 100644 --- a/src/data.ts +++ b/src/data.ts @@ -5,7 +5,8 @@ export type Medication = { generic_name: string, product_ndc: string, rems_administrator: string, - rems_endpoint: string | undefined, + rems_cds_endpoint: string | undefined, + rems_fhir_base_url: string | undefined, rems_approval_date: string, rems_spl_date?: string rems_modification_date: string @@ -17,7 +18,8 @@ export const medications : Medication[] = [ generic_name: "FLIBANSERINE", product_ndc: "58604-214-30", rems_administrator: "REMS Prototype Admin 1", - rems_endpoint: env.get('REMS_ADMIN_1_URL').asString(), + rems_cds_endpoint: env.get('REMS_ADMIN_1_CDS_URL').asString(), + rems_fhir_base_url: env.get('REMS_ADMIN_1_FHIR_URL').asString(), rems_approval_date: "20240906", rems_modification_date: "20240906" }, { @@ -25,7 +27,8 @@ export const medications : Medication[] = [ generic_name: "ISOTRETINOIN", product_ndc: "0245-0571-01", rems_administrator: "REMS Prototype Admin 2", - rems_endpoint: env.get('REMS_ADMIN_2_URL').asString(), + rems_cds_endpoint: env.get('REMS_ADMIN_2_CDS_URL').asString(), + rems_fhir_base_url: env.get('REMS_ADMIN_2_FHIR_URL').asString(), rems_approval_date: "20240906", rems_modification_date: "20240906", rems_spl_date: "20230912" @@ -34,7 +37,8 @@ export const medications : Medication[] = [ generic_name: "FENTANYL CITRATE", product_ndc: "63459-502-30", rems_administrator: "REMS Prototype Admin 1", - rems_endpoint: env.get('REMS_ADMIN_1_URL').asString(), + rems_cds_endpoint: env.get('REMS_ADMIN_1_CDS_URL').asString(), + rems_fhir_base_url: env.get('REMS_ADMIN_1_FHIR_URL').asString(), rems_approval_date: "20240906", rems_modification_date: "20240906", rems_spl_date: "20230401" @@ -43,8 +47,9 @@ export const medications : Medication[] = [ generic_name: "PEXIDARTINIB HYDROCHLORIDE", product_ndc: "65597-407-20", rems_administrator: "REMS Prototype Admin 2", - rems_endpoint: env.get('REMS_ADMIN_2_URL').asString(), + rems_cds_endpoint: env.get('REMS_ADMIN_2_CDS_URL').asString(), + rems_fhir_base_url: env.get('REMS_ADMIN_2_FHIR_URL').asString(), rems_approval_date: "20240906", rems_modification_date: "20240906" } -]; +]; \ No newline at end of file diff --git a/src/server.ts b/src/server.ts index 05e378c..5afb448 100644 --- a/src/server.ts +++ b/src/server.ts @@ -73,6 +73,8 @@ const server = createServer((req: IncomingMessage, res: ServerResponse) => { if (response) { console.log(' - return: ' + response.results[0]?.brand_name); + console.log(' - CDS endpoint: ' + response.results[0]?.rems_cds_endpoint); + console.log(' - FHIR base URL: ' + response.results[0]?.rems_fhir_base_url); res.statusCode = 200; res.setHeader('Content-Type', 'application/json'); res.end(JSON.stringify(response)); @@ -139,4 +141,4 @@ const server = createServer((req: IncomingMessage, res: ServerResponse) => { server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); -}); +}); \ No newline at end of file diff --git a/src/spl/TESTDATA_Docker_rems_document_and_rems_indexing_spl_files.zip b/src/spl/TESTDATA_Docker_rems_document_and_rems_indexing_spl_files.zip index b53042c..aaef2d8 100644 Binary files a/src/spl/TESTDATA_Docker_rems_document_and_rems_indexing_spl_files.zip and b/src/spl/TESTDATA_Docker_rems_document_and_rems_indexing_spl_files.zip differ diff --git a/src/spl/TESTDATA_rems_document_and_rems_indexing_spl_files.zip b/src/spl/TESTDATA_rems_document_and_rems_indexing_spl_files.zip index 3013038..f622050 100644 Binary files a/src/spl/TESTDATA_rems_document_and_rems_indexing_spl_files.zip and b/src/spl/TESTDATA_rems_document_and_rems_indexing_spl_files.zip differ