@nsshunt/stsfhirpg 1.2.17 → 1.2.18

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/index.cjs CHANGED
@@ -40,10 +40,13 @@ crypto = __toESM(crypto);
40
40
  let _nsshunt_stsutils = require("@nsshunt/stsutils");
41
41
  let _nsshunt_stsconfig = require("@nsshunt/stsconfig");
42
42
  let redis = require("redis");
43
+ let chalk = require("chalk");
44
+ chalk = __toESM(chalk);
43
45
  let node_crypto = require("node:crypto");
44
46
  let _nsshunt_stsfhirclient = require("@nsshunt/stsfhirclient");
45
47
  let cluster = require("cluster");
46
48
  cluster = __toESM(cluster);
49
+ let tiny_emitter = require("tiny-emitter");
47
50
  //#region node_modules/luxon/build/es6/luxon.mjs
48
51
  /**
49
52
  * @private
@@ -7186,341 +7189,6 @@ var ResourceHelper = class ResourceHelper {
7186
7189
  };
7187
7190
  };
7188
7191
  //#endregion
7189
- //#region node_modules/chalk/source/vendor/ansi-styles/index.js
7190
- var ANSI_BACKGROUND_OFFSET = 10;
7191
- var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
7192
- var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
7193
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
7194
- var styles$1 = {
7195
- modifier: {
7196
- reset: [0, 0],
7197
- bold: [1, 22],
7198
- dim: [2, 22],
7199
- italic: [3, 23],
7200
- underline: [4, 24],
7201
- overline: [53, 55],
7202
- inverse: [7, 27],
7203
- hidden: [8, 28],
7204
- strikethrough: [9, 29]
7205
- },
7206
- color: {
7207
- black: [30, 39],
7208
- red: [31, 39],
7209
- green: [32, 39],
7210
- yellow: [33, 39],
7211
- blue: [34, 39],
7212
- magenta: [35, 39],
7213
- cyan: [36, 39],
7214
- white: [37, 39],
7215
- blackBright: [90, 39],
7216
- gray: [90, 39],
7217
- grey: [90, 39],
7218
- redBright: [91, 39],
7219
- greenBright: [92, 39],
7220
- yellowBright: [93, 39],
7221
- blueBright: [94, 39],
7222
- magentaBright: [95, 39],
7223
- cyanBright: [96, 39],
7224
- whiteBright: [97, 39]
7225
- },
7226
- bgColor: {
7227
- bgBlack: [40, 49],
7228
- bgRed: [41, 49],
7229
- bgGreen: [42, 49],
7230
- bgYellow: [43, 49],
7231
- bgBlue: [44, 49],
7232
- bgMagenta: [45, 49],
7233
- bgCyan: [46, 49],
7234
- bgWhite: [47, 49],
7235
- bgBlackBright: [100, 49],
7236
- bgGray: [100, 49],
7237
- bgGrey: [100, 49],
7238
- bgRedBright: [101, 49],
7239
- bgGreenBright: [102, 49],
7240
- bgYellowBright: [103, 49],
7241
- bgBlueBright: [104, 49],
7242
- bgMagentaBright: [105, 49],
7243
- bgCyanBright: [106, 49],
7244
- bgWhiteBright: [107, 49]
7245
- }
7246
- };
7247
- Object.keys(styles$1.modifier);
7248
- var foregroundColorNames = Object.keys(styles$1.color);
7249
- var backgroundColorNames = Object.keys(styles$1.bgColor);
7250
- [...foregroundColorNames, ...backgroundColorNames];
7251
- function assembleStyles() {
7252
- const codes = /* @__PURE__ */ new Map();
7253
- for (const [groupName, group] of Object.entries(styles$1)) {
7254
- for (const [styleName, style] of Object.entries(group)) {
7255
- styles$1[styleName] = {
7256
- open: `\u001B[${style[0]}m`,
7257
- close: `\u001B[${style[1]}m`
7258
- };
7259
- group[styleName] = styles$1[styleName];
7260
- codes.set(style[0], style[1]);
7261
- }
7262
- Object.defineProperty(styles$1, groupName, {
7263
- value: group,
7264
- enumerable: false
7265
- });
7266
- }
7267
- Object.defineProperty(styles$1, "codes", {
7268
- value: codes,
7269
- enumerable: false
7270
- });
7271
- styles$1.color.close = "\x1B[39m";
7272
- styles$1.bgColor.close = "\x1B[49m";
7273
- styles$1.color.ansi = wrapAnsi16();
7274
- styles$1.color.ansi256 = wrapAnsi256();
7275
- styles$1.color.ansi16m = wrapAnsi16m();
7276
- styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
7277
- styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
7278
- styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
7279
- Object.defineProperties(styles$1, {
7280
- rgbToAnsi256: {
7281
- value(red, green, blue) {
7282
- if (red === green && green === blue) {
7283
- if (red < 8) return 16;
7284
- if (red > 248) return 231;
7285
- return Math.round((red - 8) / 247 * 24) + 232;
7286
- }
7287
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
7288
- },
7289
- enumerable: false
7290
- },
7291
- hexToRgb: {
7292
- value(hex) {
7293
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
7294
- if (!matches) return [
7295
- 0,
7296
- 0,
7297
- 0
7298
- ];
7299
- let [colorString] = matches;
7300
- if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
7301
- const integer = Number.parseInt(colorString, 16);
7302
- return [
7303
- integer >> 16 & 255,
7304
- integer >> 8 & 255,
7305
- integer & 255
7306
- ];
7307
- },
7308
- enumerable: false
7309
- },
7310
- hexToAnsi256: {
7311
- value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
7312
- enumerable: false
7313
- },
7314
- ansi256ToAnsi: {
7315
- value(code) {
7316
- if (code < 8) return 30 + code;
7317
- if (code < 16) return 90 + (code - 8);
7318
- let red;
7319
- let green;
7320
- let blue;
7321
- if (code >= 232) {
7322
- red = ((code - 232) * 10 + 8) / 255;
7323
- green = red;
7324
- blue = red;
7325
- } else {
7326
- code -= 16;
7327
- const remainder = code % 36;
7328
- red = Math.floor(code / 36) / 5;
7329
- green = Math.floor(remainder / 6) / 5;
7330
- blue = remainder % 6 / 5;
7331
- }
7332
- const value = Math.max(red, green, blue) * 2;
7333
- if (value === 0) return 30;
7334
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
7335
- if (value === 2) result += 60;
7336
- return result;
7337
- },
7338
- enumerable: false
7339
- },
7340
- rgbToAnsi: {
7341
- value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
7342
- enumerable: false
7343
- },
7344
- hexToAnsi: {
7345
- value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
7346
- enumerable: false
7347
- }
7348
- });
7349
- return styles$1;
7350
- }
7351
- var ansiStyles = assembleStyles();
7352
- //#endregion
7353
- //#region node_modules/chalk/source/vendor/supports-color/browser.js
7354
- var level = (() => {
7355
- if (!("navigator" in globalThis)) return 0;
7356
- if (globalThis.navigator.userAgentData) {
7357
- const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
7358
- if (brand && brand.version > 93) return 3;
7359
- }
7360
- if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
7361
- return 0;
7362
- })();
7363
- var colorSupport = level !== 0 && {
7364
- level,
7365
- hasBasic: true,
7366
- has256: level >= 2,
7367
- has16m: level >= 3
7368
- };
7369
- var supportsColor = {
7370
- stdout: colorSupport,
7371
- stderr: colorSupport
7372
- };
7373
- //#endregion
7374
- //#region node_modules/chalk/source/utilities.js
7375
- function stringReplaceAll(string, substring, replacer) {
7376
- let index = string.indexOf(substring);
7377
- if (index === -1) return string;
7378
- const substringLength = substring.length;
7379
- let endIndex = 0;
7380
- let returnValue = "";
7381
- do {
7382
- returnValue += string.slice(endIndex, index) + substring + replacer;
7383
- endIndex = index + substringLength;
7384
- index = string.indexOf(substring, endIndex);
7385
- } while (index !== -1);
7386
- returnValue += string.slice(endIndex);
7387
- return returnValue;
7388
- }
7389
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
7390
- let endIndex = 0;
7391
- let returnValue = "";
7392
- do {
7393
- const gotCR = string[index - 1] === "\r";
7394
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
7395
- endIndex = index + 1;
7396
- index = string.indexOf("\n", endIndex);
7397
- } while (index !== -1);
7398
- returnValue += string.slice(endIndex);
7399
- return returnValue;
7400
- }
7401
- //#endregion
7402
- //#region node_modules/chalk/source/index.js
7403
- var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
7404
- var GENERATOR = Symbol("GENERATOR");
7405
- var STYLER = Symbol("STYLER");
7406
- var IS_EMPTY = Symbol("IS_EMPTY");
7407
- var levelMapping = [
7408
- "ansi",
7409
- "ansi",
7410
- "ansi256",
7411
- "ansi16m"
7412
- ];
7413
- var styles = Object.create(null);
7414
- var applyOptions = (object, options = {}) => {
7415
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
7416
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
7417
- object.level = options.level === void 0 ? colorLevel : options.level;
7418
- };
7419
- var chalkFactory = (options) => {
7420
- const chalk = (...strings) => strings.join(" ");
7421
- applyOptions(chalk, options);
7422
- Object.setPrototypeOf(chalk, createChalk.prototype);
7423
- return chalk;
7424
- };
7425
- function createChalk(options) {
7426
- return chalkFactory(options);
7427
- }
7428
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
7429
- for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
7430
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
7431
- Object.defineProperty(this, styleName, { value: builder });
7432
- return builder;
7433
- } };
7434
- styles.visible = { get() {
7435
- const builder = createBuilder(this, this[STYLER], true);
7436
- Object.defineProperty(this, "visible", { value: builder });
7437
- return builder;
7438
- } };
7439
- var getModelAnsi = (model, level, type, ...arguments_) => {
7440
- if (model === "rgb") {
7441
- if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
7442
- if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
7443
- return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
7444
- }
7445
- if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
7446
- return ansiStyles[type][model](...arguments_);
7447
- };
7448
- for (const model of [
7449
- "rgb",
7450
- "hex",
7451
- "ansi256"
7452
- ]) {
7453
- styles[model] = { get() {
7454
- const { level } = this;
7455
- return function(...arguments_) {
7456
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
7457
- return createBuilder(this, styler, this[IS_EMPTY]);
7458
- };
7459
- } };
7460
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
7461
- styles[bgModel] = { get() {
7462
- const { level } = this;
7463
- return function(...arguments_) {
7464
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
7465
- return createBuilder(this, styler, this[IS_EMPTY]);
7466
- };
7467
- } };
7468
- }
7469
- var proto = Object.defineProperties(() => {}, {
7470
- ...styles,
7471
- level: {
7472
- enumerable: true,
7473
- get() {
7474
- return this[GENERATOR].level;
7475
- },
7476
- set(level) {
7477
- this[GENERATOR].level = level;
7478
- }
7479
- }
7480
- });
7481
- var createStyler = (open, close, parent) => {
7482
- let openAll;
7483
- let closeAll;
7484
- if (parent === void 0) {
7485
- openAll = open;
7486
- closeAll = close;
7487
- } else {
7488
- openAll = parent.openAll + open;
7489
- closeAll = close + parent.closeAll;
7490
- }
7491
- return {
7492
- open,
7493
- close,
7494
- openAll,
7495
- closeAll,
7496
- parent
7497
- };
7498
- };
7499
- var createBuilder = (self, _styler, _isEmpty) => {
7500
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
7501
- Object.setPrototypeOf(builder, proto);
7502
- builder[GENERATOR] = self;
7503
- builder[STYLER] = _styler;
7504
- builder[IS_EMPTY] = _isEmpty;
7505
- return builder;
7506
- };
7507
- var applyStyle = (self, string) => {
7508
- if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
7509
- let styler = self[STYLER];
7510
- if (styler === void 0) return string;
7511
- const { openAll, closeAll } = styler;
7512
- if (string.includes("\x1B")) while (styler !== void 0) {
7513
- string = stringReplaceAll(string, styler.close, styler.open);
7514
- styler = styler.parent;
7515
- }
7516
- const lfIndex = string.indexOf("\n");
7517
- if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
7518
- return openAll + string + closeAll;
7519
- };
7520
- Object.defineProperties(createChalk.prototype, styles);
7521
- var chalk = createChalk();
7522
- createChalk({ level: stderrColor ? stderrColor.level : 0 });
7523
- //#endregion
7524
7192
  //#region node_modules/valid-url/index.js
