Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -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/

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/
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 0 additions & 6 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| 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 |
17 changes: 11 additions & 6 deletions src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,15 +18,17 @@ 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"
}, {
brand_name: "Isotretinoin",
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"
Expand All @@ -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"
Expand All @@ -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"
}
];
];
4 changes: 3 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -139,4 +141,4 @@ const server = createServer((req: IncomingMessage, res: ServerResponse) => {

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
});
Binary file not shown.
Binary file modified src/spl/TESTDATA_rems_document_and_rems_indexing_spl_files.zip
Binary file not shown.