diff --git a/backend/env.json b/backend/env.json index 02bc8c7..afe8643 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 3c8e0a0..c4a3851 100644 --- a/backend/src/routes/doctorOrders.js +++ b/backend/src/routes/doctorOrders.js @@ -177,6 +177,15 @@ 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(env.REMS_ADMIN_NCPDP, rxFill, { + headers: { + 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 + } + }); + + 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;