diff --git a/.env b/.env
index 75e6c54..2b9c27f 100644
--- a/.env
+++ b/.env
@@ -24,5 +24,6 @@ VITE_RESPONSE_EXPIRATION_DAYS = 30
VITE_SERVER = http://localhost:8090
VITE_SMART_LAUNCH_URL = http://localhost:4040/
VITE_URL = http://localhost:3000
-VITE_URL_FILTER = http://localhost:3000/*
VITE_USER = alice
+VITE_HOOK_TO_SEND = patient-view
+VITE_URL_FILTER = http://localhost:3000/*
diff --git a/src/components/RequestDashboard/SettingsSection.jsx b/src/components/RequestDashboard/SettingsSection.jsx
index 0c8b010..46058a4 100644
--- a/src/components/RequestDashboard/SettingsSection.jsx
+++ b/src/components/RequestDashboard/SettingsSection.jsx
@@ -1,11 +1,12 @@
-import React, { memo, useState, useEffect } from 'react';
+import React, { memo, useEffect } from 'react';
import {
- Box,
Button,
Checkbox,
FormControlLabel,
+ FormControl,
Grid,
IconButton,
+ InputLabel,
Paper,
Select,
MenuItem,
@@ -28,7 +29,7 @@ import { headerDefinitions, medicationRequestToRemsAdmins } from '../../util/dat
import { actionTypes, initialState } from '../../containers/ContextProvider/reducer';
import { SettingsContext } from '../../containers/ContextProvider/SettingsProvider';
-const CDS_HOOKS = ['order-sign', 'order-select', 'patient-view'];
+const CDS_HOOKS = ['order-sign', 'order-select', 'patient-view', 'encounter-start'];
const SettingsSection = props => {
const [state, dispatch] = React.useContext(SettingsContext);
@@ -251,6 +252,33 @@ const SettingsSection = props => {
);
+ case 'dropdown':
+ return (
+
+
+
+ Hook to send when selecting a patient
+
+
+
+
+
+
+ )
default:
return (
diff --git a/src/containers/RequestBuilder.jsx b/src/containers/RequestBuilder.jsx
index ca53471..375bbc1 100644
--- a/src/containers/RequestBuilder.jsx
+++ b/src/containers/RequestBuilder.jsx
@@ -117,7 +117,7 @@ const RequestBuilder = props => {
useEffect(() => {
- const hook = 'patient-view';
+ const hook = globalState.hookToSend;
let remsAdminUrls = [];
// get all the remsAdminUrl for each MedicationRequest
diff --git a/src/util/data.js b/src/util/data.js
index d308619..708cd46 100644
--- a/src/util/data.js
+++ b/src/util/data.js
@@ -75,6 +75,11 @@ const headerDefinitions = {
display: 'REMS Admin Server',
type: 'input',
default: env.get('VITE_SERVER').asString()
+ },
+ hookToSend: {
+ display: 'Send hook on patient select',
+ type: 'dropdown',
+ default: env.get('VITE_HOOK_TO_SEND').asString()
}
};
@@ -85,7 +90,8 @@ const medicationRequestToRemsAdmins = Object.freeze([
hookEndpoints: [
{ hook: 'order-sign', remsAdmin: 'http://localhost:8090/cds-services/rems-order-sign' },
{ hook: 'order-select', remsAdmin: 'http://localhost:8090/cds-services/rems-order-select' },
- { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' }
+ { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' },
+ { hook: 'encounter-start', remsAdmin: 'http://localhost:8090/cds-services/rems-encounter-start' }
]
},
{
@@ -94,7 +100,8 @@ const medicationRequestToRemsAdmins = Object.freeze([
hookEndpoints: [
{ hook: 'order-sign', remsAdmin: 'http://localhost:8090/cds-services/rems-order-sign' },
{ hook: 'order-select', remsAdmin: 'http://localhost:8090/cds-services/rems-order-select' },
- { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' }
+ { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' },
+ { hook: 'encounter-start', remsAdmin: 'http://localhost:8090/cds-services/rems-encounter-start' }
]
},
{
@@ -103,7 +110,8 @@ const medicationRequestToRemsAdmins = Object.freeze([
hookEndpoints: [
{ hook: 'order-sign', remsAdmin: 'http://localhost:8090/cds-services/rems-order-sign' },
{ hook: 'order-select', remsAdmin: 'http://localhost:8090/cds-services/rems-order-select' },
- { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' }
+ { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' },
+ { hook: 'encounter-start', remsAdmin: 'http://localhost:8090/cds-services/rems-encounter-start' }
]
},
{
@@ -112,7 +120,8 @@ const medicationRequestToRemsAdmins = Object.freeze([
hookEndpoints: [
{ hook: 'order-sign', remsAdmin: 'http://localhost:8090/cds-services/rems-order-sign' },
{ hook: 'order-select', remsAdmin: 'http://localhost:8090/cds-services/rems-order-select' },
- { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' }
+ { hook: 'patient-view', remsAdmin: 'http://localhost:8090/cds-services/rems-patient-view' },
+ { hook: 'encounter-start', remsAdmin: 'http://localhost:8090/cds-services/rems-encounter-start' }
]
}
]);
diff --git a/src/util/util.js b/src/util/util.js
index f494e61..663c039 100644
--- a/src/util/util.js
+++ b/src/util/util.js
@@ -104,7 +104,7 @@ const getMedicationSpecificRemsAdminUrl = (request, globalState, hook) => {
return undefined;
}
- if (!(hook === 'patient-view' || hook === 'order-sign' || hook === 'order-select')) {
+ if (!(hook === 'patient-view' || hook === 'order-sign' || hook === 'order-select' || hook === 'encounter-start')) {
console.log(`ERROR: unknown hook type: ${hook}`);
return undefined;
}