From f96f33cf87039bf611c28a51a314abe8e71db98e Mon Sep 17 00:00:00 2001 From: Ariel Virgulto Date: Fri, 23 Aug 2024 09:58:30 -0400 Subject: [PATCH 1/5] Make call to rems admin pims --- backend/src/routes/doctorOrders.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/routes/doctorOrders.js b/backend/src/routes/doctorOrders.js index 3c8e0a0..aead6f6 100644 --- a/backend/src/routes/doctorOrders.js +++ b/backend/src/routes/doctorOrders.js @@ -177,6 +177,14 @@ router.patch('/api/updateRx/:id/pickedUp', async (req, res) => { } }); console.log('Sent RxFill to EHR and received status from EHR', status.data); + + const remsAdminStatus = await axios.post('http://rems-administrator:8090/ncpdp', rxFill, { + headers: { + 'Content-Type': 'application/xml' // Tell the rems admin that the RxFill is in XML + } + }); + + console.log('Sent RxFill to rems admin and received status from rems admin: ', remsAdminStatus); } catch (error) { console.log('Could not send RxFill to EHR', error); return error; From 9e24161aefcc2349f86fd19a640cf20308fbc91f Mon Sep 17 00:00:00 2001 From: Ariel Virgulto Date: Fri, 6 Sep 2024 12:20:51 -0400 Subject: [PATCH 2/5] Update api call adn return --- backend/src/routes/doctorOrders.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/routes/doctorOrders.js b/backend/src/routes/doctorOrders.js index aead6f6..1a5dde4 100644 --- a/backend/src/routes/doctorOrders.js +++ b/backend/src/routes/doctorOrders.js @@ -178,8 +178,9 @@ router.patch('/api/updateRx/:id/pickedUp', async (req, res) => { }); console.log('Sent RxFill to EHR and received status from EHR', status.data); - const remsAdminStatus = await axios.post('http://rems-administrator:8090/ncpdp', rxFill, { + const remsAdminStatus = await axios.post('http://rems-administrator:8090/ncpdp/script', rxFill, { headers: { + Accept: 'application/xml', // Expect that the Status that the EHR returns back is in XML 'Content-Type': 'application/xml' // Tell the rems admin that the RxFill is in XML } }); From 77c379dbc3bcdcffd43890c5ad2126eacd7f6d25 Mon Sep 17 00:00:00 2001 From: Ariel Virgulto Date: Mon, 9 Sep 2024 09:58:32 -0400 Subject: [PATCH 3/5] Update to api call --- backend/env.json | 4 ++++ backend/src/routes/doctorOrders.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/env.json b/backend/env.json index 02bc8c7..c43fca1 100644 --- a/backend/env.json +++ b/backend/env.json @@ -61,5 +61,9 @@ "INTERMEDIARY_FHIR_URL": { "type": "string", "default": "http://localhost:3003/4_0_0" + }, + "REMS_ADMIN_NCPDP": { + "type": "string", + "default": "http://localhost:8090/ncpdp/script" } } diff --git a/backend/src/routes/doctorOrders.js b/backend/src/routes/doctorOrders.js index 1a5dde4..c4a3851 100644 --- a/backend/src/routes/doctorOrders.js +++ b/backend/src/routes/doctorOrders.js @@ -178,9 +178,9 @@ router.patch('/api/updateRx/:id/pickedUp', async (req, res) => { }); console.log('Sent RxFill to EHR and received status from EHR', status.data); - const remsAdminStatus = await axios.post('http://rems-administrator:8090/ncpdp/script', rxFill, { + const remsAdminStatus = await axios.post(env.REMS_ADMIN_NCPDP, rxFill, { headers: { - Accept: 'application/xml', // Expect that the Status that the EHR returns back is in XML + Accept: 'application/xml', // Expect that the Status that the rems admin returns back is in XML 'Content-Type': 'application/xml' // Tell the rems admin that the RxFill is in XML } }); From 0a737f01ce459f1495ec6510c6a946f00928594f Mon Sep 17 00:00:00 2001 From: Ariel Virgulto Date: Mon, 9 Sep 2024 10:05:05 -0400 Subject: [PATCH 4/5] Fix prettier --- backend/env.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/env.json b/backend/env.json index c43fca1..afe8643 100644 --- a/backend/env.json +++ b/backend/env.json @@ -61,7 +61,7 @@ "INTERMEDIARY_FHIR_URL": { "type": "string", "default": "http://localhost:3003/4_0_0" - }, + }, "REMS_ADMIN_NCPDP": { "type": "string", "default": "http://localhost:8090/ncpdp/script" From 562e00c7be3477cf3e46fd4e7b894b1d59723bad Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Mon, 16 Sep 2024 10:17:57 -0400 Subject: [PATCH 5/5] docker configs --- Dockerfile | 11 +++-------- Dockerfile.dev | 3 --- backend/env.json | 6 +++--- backend/package-lock.json | 2 +- backend/package.json | 2 +- frontend/package-lock.json | 2 +- frontend/package.json | 2 +- 7 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index e7ffdad..0a70286 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,18 @@ FROM node:14-alpine -ENV NODE_ENV production WORKDIR /home/node/app COPY --chown=node:node . . -RUN npm install -g typescript WORKDIR /home/node/app/backend RUN npm install -RUN npm link typescript WORKDIR /home/node/app/frontend RUN npm install -RUN npm link typescript WORKDIR /home/node/app -# RUN npm install pm2 -g - EXPOSE 5050 -EXPOSE 5051 -CMD ./dockerRunnerProd.sh \ No newline at end of file +HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD (wget --no-verbose --tries=1 --spider http://localhost:5051/doctorOrders/api/getRx/pending && wget --no-verbose --tries=1 --spider http://localhost:5050) || exit 1 + +CMD ./dockerRunnerProd.sh diff --git a/Dockerfile.dev b/Dockerfile.dev index 37bb419..c0ad0b0 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -2,15 +2,12 @@ FROM node:14-alpine WORKDIR /home/node/app COPY --chown=node:node . . -RUN npm install -g typescript WORKDIR /home/node/app/backend RUN npm install -RUN npm link typescript WORKDIR /home/node/app/frontend RUN npm install -RUN npm link typescript WORKDIR /home/node/app diff --git a/backend/env.json b/backend/env.json index 02bc8c7..470aa40 100644 --- a/backend/env.json +++ b/backend/env.json @@ -20,12 +20,12 @@ }, "MONGO_USERNAME": { "type": "string", - "default": "rems-admin-pims-root" + "default": "pims-user" }, "MONGO_PASSWORD": { "type": "string", - "default": "rems-admin-pims-password" + "default": "pims-pass" }, "MONGO_URL": { @@ -35,7 +35,7 @@ "AUTH_SOURCE": { "type": "string", - "default": "admin" + "default": "pims" }, "HTTPS_KEY_PATH": { diff --git a/backend/package-lock.json b/backend/package-lock.json index 81d798b..8465dfd 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -51,7 +51,7 @@ "sinon": "^15.0.3", "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0", - "typescript": "^4.9.3" + "typescript": "^4.9.5" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/backend/package.json b/backend/package.json index 5b8c448..31f34b0 100644 --- a/backend/package.json +++ b/backend/package.json @@ -46,7 +46,7 @@ "sinon": "^15.0.3", "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0", - "typescript": "^4.9.3" + "typescript": "^4.9.5" }, "scripts": { "start": "ts-node-dev src/server.ts", diff --git a/frontend/package-lock.json b/frontend/package-lock.json index e815efa..14c3751 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -52,7 +52,7 @@ "ts-jest": "^27.1.2", "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0", - "typescript": "^4.9.3" + "typescript": "^4.9.5" } }, "node_modules/@adobe/css-tools": { diff --git a/frontend/package.json b/frontend/package.json index 5ac5d70..e216d1d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -47,7 +47,7 @@ "ts-jest": "^27.1.2", "ts-node": "^10.9.1", "ts-node-dev": "^2.0.0", - "typescript": "^4.9.3" + "typescript": "^4.9.5" }, "scripts": { "start": "react-scripts start",