From af8e9ff24b3a446802a6de9fe040b5db947226db Mon Sep 17 00:00:00 2001 From: martin-nhs Date: Fri, 10 May 2024 12:02:02 +0100 Subject: [PATCH 1/2] [PRMT-4832] Added more logging. --- src/services/fhir/sds-fhir-client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/fhir/sds-fhir-client.js b/src/services/fhir/sds-fhir-client.js index 049e50f..3deffa7 100644 --- a/src/services/fhir/sds-fhir-client.js +++ b/src/services/fhir/sds-fhir-client.js @@ -18,6 +18,8 @@ export const getPracticeAsid = async (odsCode, serviceId) => { const entries = response.data.entry; + logInfo(`Found entries, length: ${entries.length}`); + if (entries.length === 0) { throw new Error(`No ASID entries found for ODS code ${odsCode}`); } @@ -43,7 +45,9 @@ export const getPracticeAsid = async (odsCode, serviceId) => { logInfo(`Successfully retrieved ASID: ${asidCode} via FHIR for ODS code ${odsCode}`); return asidCode; } catch (err) { - logError(`Failed to retrieve ASID from FHIR for ODS Code: ${odsCode}`, err); + logError( + `Failed to retrieve ASID from FHIR for ODS Code: ${odsCode} - error: ${JSON.stringify(err)}` + ); if (err.response) { logError( `Error: Request failed with non-2xx status code\n From db646be545c1bb7b49b92aa7dc9d14ef824fc5d5 Mon Sep 17 00:00:00 2001 From: martin-nhs Date: Fri, 10 May 2024 12:06:29 +0100 Subject: [PATCH 2/2] [PRMT-4832] Added more logging. --- src/services/fhir/sds-fhir-client.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/services/fhir/sds-fhir-client.js b/src/services/fhir/sds-fhir-client.js index 3deffa7..e36d92b 100644 --- a/src/services/fhir/sds-fhir-client.js +++ b/src/services/fhir/sds-fhir-client.js @@ -18,8 +18,6 @@ export const getPracticeAsid = async (odsCode, serviceId) => { const entries = response.data.entry; - logInfo(`Found entries, length: ${entries.length}`); - if (entries.length === 0) { throw new Error(`No ASID entries found for ODS code ${odsCode}`); }