@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.
@@ -9710,25 +9710,24 @@ var FhirRESTClient = class {
9710
9710
  return `${this.#options.endpoint}:${this.#options.stsfhirport}${this.#options.stsfhirapiroot}`;
9711
9711
  }
9712
9712
  HandleError = (error) => {
9713
- this.#options.logger.error(chalk.red(`HandleError(): Error: [${error}]`));
9713
+ this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): Error: [${error}]`));
9714
9714
  if (axios.default.isAxiosError(error)) {
9715
9715
  const axiosError = error;
9716
9716
  if (axiosError.response) {
9717
- this.#options.logger.error(chalk.red(`AXIOS Error Response.Status = [${axiosError.response.status}]`));
9718
- if (axiosError.response.headers) this.#options.logger.error(chalk.red(` headers: [${JSON.stringify(axiosError.response.headers)}]`));
9719
- if (axiosError.response.data) this.#options.logger.error(chalk.red(` data: [${JSON.stringify(axiosError.response.data)}]`));
9717
+ this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): AXIOS Error Response.Status = [${axiosError.response.status}]`));
9718
+ if (axiosError.response.headers) this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): headers: [${JSON.stringify(axiosError.response.headers)}]`));
9719
+ if (axiosError.response.data) this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): data: [${JSON.stringify(axiosError.response.data)}]`));
9720
9720
  try {
9721
- if (axiosError.response.config) this.#options.logger.error(chalk.red(` config: [${JSON.stringify(axiosError.response.config)}]`));
9721
+ if (axiosError.response.config) this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): config: [${JSON.stringify(axiosError.response.config)}]`));
9722
9722
  } catch (innererror) {
9723
- this.#options.logger.error(chalk.red(` could not get response config, error: [${innererror}]`));
9723
+ this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): could not get response config, error: [${innererror}]`));
9724
9724
  }
9725
- } else this.#options.logger.error(chalk.red(`AXIOS Error = [${axiosError}]`));
9725
+ } else this.#options.logger.error(chalk.red(`FhirRESTClient:HandleError(): AXIOS Error = [${axiosError}]`));
9726
9726
  }
9727
9727
  };
9728
9728
  LogError = (method, error) => {
9729
9729
  this.#options.logger.error(`FhirRESTClient:${method}(): Error: [${error}]`);
9730
9730
  this.#options.logger.error(error);
9731
- console.error(error);
9732
9731
  this.HandleError(error);
9733
9732
  };
9734
9733
  LogWarning = (method, message) => {
@@ -9832,14 +9831,8 @@ var FhirRESTClient = class {
9832
9831
  };
9833
9832
  else throw new Error(`FhirRESTClient:GetResource(): No response from #InvokeResourceAPI`);
9834
9833
  } catch (error) {
9835
- if (axios.default.isAxiosError(error)) {
9836
- const axiosError = error;
9837
- return {
9838
- status: axiosError.response.status,
9839
- body: axiosError.response.data,
9840
- headers: { ETag: axiosError.response.headers["etag"] }
9841
- };
9842
- } else throw error;
9834
+ this.LogError("GetResource", error);
9835
+ throw error;
9843
9836
  }
9844
9837
  };
9845
9838
  PutResource = async (resourceType, domainResource, versionIdETag) => {
@@ -9894,14 +9887,8 @@ var FhirRESTClient = class {
9894
9887
  };
9895
9888
  else throw new Error(`FhirRESTClient:GetHistoryInstanceFhirResource(): No response from #InvokeResourceAPI`);
9896
9889
  } catch (error) {
9897
- if (axios.default.isAxiosError(error)) {
9898
- const axiosError = error;
9899
- return {
9900
- status: axiosError.response.status,
9901
- body: axiosError.response.data,
9902
- headers: { ETag: axiosError.response.headers["etag"] }
9903
- };
9904
- } else throw error;
9890
+ this.LogError("GetHistoryInstanceFhirResource", error);
9891
+ throw error;
9905
9892
  }
9906
9893
  };
9907
9894
  ExtractNumber(str) {
@@ -9919,15 +9906,8 @@ var FhirRESTClient = class {
9919
9906
  };
9920
9907
  else throw new Error(`FhirRESTClient:DeleteResource(): No response from #InvokeResourceAPI`);
9921
9908
  } catch (error) {
9922
- if (axios.default.isAxiosError(error)) {
9923
- const axiosError = error;
9924
- const versionNumber = this.ExtractNumber(versionIdETag) + 1;
9925
- return {
9926
- status: axiosError.response.status,
9927
- body: axiosError.response.data,
9928
- headers: { ETag: `W/"${versionNumber}"` }
9929
- };
9930
- } else throw error;
9909
+ this.LogError("DeleteResource", error);
9910
+ throw error;
9931
9911
  }
9932
9912
  };
9933
9913
  GetMetadata = async () => {