Skip to content

Commit

Permalink
Merge pull request #92 from mcode/735-rxfill
Browse files Browse the repository at this point in the history
Make call to rems admin pims
  • Loading branch information
plarocque4 authored Sep 9, 2024
2 parents 56d2bed + 0a737f0 commit 5518287
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
9 changes: 9 additions & 0 deletions backend/src/routes/doctorOrders.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5518287

Please sign in to comment.