diff --git a/.env b/.env index ed37ff6..fe4de04 100644 --- a/.env +++ b/.env @@ -19,9 +19,10 @@ VITE_PIMS_SERVER = http://localhost:5051/doctorOrders/api/addRx VITE_PUBLIC_KEYS = http://localhost:3000/request-generator/.well-known/jwks.json VITE_REALM = ClientFhirServer VITE_RESPONSE_EXPIRATION_DAYS = 30 -VITE_SERVER = http://localhost:8090 VITE_SMART_LAUNCH_URL = http://localhost:4040/ VITE_URL = http://localhost:3000 VITE_USER = alice VITE_HOOK_TO_SEND = patient-view VITE_URL_FILTER = http://localhost:3000/* +VITE_USE_INTERMEDIARY = false +VITE_INTERMEDIARY = http://localhost:3003 diff --git a/README.md b/README.md index f33cb0f..a8e0e52 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,8 @@ Following are a list of modifiable paths: | VITE_PUBLIC_KEYS | `http://localhost:3000/request-generator/.well-known/jwks.json` | The endpoint which contains the public keys for authentication with the REMS admin. Should be changed if the keys are moved elsewhere. | | VITE_REALM | `ClientFhirServer` | The Keycloak realm to use. Only relevant is using Keycloak as an authentication server. This only affects direct logins like through the Patient Portal, not SMART launches like opening the app normally. | | VITE_RESPONSE_EXPIRATION_DAYS | `30` | The number of days old a Questionnaire Response can be before it is ignored and filtered out. This ensures the patient search excludes outdated or obsolete prior sessions from creating clutter. | -| VITE_SERVER | `http://localhost:8090` | The default base URL of the CDS service. Typically this will be the base url of the REMS Admin. | | VITE_SMART_LAUNCH_URL | `http://localhost:4040/` | The base url of the SMART app. This is used for opening the app directly, rather than doing an EHR SMART launch. | | VITE_URL | `http://localhost:3000` | The base url of this app. Should be modified if the port or domain change. | -| VITE_USER | `alice` | The default user to login as when opening the app. | \ No newline at end of file +| VITE_USER | `alice` | The default user to login as when opening the app. | +| VITE_USE_INTERMEDIARY | false | When true, the app will send all CDS Hooks and REMS ETASU check calls to the intermediary defined in VITE_INTERMEDIARY. | +| VITE_INTERMEDIARY | `http://localhost:3030` | The base url of the intermediary. | \ No newline at end of file diff --git a/src/components/Dashboard/ListSelections/NotificationsSection.jsx b/src/components/Dashboard/ListSelections/NotificationsSection.jsx index 306982d..e1a3cf5 100644 --- a/src/components/Dashboard/ListSelections/NotificationsSection.jsx +++ b/src/components/Dashboard/ListSelections/NotificationsSection.jsx @@ -4,7 +4,7 @@ import { SettingsContext } from '../../../containers/ContextProvider/SettingsPro import { EtasuStatusComponent } from '../../EtasuStatus/EtasuStatusComponent'; import axios from 'axios'; import { createMedicationFromMedicationRequest } from '../../../util/fhir'; -import { standardsBasedGetEtasu } from '../../../util/util'; +import { standardsBasedGetEtasu, getMedicationSpecificEtasuUrl } from '../../../util/util'; const NotificationsSection = () => { const [globalState, _] = useContext(SettingsContext); @@ -49,7 +49,7 @@ const NotificationsSection = () => { const getAllEtasu = () => { medications.forEach(medication => { const body = makeBody(medication); - const standardEtasuUrl = `${globalState.remsAdminServer}/4_0_0/GuidanceResponse/$rems-etasu`; + const standardEtasuUrl = getMedicationSpecificEtasuUrl(medication?.code, globalState); standardsBasedGetEtasu(standardEtasuUrl, body, compileResponses); }); }; @@ -81,6 +81,7 @@ const NotificationsSection = () => { display={display} remsAdminResponseInit={remsCase} data={remsCase.body} + medication={remsCase.body.parameter[1]?.resource} /> ); })} diff --git a/src/components/DisplayBox/DisplayBox.jsx b/src/components/DisplayBox/DisplayBox.jsx index 27fd82c..c5df3fe 100644 --- a/src/components/DisplayBox/DisplayBox.jsx +++ b/src/components/DisplayBox/DisplayBox.jsx @@ -287,7 +287,7 @@ const DisplayBox = props => { card.links.map((link, ind) => { if (link.type === 'smart') { linksSection.push( - +