@nsshunt/stsfhirpg 1.0.21 → 1.0.22

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.
@@ -17008,8 +17008,11 @@ var PGFhirAccessLayer = class extends import_tiny_emitter.TinyEmitter {
17008
17008
  return this.#dbSTSResourceVersion;
17009
17009
  };
17010
17010
  UpdateIndexes = async (client, resource) => {
17011
- performance.now();
17011
+ let start = performance.now();
17012
+ const oa = start;
17012
17013
  const searchIndexData = this.#dbSearchIndex.GetSearchIndexData(resource);
17014
+ const lap1 = performance.now() - start;
17015
+ start = performance.now();
17013
17016
  const InsertResourceLinkRecord = async (client, resourceLinkIndexRecord) => {
17014
17017
  await this.#dbSTSResourceLink.InsertResourceLink(client, resourceLinkIndexRecord);
17015
17018
  };
@@ -17034,7 +17037,6 @@ var PGFhirAccessLayer = class extends import_tiny_emitter.TinyEmitter {
17034
17037
  const InsertResourceComboRecord = async (client, comboRecord) => {
17035
17038
  await this.#dbSTSCombo.InsertRecord(client, comboRecord);
17036
17039
  };
17037
- performance.now();
17038
17040
  await this.#dbSTSResourceLink.DeleteResourceLinkRecord(client, {
17039
17041
  RES_ID: resource.id,
17040
17042
  RES_TYPE: resource.resourceType
@@ -17067,7 +17069,8 @@ var PGFhirAccessLayer = class extends import_tiny_emitter.TinyEmitter {
17067
17069
  RES_ID: resource.id,
17068
17070
  RES_TYPE: resource.resourceType
17069
17071
  });
17070
- performance.now();
17072
+ const lap2 = performance.now() - start;
17073
+ start = performance.now();
17071
17074
  try {
17072
17075
  for (let i = 0; i < searchIndexData.length; i++) {
17073
17076
  const si = searchIndexData[i];
@@ -17104,6 +17107,9 @@ var PGFhirAccessLayer = class extends import_tiny_emitter.TinyEmitter {
17104
17107
  } catch (error) {
17105
17108
  console.error(error);
17106
17109
  }
17110
+ const lap3 = performance.now() - start;
17111
+ const total = performance.now() - oa;
17112
+ if (total * 1e3 > 50) console.log(`--> Slow: O/A:[${total.toFixed(2)}] Index Calc:[${lap1.toFixed(2)}] Delete:[${lap2.toFixed(2)}] Insert:[${lap3.toFixed(2)}]`);
17107
17113
  };
17108
17114
  #isInTransaction = async (client) => {
17109
17115
  return (await client.query(`