@nsshunt/stsfhirclient 2.0.42 → 2.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9702,25 +9702,24 @@ var FhirRESTClient = class {
9702
9702
  return `${this.#options.endpoint}:${this.#options.stsfhirport}${this.#options.stsfhirapiroot}`;
9703
9703
  }
9704
9704
  HandleError = (error) => {
9705
- this.#options.logger.error(chalk.red(`HandleError(): Error: [${error}]`));
9705
+ this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): Error: [${error}]`));
9706
9706
  if (axios.isAxiosError(error)) {
9707
9707
  const axiosError = error;
9708
9708
  if (axiosError.response) {
9709
- this.#options.logger.error(chalk.red(`AXIOS Error Response.Status = [${axiosError.response.status}]`));
9710
- if (axiosError.response.headers) this.#options.logger.error(chalk.red(` headers: [${JSON.stringify(axiosError.response.headers)}]`));
9711
- if (axiosError.response.data) this.#options.logger.error(chalk.red(` data: [${JSON.stringify(axiosError.response.data)}]`));
9709
+ this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): AXIOS Error Response.Status = [${axiosError.response.status}]`));
9710
+ if (axiosError.response.headers) this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): headers: [${JSON.stringify(axiosError.response.headers)}]`));
9711
+ if (axiosError.response.data) this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): data: [${JSON.stringify(axiosError.response.data)}]`));
9712
9712
  try {
9713
- if (axiosError.response.config) this.#options.logger.error(chalk.red(` config: [${JSON.stringify(axiosError.response.config)}]`));
9713
+ if (axiosError.response.config) this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): config: [${JSON.stringify(axiosError.response.config)}]`));
9714
9714
  } catch (innererror) {
9715
- this.#options.logger.error(chalk.red(` could not get response config, error: [${innererror}]`));
9715
+ this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): could not get response config, error: [${innererror}]`));
9716
9716
  }
9717
- } else this.#options.logger.error(chalk.red(`AXIOS Error = [${axiosError}]`));
9717
+ } else this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): AXIOS Error = [${axiosError}]`));
9718
9718
  }
9719
9719
  };
9720
9720
  LogError = (method, error) => {
9721
9721
  this.#options.logger.error(`FhirRESTClient:${method}(): Error: [${error}]`);
9722
9722
  this.#options.logger.error(error);
9723
- console.error(error);
9724
9723
  this.HandleError(error);
9725
9724
  };
9726
9725
  LogWarning = (method, message) => {
@@ -9824,14 +9823,8 @@ var FhirRESTClient = class {
9824
9823
  };
9825
9824
  else throw new Error(`FhirRESTClient:GetResource(): No response from #InvokeResourceAPI`);
9826
9825
  } catch (error) {
9827
- if (axios.isAxiosError(error)) {
9828
- const axiosError = error;
9829
- return {
9830
- status: axiosError.response.status,
9831
- body: axiosError.response.data,
9832
- headers: { ETag: axiosError.response.headers["etag"] }
9833
- };
9834
- } else throw error;
9826
+ this.LogError("GetResource", error);
9827
+ throw error;
9835
9828
  }
9836
9829
  };
9837
9830
  PutResource = async (resourceType, domainResource, versionIdETag) => {
@@ -9886,14 +9879,8 @@ var FhirRESTClient = class {
9886
9879
  };
9887
9880
  else throw new Error(`FhirRESTClient:GetHistoryInstanceFhirResource(): No response from #InvokeResourceAPI`);
9888
9881
  } catch (error) {
9889
- if (axios.isAxiosError(error)) {
9890
- const axiosError = error;
9891
- return {
9892
- status: axiosError.response.status,
9893
- body: axiosError.response.data,
9894
- headers: { ETag: axiosError.response.headers["etag"] }
9895
- };
9896
- } else throw error;
9882
+ this.LogError("GetHistoryInstanceFhirResource", error);
9883
+ throw error;
9897
9884
  }
9898
9885
  };
9899
9886
  ExtractNumber(str) {
@@ -9911,15 +9898,8 @@ var FhirRESTClient = class {
9911
9898
  };
9912
9899
  else throw new Error(`FhirRESTClient:DeleteResource(): No response from #InvokeResourceAPI`);
9913
9900
  } catch (error) {
9914
- if (axios.isAxiosError(error)) {
9915
- const axiosError = error;
9916
- const versionNumber = this.ExtractNumber(versionIdETag) + 1;
9917
- return {
9918
- status: axiosError.response.status,
9919
- body: axiosError.response.data,
9920
- headers: { ETag: `W/"${versionNumber}"` }
9921
- };
9922
- } else throw error;
9901
+ this.LogError("DeleteResource", error);
9902
+ throw error;
9923
9903
  }
9924
9904
  };
9925
9905
  GetMetadata = async () => {