7525
7193
  var require_valid_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7526
7194
  (function(module$1) {
@@ -9340,8 +9008,8 @@ var DBSearchIndexDates = class extends DBSearchIndexBase {
9340
9008
  return retVal;
9341
9009
  };
9342
9010
  OutputIndexRecordToConsole = (tir) => {
9343
- const datesPromptColour = chalk.rgb(200, 200, 255);
9344
- const datesColour = chalk.rgb(200, 150, 10);
9011
+ const datesPromptColour = chalk.default.rgb(200, 200, 255);
9012
+ const datesColour = chalk.default.rgb(200, 150, 10);
9345
9013
  let retVal = "";
9346
9014
  let sep = "";
9347
9015
  if (tir) for (let i = 0; i < tir.length; i++) {
@@ -9360,7 +9028,7 @@ var DBSearchIndexDates = class extends DBSearchIndexBase {
9360
9028
  retVal = `${retVal}${sep}${outputText}`;
9361
9029
  sep = "\n";
9362
9030
  }
9363
- if (retVal === "") this.#debug(chalk.rgb(250, 50, 100)` --> *** DATE: Search Param Not Found *** <--`);
9031
+ if (retVal === "") this.#debug(chalk.default.rgb(250, 50, 100)` --> *** DATE: Search Param Not Found *** <--`);
9364
9032
  else this.#debug(retVal);
9365
9033
  return retVal;
9366
9034
  };
@@ -9763,7 +9431,7 @@ var DBSearchIndex = class DBSearchIndex {
9763
9431
  await this.resourceHelper.Stop();
9764
9432
  };
9765
9433
  #OutputSearchDetails = (resourceName, resourceId, searchFieldRecord) => {
9766
- const hl = chalk.yellow.bold.italic;
9434
+ const hl = chalk.default.yellow.bold.italic;
9767
9435
  this.#debug("------------------");
9768
9436
  this.#debug(`resource: [${hl(resourceName)}] \
9769
9437
  resourceId: [${hl(resourceId)}] \
@@ -14311,53 +13979,11 @@ import_lib.default.TypeOverrides;
14311
13979
  import_lib.default.defaults;
14312
13980
  //#endregion
14313
13981
  //#region src/fhir-database/pg/pgpoolmanager.ts
14314
- var import_tiny_emitter = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
14315
- function E() {}
14316
- E.prototype = {
14317
- on: function(name, callback, ctx) {
14318
- var e = this.e || (this.e = {});
14319
- (e[name] || (e[name] = [])).push({
14320
- fn: callback,
14321
- ctx
14322
- });
14323
- return this;
14324
- },
14325
- once: function(name, callback, ctx) {
14326
- var self = this;
14327
- function listener() {
14328
- self.off(name, listener);
14329
- callback.apply(ctx, arguments);
14330
- }
14331
- listener._ = callback;
14332
- return this.on(name, listener, ctx);
14333
- },
14334
- emit: function(name) {
14335
- var data = [].slice.call(arguments, 1);
14336
- var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
14337
- var i = 0;
14338
- var len = evtArr.length;
14339
- for (; i < len; i++) evtArr[i].fn.apply(evtArr[i].ctx, data);
14340
- return this;
14341
- },
14342
- off: function(name, callback) {
14343
- var e = this.e || (this.e = {});
14344
- var evts = e[name];
14345
- var liveEvents = [];
14346
- if (evts && callback) {
14347
- for (var i = 0, len = evts.length; i < len; i++) if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]);
14348
- }
14349
- liveEvents.length ? e[name] = liveEvents : delete e[name];
14350
- return this;
14351
- }
14352
- };
14353
- module.exports = E;
14354
- module.exports.TinyEmitter = E;
14355
- })))();
14356
13982
  var IDBAccessLayerEvents = /* @__PURE__ */ function(IDBAccessLayerEvents) {
14357
13983
  IDBAccessLayerEvents["UpdateInstruments"] = "UpdateInstruments";
14358
13984
  return IDBAccessLayerEvents;
14359
13985
  }({});
