From f96f33cf87039bf611c28a51a314abe8e71db98e Mon Sep 17 00:00:00 2001 From: Ariel Virgulto Date: Fri, 23 Aug 2024 09:58:30 -0400 Subject: [PATCH 1/4] 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/4] 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/4] 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/4] 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"