Skip to content

Commit 8f1851a

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
2 parents d22395f + a122c89 commit 8f1851a

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ USE_HTTPS = false
1111
VSAC_API_KEY = changeMe
1212
WHITELIST = http://localhost, http://localhost:3005
1313
SERVER_NAME = CodeX REMS Administrator Prototype
14+
FULL_RESOURCE_IN_APP_CONTEXT = false
1415

1516
#Frontend Vars
1617
FRONTEND_PORT=9090
1718
VITE_REALM = ClientFhirServer
1819
VITE_AUTH = http://localhost:8180
1920
VITE_CLIENT = app-login
20-
VITE_SCOPE_ID = rems-admin
21+
VITE_SCOPE_ID = rems-admin

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,5 @@ Following are a list of modifiable paths:
117117
| VSAC_API_KEY | `changeMe` | Replace with VSAC API key for pulling down ValueSets. Request an API Key from the [VSAC website](https://vsac.nlm.nih.gov/) |
118118
| WHITELIST | `http://localhost, http://localhost:3005` | List of valid URLs for CORS. Should include any URLs the server accesses for resources. |
119119
| SERVER_NAME | `CodeX REMS Administrator Prototype` | Name of the server that is returned in the card source. |
120+
| FULL_RESOURCE_IN_APP_CONTEXT | 'false' | If true, the entire order resource will be included in the appContext, otherwise only a reference will be. |
120121
| FRONTEND_PORT | `9080` | Port that the frontend server should run on, change if there are conflicts with port usage. |

src/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export default {
2323
},
2424
general: {
2525
resourcePath: 'src/cds-library/CRD-DTR',
26-
VsacApiKey: env.get('VSAC_API_KEY').required().asString()
26+
VsacApiKey: env.get('VSAC_API_KEY').required().asString(),
27+
fullResourceInAppContext: env.get('FULL_RESOURCE_IN_APP_CONTEXT').required().asBool()
2728
},
2829
database: {
2930
selected: 'mongo',

src/hooks/hookResources.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,18 @@ export function createSmartLink(
297297
appContext: string | null,
298298
request: MedicationRequest | undefined
299299
) {
300+
let order;
301+
if (config.general.fullResourceInAppContext) {
302+
order = JSON.stringify(request);
303+
} else {
304+
order = request?.resourceType + '/' + request?.id;
305+
}
306+
300307
const newLink: Link = {
301308
label: requirementName + ' Form',
302309
url: new URL(config.smart.endpoint),
303310
type: 'smart',
304-
appContext: `${appContext}&order=${JSON.stringify(request)}&coverage=${
305-
request?.insurance?.[0].reference
306-
}`
311+
appContext: `${appContext}&order=${order}&coverage=${request?.insurance?.[0].reference}`
307312
};
308313
return newLink;
309314
}

0 commit comments

Comments
 (0)