14360
- var PGPoolManager = class extends import_tiny_emitter.TinyEmitter {
13986
+ var PGPoolManager = class extends tiny_emitter.TinyEmitter {
14361
13987
  #options;
14362
13988
  #observer = null;
14363
13989
  #pools = {};
@@ -14397,15 +14023,15 @@ var PGPoolManager = class extends import_tiny_emitter.TinyEmitter {
14397
14023
  safeConnectionString,
14398
14024
  pool
14399
14025
  };
14400
- if (cluster.default.isPrimary) this.#LogDebugMessage(chalk.yellow(`Created Database Pool with Master Thread, PID: [${process.pid}]`));
14401
- else this.#LogDebugMessage(chalk.yellow(`Created Database Pool with Worker Thread, PID: [${process.pid}]`));
14402
- this.#LogDebugMessage(chalk.yellow(`Created Database Pool: Master Thread`));
14403
- this.#LogDebugMessage(chalk.yellow(` Connection URI: [${safeConnectionString}]`));
14404
- this.#LogDebugMessage(chalk.yellow(` Maximum Pool Size: [${poolSize}]`));
14405
- this.#LogDebugMessage(chalk.yellow(` SSL Connection: [${isProduction}]`));
14026
+ if (cluster.default.isPrimary) this.#LogDebugMessage(chalk.default.yellow(`Created Database Pool with Master Thread, PID: [${process.pid}]`));
14027
+ else this.#LogDebugMessage(chalk.default.yellow(`Created Database Pool with Worker Thread, PID: [${process.pid}]`));
14028
+ this.#LogDebugMessage(chalk.default.yellow(`Created Database Pool: Master Thread`));
14029
+ this.#LogDebugMessage(chalk.default.yellow(` Connection URI: [${safeConnectionString}]`));
14030
+ this.#LogDebugMessage(chalk.default.yellow(` Maximum Pool Size: [${poolSize}]`));
14031
+ this.#LogDebugMessage(chalk.default.yellow(` SSL Connection: [${isProduction}]`));
14406
14032
  pool.on("error", (error) => {
14407
- this.#LogDebugMessage(chalk.red(`[${safeConnectionString}]: pool error`));
14408
- this.#LogErrorMessage(chalk.red(`Unexpected error on idle client: [${error}], connection: [${safeConnectionString}]`));
14033
+ this.#LogDebugMessage(chalk.default.red(`[${safeConnectionString}]: pool error`));
14034
+ this.#LogErrorMessage(chalk.default.red(`Unexpected error on idle client: [${error}], connection: [${safeConnectionString}]`));
14409
14035
  });
14410
14036
  pool.on("connect", () => {
14411
14037
  this.#UpdateInstruments();
@@ -14415,8 +14041,8 @@ var PGPoolManager = class extends import_tiny_emitter.TinyEmitter {
14415
14041
  });
14416
14042
  pool.on("release", (error) => {
14417
14043
  if (error) {
14418
- this.#LogDebugMessage(chalk.red(`[${safeConnectionString}]: pool release`));
14419
- this.#LogErrorMessage(chalk.red(`Unexpected error on client release from pool: [${error}], connection: [${safeConnectionString}]`));
14044
+ this.#LogDebugMessage(chalk.default.red(`[${safeConnectionString}]: pool release`));
14045
+ this.#LogErrorMessage(chalk.default.red(`Unexpected error on client release from pool: [${error}], connection: [${safeConnectionString}]`));
14420
14046
  }
14421
14047
  this.#UpdateInstruments();
14422
14048
  });
@@ -14425,19 +14051,19 @@ var PGPoolManager = class extends import_tiny_emitter.TinyEmitter {
14425
14051
  });
14426
14052
  }
14427
14053
  async EndPool(poolItem) {
14428
- this.#LogDebugMessage(chalk.cyan(`Ending database for process PID: ${process.pid}`));
14054
+ this.#LogDebugMessage(chalk.default.cyan(`Ending database for process PID: ${process.pid}`));
14429
14055
  if (poolItem) {
14430
- this.#LogDebugMessage(chalk.cyan(`ending pool with connection string: [${poolItem.safeConnectionString}]`));
14431
- this.#LogDebugMessage(chalk.cyan(`pool details (before end), Total: [${poolItem.pool.totalCount}], Idle: [${poolItem.pool.idleCount}], Waiting: [${poolItem.pool.waitingCount}]`));
14056
+ this.#LogDebugMessage(chalk.default.cyan(`ending pool with connection string: [${poolItem.safeConnectionString}]`));
14057
+ this.#LogDebugMessage(chalk.default.cyan(`pool details (before end), Total: [${poolItem.pool.totalCount}], Idle: [${poolItem.pool.idleCount}], Waiting: [${poolItem.pool.waitingCount}]`));
14432
14058
  await poolItem.pool.end();
14433
- this.#LogDebugMessage(chalk.cyan(`pool details (after end), Total: [${poolItem.pool.totalCount}], Idle: [${poolItem.pool.idleCount}], Waiting: [${poolItem.pool.waitingCount}]`));
14434
- this.#LogDebugMessage(chalk.green(`Database pool ended for PID: ${process.pid}`));
14059
+ this.#LogDebugMessage(chalk.default.cyan(`pool details (after end), Total: [${poolItem.pool.totalCount}], Idle: [${poolItem.pool.idleCount}], Waiting: [${poolItem.pool.waitingCount}]`));
14060
+ this.#LogDebugMessage(chalk.default.green(`Database pool ended for PID: ${process.pid}`));
14435
14061
  poolItem.pool.removeAllListeners();
14436
- this.#LogDebugMessage(chalk.green(`Removed all listeners: ${process.pid}`));
14437
- } else this.#LogDebugMessage(chalk.yellow(`Database pool was not defined - not ended for PID: ${process.pid}`));
14062
+ this.#LogDebugMessage(chalk.default.green(`Removed all listeners: ${process.pid}`));
14063
+ } else this.#LogDebugMessage(chalk.default.yellow(`Database pool was not defined - not ended for PID: ${process.pid}`));
14438
14064
  }
