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