@nsshunt/stsfhirclient 1.0.57 → 1.0.59

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.
@@ -5063,11 +5063,18 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
5063
5063
  if (socket && socket.connected === true) {
5064
5064
  return;
5065
5065
  }
5066
+ console.log(chalk.yellow(`FhirSocketClient:#WaitForSocketConnected(): ID: [${__privateGet(this, _id)}] clientName: [${__privateGet(this, _clientName)}] Waiting for connection ...`));
5066
5067
  let connected = false;
5068
+ let attempts = 0;
5067
5069
  while (!connected) {
5070
+ attempts++;
5071
+ if (attempts % 10 === 0) {
5072
+ console.log(chalk.yellow(`FhirSocketClient:#WaitForSocketConnected(): ID: [${__privateGet(this, _id)}] clientName: [${__privateGet(this, _clientName)}] waiting for connection attempts: [${attempts}].`));
5073
+ }
5068
5074
  const socketRetVal = __privateGet(this, _socketUtils).GetSocket(__privateGet(this, _options2).socketClientName);
5069
5075
  if (socketRetVal && socketRetVal.connected === true) {
5070
5076
  connected = true;
5077
+ console.log(chalk.yellow(`FhirSocketClient:#WaitForSocketConnected(): ID: [${__privateGet(this, _id)}] clientName: [${__privateGet(this, _clientName)}] Connection completed after: [${attempts}] attempts.`));
5071
5078
  break;
5072
5079
  }
5073
5080
  await stsutils.Sleep(100);
@@ -5159,11 +5166,16 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
5159
5166
  body: {}
5160
5167
  };
5161
5168
  return new Promise((resolve, reject) => {
5169
+ const start = performance.now();
5162
5170
  this.socket.timeout(__privateGet(this, _options2).timeout).emit("getFhirResources", resource, request, (err, res) => {
5163
5171
  if (err) {
5172
+ const duration = (performance.now() - start) / 1e3;
5173
+ console.log(`FhirSocketClient:GetResources(): Duration for query (error): [${duration}]`);
5164
5174
  __privateGet(this, _error).call(this, `FhirSocketClient:GetResources(): ID: [${__privateGet(this, _id)}] clientName: [${__privateGet(this, _clientName)}] Error: [${err}]`);
5165
5175
  reject(err);
5166
5176
  } else {
5177
+ const duration = (performance.now() - start) / 1e3;
5178
+ console.log(`FhirSocketClient:GetResources(): Duration for query: [${duration}]`);
5167
5179
  resolve(res);
5168
5180
  }
5169
5181
  });