14439
14065
  async End() {
14440
- this.#LogDebugMessage(chalk.cyan(`Ending database for process PID: ${process.pid}`));
14066
+ this.#LogDebugMessage(chalk.default.cyan(`Ending database for process PID: ${process.pid}`));
14441
14067
  for (const [, pool] of Object.entries(this.#pools)) await this.EndPool(pool);
14442
14068
  this.#DetachInstruments();
14443
14069
  }
@@ -15485,8 +15111,8 @@ var DBSTSCombo = class {
15485
15111
  };
15486
15112
  //#endregion
15487
15113
  //#region src/fhir-database/pg/pgfhiraccesslayer.ts
15488
- chalk.level = 3;
15489
- var PGFhirAccessLayer = class extends import_tiny_emitter.TinyEmitter {
15114
+ chalk.default.level = 3;
15115
+ var PGFhirAccessLayer = class extends tiny_emitter.TinyEmitter {
15490
15116
  #options;
15491
15117
  #poolManager = null;
15492
15118
  #dbSTSResource;
@@ -15639,9 +15265,9 @@ var PGFhirAccessLayer = class extends import_tiny_emitter.TinyEmitter {
15639
15265
  }
15640
15266
  const lap3 = performance.now() - start;
15641
15267
  const total = performance.now() - oa;
15642
- if (total > 100) console.log(chalk.hex("#E33A36")`--> Slow: O/A:[${total.toFixed(2)}] Index Calc:[${lap1.toFixed(2)}] Delete:[${lap2.toFixed(2)}] Insert:[${lap3.toFixed(2)}]`);
15643
- else if (total > 75) console.log(chalk.hex("#e27270")`--> Slow: O/A:[${total.toFixed(2)}] Index Calc:[${lap1.toFixed(2)}] Delete:[${lap2.toFixed(2)}] Insert:[${lap3.toFixed(2)}]`);
15644
- else if (total > 50) console.log(chalk.hex("#e2c3c2")`--> Slow: O/A:[${total.toFixed(2)}] Index Calc:[${lap1.toFixed(2)}] Delete:[${lap2.toFixed(2)}] Insert:[${lap3.toFixed(2)}]`);
15268
+ if (total > 100) console.log(chalk.default.hex("#E33A36")`--> Slow: O/A:[${total.toFixed(2)}] Index Calc:[${lap1.toFixed(2)}] Delete:[${lap2.toFixed(2)}] Insert:[${lap3.toFixed(2)}]`);
15269
+ else if (total > 75) console.log(chalk.default.hex("#e27270")`--> Slow: O/A:[${total.toFixed(2)}] Index Calc:[${lap1.toFixed(2)}] Delete:[${lap2.toFixed(2)}] Insert:[${lap3.toFixed(2)}]`);
15270
+ else if (total > 50) console.log(chalk.default.hex("#e2c3c2")`--> Slow: O/A:[${total.toFixed(2)}] Index Calc:[${lap1.toFixed(2)}] Delete:[${lap2.toFixed(2)}] Insert:[${lap3.toFixed(2)}]`);
15645
15271
  };
15646
15272
  #isInTransaction = async (client) => {
15647
15273
  return (await client.query(`