From 0260177606e73d9780cde43649bd5120d1d79346 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Wed, 19 Feb 2025 15:10:15 -0500 Subject: [PATCH 1/2] env bug --- .env | 2 +- frontend/src/App.tsx | 2 +- frontend/src/views/DataViews/CaseCollection.tsx | 4 ++-- frontend/src/views/DataViews/Medications.tsx | 2 +- frontend/src/views/DataViews/MetRequirements.tsx | 6 +++--- src/config.ts | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.env b/.env index d1feeb0..3ae3aff 100644 --- a/.env +++ b/.env @@ -5,7 +5,7 @@ LOGGING_LEVEL = debug MONGO_DB_NAME = remsadmin MONGO_URL = mongodb://rems-user:pass@127.0.0.1:27017 PORT = 8090 -RESOURCE_SERVER = http://localhost:8090 +RESOURCE_SERVER = http://localhost:8090/ SMART_ENDPOINT = http://localhost:4040/launch USE_HTTPS = false VSAC_API_KEY = changeMe diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2d8b36b..fe4b2dd 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -29,7 +29,7 @@ function App() { const resetDB = async () => { setOpen(false); await axios - .post(process.env.RESOURCE_SERVER + '/etasu/reset') + .post(process.env.RESOURCE_SERVER + 'etasu/reset') .then(function (response: any) { console.log(response); setForceRefresh(true); diff --git a/frontend/src/views/DataViews/CaseCollection.tsx b/frontend/src/views/DataViews/CaseCollection.tsx index 2e2339d..0c7e496 100644 --- a/frontend/src/views/DataViews/CaseCollection.tsx +++ b/frontend/src/views/DataViews/CaseCollection.tsx @@ -56,7 +56,7 @@ const CaseCollection = (props: { refresh: boolean }) => { }, []); const getAllRemsCase = async () => { - const url = process.env.RESOURCE_SERVER + '/api/all/remscase'; + const url = process.env.RESOURCE_SERVER + 'api/all/remscase'; await axios .get(url) .then(function (response: { data: SetStateAction }) { @@ -70,7 +70,7 @@ const CaseCollection = (props: { refresh: boolean }) => { }; const deleteSingleRow = async (event: any, row: RemsCase) => { - const url = process.env.RESOURCE_SERVER + '/api/remsCase/deleteOne'; + const url = process.env.RESOURCE_SERVER + 'api/remsCase/deleteOne'; await axios .post(url, { data: { params: row } }) .then(function (response: { data: any; status: number }) { diff --git a/frontend/src/views/DataViews/Medications.tsx b/frontend/src/views/DataViews/Medications.tsx index aa37011..18749fe 100644 --- a/frontend/src/views/DataViews/Medications.tsx +++ b/frontend/src/views/DataViews/Medications.tsx @@ -46,7 +46,7 @@ const Medications = (props: { refresh: boolean }) => { }, []); const getAllMedications = async () => { - const url = process.env.RESOURCE_SERVER + '/api/all/medications'; + const url = process.env.RESOURCE_SERVER + 'api/all/medications'; await axios .get(url) .then(function (response: { data: SetStateAction }) { diff --git a/frontend/src/views/DataViews/MetRequirements.tsx b/frontend/src/views/DataViews/MetRequirements.tsx index d544fcf..a74225e 100644 --- a/frontend/src/views/DataViews/MetRequirements.tsx +++ b/frontend/src/views/DataViews/MetRequirements.tsx @@ -44,7 +44,7 @@ const MetRequirements = (props: { refresh: boolean }) => { }, []); const getAllMetReqs = async () => { - const url = process.env.RESOURCE_SERVER + '/api/all/metreqs'; + const url = process.env.RESOURCE_SERVER + 'api/all/metreqs'; await axios .get(url) .then(function (response: { data: any }) { @@ -58,7 +58,7 @@ const MetRequirements = (props: { refresh: boolean }) => { }; const deleteSingleRow = async (event: any, row: MetRequirements) => { - const url = process.env.RESOURCE_SERVER + '/api/metreqs/deleteOne'; + const url = process.env.RESOURCE_SERVER + 'api/metreqs/deleteOne'; await axios .post(url, { data: { params: row } }) .then(function (response: { data: any; status: number }) { @@ -73,7 +73,7 @@ const MetRequirements = (props: { refresh: boolean }) => { }; const formattedQuestionnaire = (row: MetRequirements) => { - return row?.completedQuestionnaire?.questionnaire.split(process.env.RESOURCE_SERVER + '/4_0_0/')[1]; + return row?.completedQuestionnaire?.questionnaire.split(process.env.RESOURCE_SERVER + '4_0_0/')[1]; }; const formattedCompleted = (row: MetRequirements) => { return row?.completed === true ? 'Yes' : 'No'; diff --git a/src/config.ts b/src/config.ts index ddf13a6..58745c6 100644 --- a/src/config.ts +++ b/src/config.ts @@ -41,7 +41,7 @@ export default { fhirServerConfig: { auth: { // This server's URI - resourceServer: env.get('RESOURCE_SERVER').required() + '/' + resourceServer: env.get('RESOURCE_SERVER').required().asUrlString() // // if you use this strategy, you need to add the corresponding env vars to docker-compose // From 03b0532bed6c23bf9f52ed3f75e39e3f9e8eaec2 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Tue, 18 Mar 2025 09:55:47 -0400 Subject: [PATCH 2/2] update config for tests --- src/hooks/hookResources.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/hookResources.ts b/src/hooks/hookResources.ts index 05321ff..deaccad 100644 --- a/src/hooks/hookResources.ts +++ b/src/hooks/hookResources.ts @@ -152,7 +152,7 @@ export const codeMap: { [key: string]: CardRule[] } = { } ], stakeholderType: 'prescriber', - summary: 'iPledge/Isotretinoin REMS Provider Requirements', + summary: 'iPledge/Isotretinoin REMS Prescriber Requirements', cardDetails: CARD_DETAILS } ],