From a7725bf5016ff55870d1e33300b72fce41dd6120 Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Tue, 10 Sep 2024 16:08:28 -0400 Subject: [PATCH 1/3] make server name returned in card source configurable --- .env | 1 + README.md | 1 + src/config.ts | 3 ++- src/hooks/hookResources.ts | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env b/.env index c80dcf6a..ab1c188c 100644 --- a/.env +++ b/.env @@ -10,3 +10,4 @@ SMART_ENDPOINT = http://localhost:4040/launch USE_HTTPS = false VSAC_API_KEY = changeMe WHITELIST = http://localhost, http://localhost:3005 +SERVER_NAME = MCODE REMS Administrator Prototype diff --git a/README.md b/README.md index 99ceda47..24f4fd36 100644 --- a/README.md +++ b/README.md @@ -98,3 +98,4 @@ Following are a list of modifiable paths: | USE_HTTPS | `false` | Change to true to enable HTTPS. Ensure that HTTPS_CERT_PATH and HTTPS_KEY_PATH are valid. | | 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. | diff --git a/src/config.ts b/src/config.ts index 74c8617a..69fa1a4f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -12,7 +12,8 @@ const whitelist = whitelistEnv && whitelistEnv.length === 1 ? whitelistEnv[0] : export default { server: { port: env.get('PORT').asInt(), - discoveryEndpoint: '/cds-services' + discoveryEndpoint: '/cds-services', + name: env.get('SERVER_NAME').required().asString() }, smart: { endpoint: env.get('SMART_ENDPOINT').required().asUrlString() diff --git a/src/hooks/hookResources.ts b/src/hooks/hookResources.ts index 4d435a46..1dd98dbf 100644 --- a/src/hooks/hookResources.ts +++ b/src/hooks/hookResources.ts @@ -244,7 +244,7 @@ export const validCodes: Coding[] = [ } ]; const source = { - label: 'MCODE REMS Administrator Prototype', + label: config.server.name, url: new URL('https://github.com/mcode/rems-admin') }; From 884fceea798c876290d9c0caadadab8e7251f4c0 Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Tue, 10 Sep 2024 16:11:30 -0400 Subject: [PATCH 2/3] update rems admin server name --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index ab1c188c..36730982 100644 --- a/.env +++ b/.env @@ -10,4 +10,4 @@ SMART_ENDPOINT = http://localhost:4040/launch USE_HTTPS = false VSAC_API_KEY = changeMe WHITELIST = http://localhost, http://localhost:3005 -SERVER_NAME = MCODE REMS Administrator Prototype +SERVER_NAME = CodeX REMS Administrator Prototype From a9c389ada76e017ff608cb636e99f64106c208f2 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Mon, 16 Sep 2024 13:50:01 -0400 Subject: [PATCH 3/3] linting fix --- src/lib/vsac_cache.ts | 5 ++++- src/rems-cds-hooks | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/vsac_cache.ts b/src/lib/vsac_cache.ts index 28ff8c49..2c08ccf3 100644 --- a/src/lib/vsac_cache.ts +++ b/src/lib/vsac_cache.ts @@ -60,7 +60,10 @@ class VsacCache { */ collectLibraryValueSets(library: Library) { // ensure only unique values - const result = fhirpath.evaluate(library, 'Library.dataRequirement.codeFilter.valueSet') as any[]; + const result = fhirpath.evaluate( + library, + 'Library.dataRequirement.codeFilter.valueSet' + ) as any[]; return new Set(result); } diff --git a/src/rems-cds-hooks b/src/rems-cds-hooks index 3ced784d..51dd2d4d 160000 --- a/src/rems-cds-hooks +++ b/src/rems-cds-hooks @@ -1 +1 @@ -Subproject commit 3ced784d3c13577c22c9012447f20e29b029632f +Subproject commit 51dd2d4d3dd46313187b4fb2c035c5e9b62d0fdd