Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ USE_HTTPS = false
VSAC_API_KEY = changeMe
WHITELIST = http://localhost, http://localhost:3005
SERVER_NAME = CodeX REMS Administrator Prototype
FULL_RESOURCE_IN_APP_CONTEXT = false

#Frontend Vars
FRONTEND_PORT=9090
VITE_REALM = ClientFhirServer
VITE_AUTH = http://localhost:8180
VITE_CLIENT = app-login
VITE_SCOPE_ID = rems-admin
VITE_SCOPE_ID = rems-admin
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ Following are a list of modifiable paths:
| 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/) |
| WHITELIST | `http://localhost, http://localhost:3005` | List of valid URLs for CORS. Should include any URLs the server accesses for resources. |
| SERVER_NAME | `CodeX REMS Administrator Prototype` | Name of the server that is returned in the card source. |
| FULL_RESOURCE_IN_APP_CONTEXT | 'false' | If true, the entire order resource will be included in the appContext, otherwise only a reference will be. |
| FRONTEND_PORT | `9080` | Port that the frontend server should run on, change if there are conflicts with port usage. |
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export default {
},
general: {
resourcePath: 'src/cds-library/CRD-DTR',
VsacApiKey: env.get('VSAC_API_KEY').required().asString()
VsacApiKey: env.get('VSAC_API_KEY').required().asString(),
fullResourceInAppContext: env.get('FULL_RESOURCE_IN_APP_CONTEXT').required().asBool()
},
database: {
selected: 'mongo',
Expand Down
11 changes: 8 additions & 3 deletions src/hooks/hookResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,18 @@ export function createSmartLink(
appContext: string | null,
request: MedicationRequest | undefined
) {
let order;
if (config.general.fullResourceInAppContext) {
order = JSON.stringify(request);
} else {
order = request?.resourceType + '/' + request?.id;
}

const newLink: Link = {
label: requirementName + ' Form',
url: new URL(config.smart.endpoint),
type: 'smart',
appContext: `${appContext}&order=${JSON.stringify(request)}&coverage=${
request?.insurance?.[0].reference
}`
appContext: `${appContext}&order=${order}&coverage=${request?.insurance?.[0].reference}`
};
return newLink;
}
Expand Down
Loading