@nsshunt/stsfhirpg 1.0.15 → 1.0.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/stsfhirpg.cjs
CHANGED
|
@@ -18305,42 +18305,43 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18305
18305
|
UpdateIndexes = async (client2, resource) => {
|
|
18306
18306
|
performance.now();
|
|
18307
18307
|
const searchIndexData = this.#dbSearchIndex.GetSearchIndexData(resource);
|
|
18308
|
-
const InsertResourceLinkRecord = (client22, resourceLinkIndexRecord) => {
|
|
18309
|
-
this.#dbSTSResourceLink.InsertResourceLink(client22, resourceLinkIndexRecord);
|
|
18308
|
+
const InsertResourceLinkRecord = async (client22, resourceLinkIndexRecord) => {
|
|
18309
|
+
await this.#dbSTSResourceLink.InsertResourceLink(client22, resourceLinkIndexRecord);
|
|
18310
18310
|
};
|
|
18311
|
-
const InsertResourceStringRecord = (client22, stringRecord) => {
|
|
18312
|
-
this.#dbSTSString.InsertRecord(client22, stringRecord);
|
|
18311
|
+
const InsertResourceStringRecord = async (client22, stringRecord) => {
|
|
18312
|
+
await this.#dbSTSString.InsertRecord(client22, stringRecord);
|
|
18313
18313
|
};
|
|
18314
|
-
const InsertResourceTokenRecord = (client22, tokenRecord) => {
|
|
18315
|
-
this.#dbSTSToken.InsertRecord(client22, tokenRecord);
|
|
18314
|
+
const InsertResourceTokenRecord = async (client22, tokenRecord) => {
|
|
18315
|
+
await this.#dbSTSToken.InsertRecord(client22, tokenRecord);
|
|
18316
18316
|
};
|
|
18317
|
-
const InsertResourceQuantityRecord = (client22, quantityRecord) => {
|
|
18318
|
-
this.#dbSTSQuantity.InsertRecord(client22, quantityRecord);
|
|
18317
|
+
const InsertResourceQuantityRecord = async (client22, quantityRecord) => {
|
|
18318
|
+
await this.#dbSTSQuantity.InsertRecord(client22, quantityRecord);
|
|
18319
18319
|
};
|
|
18320
|
-
const InsertResourceNumberRecord = (client22, numberRecord) => {
|
|
18321
|
-
this.#dbSTSNumber.InsertRecord(client22, numberRecord);
|
|
18320
|
+
const InsertResourceNumberRecord = async (client22, numberRecord) => {
|
|
18321
|
+
await this.#dbSTSNumber.InsertRecord(client22, numberRecord);
|
|
18322
18322
|
};
|
|
18323
|
-
const InsertResourceDateRecord = (client22, dateRecord) => {
|
|
18324
|
-
this.#dbSTSDate.InsertRecord(client22, dateRecord);
|
|
18323
|
+
const InsertResourceDateRecord = async (client22, dateRecord) => {
|
|
18324
|
+
await this.#dbSTSDate.InsertRecord(client22, dateRecord);
|
|
18325
18325
|
};
|
|
18326
|
-
const InsertResourceUriRecord = (client22, uriRecord) => {
|
|
18327
|
-
this.#dbSTSUri.InsertRecord(client22, uriRecord);
|
|
18326
|
+
const InsertResourceUriRecord = async (client22, uriRecord) => {
|
|
18327
|
+
await this.#dbSTSUri.InsertRecord(client22, uriRecord);
|
|
18328
18328
|
};
|
|
18329
|
-
const InsertResourceComboRecord = (client22, comboRecord) => {
|
|
18330
|
-
this.#dbSTSCombo.InsertRecord(client22, comboRecord);
|
|
18329
|
+
const InsertResourceComboRecord = async (client22, comboRecord) => {
|
|
18330
|
+
await this.#dbSTSCombo.InsertRecord(client22, comboRecord);
|
|
18331
18331
|
};
|
|
18332
18332
|
performance.now();
|
|
18333
|
-
this.#dbSTSResourceLink.DeleteResourceLinkRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18334
|
-
this.#dbSTSString.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18335
|
-
this.#dbSTSToken.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18336
|
-
this.#dbSTSQuantity.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18337
|
-
this.#dbSTSNumber.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18338
|
-
this.#dbSTSDate.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18339
|
-
this.#dbSTSUri.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18340
|
-
this.#dbSTSCombo.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18333
|
+
await this.#dbSTSResourceLink.DeleteResourceLinkRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18334
|
+
await this.#dbSTSString.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18335
|
+
await this.#dbSTSToken.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18336
|
+
await this.#dbSTSQuantity.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18337
|
+
await this.#dbSTSNumber.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18338
|
+
await this.#dbSTSDate.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18339
|
+
await this.#dbSTSUri.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18340
|
+
await this.#dbSTSCombo.DeleteRecord(client2, { RES_ID: resource.id, RES_TYPE: resource.resourceType });
|
|
18341
18341
|
performance.now();
|
|
18342
18342
|
try {
|
|
18343
|
-
searchIndexData.
|
|
18343
|
+
for (let i = 0; i < searchIndexData.length; i++) {
|
|
18344
|
+
const si = searchIndexData[i];
|
|
18344
18345
|
const st2 = performance.now();
|
|
18345
18346
|
if (si && si.SP_MISSING) {
|
|
18346
18347
|
console.log(chalk.magenta.italic(`-->> MISSING ${si.SP_NAME} ${si.SP_PARAM_TYPE} ${si.PID} ${si.SP_STR}`));
|
|
@@ -18350,33 +18351,34 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18350
18351
|
}
|
|
18351
18352
|
switch (si.SP_PARAM_TYPE) {
|
|
18352
18353
|
case "reference":
|
|
18353
|
-
InsertResourceLinkRecord(client2, si);
|
|
18354
|
+
await InsertResourceLinkRecord(client2, si);
|
|
18354
18355
|
break;
|
|
18355
18356
|
case "string":
|
|
18356
|
-
InsertResourceStringRecord(client2, si);
|
|
18357
|
+
await InsertResourceStringRecord(client2, si);
|
|
18357
18358
|
break;
|
|
18358
18359
|
case "token":
|
|
18359
|
-
InsertResourceTokenRecord(client2, si);
|
|
18360
|
+
await InsertResourceTokenRecord(client2, si);
|
|
18360
18361
|
break;
|
|
18361
18362
|
case "quantity":
|
|
18362
|
-
InsertResourceQuantityRecord(client2, si);
|
|
18363
|
+
await InsertResourceQuantityRecord(client2, si);
|
|
18363
18364
|
break;
|
|
18364
18365
|
case "number":
|
|
18365
|
-
InsertResourceNumberRecord(client2, si);
|
|
18366
|
+
await InsertResourceNumberRecord(client2, si);
|
|
18366
18367
|
break;
|
|
18367
18368
|
case "date":
|
|
18368
|
-
InsertResourceDateRecord(client2, si);
|
|
18369
|
+
await InsertResourceDateRecord(client2, si);
|
|
18369
18370
|
break;
|
|
18370
18371
|
case "uri":
|
|
18371
|
-
InsertResourceUriRecord(client2, si);
|
|
18372
|
+
await InsertResourceUriRecord(client2, si);
|
|
18372
18373
|
break;
|
|
18373
18374
|
case "composite":
|
|
18374
|
-
InsertResourceComboRecord(client2, si);
|
|
18375
|
+
await InsertResourceComboRecord(client2, si);
|
|
18375
18376
|
break;
|
|
18376
18377
|
default:
|
|
18377
18378
|
console.log(`-->> ${si.SP_PARAM_TYPE} *** UNKNOWN ***`);
|
|
18378
18379
|
}
|
|
18379
|
-
}
|
|
18380
|
+
}
|
|
18381
|
+
;
|
|
18380
18382
|
} catch (error) {
|
|
18381
18383
|
console.error(error);
|
|
18382
18384
|
}
|
|
@@ -18470,7 +18472,7 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18470
18472
|
if (useTransaction) {
|
|
18471
18473
|
await client2.query("BEGIN");
|
|
18472
18474
|
}
|
|
18473
|
-
const resourceRunResult = this.#dbSTSResource.InsertResourceEx(client2, {
|
|
18475
|
+
const resourceRunResult = await this.#dbSTSResource.InsertResourceEx(client2, {
|
|
18474
18476
|
PID: PK,
|
|
18475
18477
|
PARTITION_ID: 0,
|
|
18476
18478
|
PARTITION_DATE: 0,
|
|
@@ -18482,7 +18484,7 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18482
18484
|
RES_PUBLISHED: now2,
|
|
18483
18485
|
RES_UPDATED: now2
|
|
18484
18486
|
});
|
|
18485
|
-
const resourceVersionRunResult = this.#dbSTSResourceVersion.InsertResourceVersionEx(client2, {
|
|
18487
|
+
const resourceVersionRunResult = await this.#dbSTSResourceVersion.InsertResourceVersionEx(client2, {
|
|
18486
18488
|
PID: v4(),
|
|
18487
18489
|
PARTITION_ID: 0,
|
|
18488
18490
|
PARTITION_DATE: 0,
|
|
@@ -18493,7 +18495,6 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18493
18495
|
RES
|
|
18494
18496
|
});
|
|
18495
18497
|
const st = performance.now();
|
|
18496
|
-
await this.UpdateIndexes(client2, resource);
|
|
18497
18498
|
if (useTransaction) {
|
|
18498
18499
|
await client2.query("COMMIT");
|
|
18499
18500
|
}
|
|
@@ -18532,13 +18533,13 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18532
18533
|
if (useTransaction) {
|
|
18533
18534
|
await client2.query("BEGIN");
|
|
18534
18535
|
}
|
|
18535
|
-
const resourceRunResult = this.#dbSTSResource.UpdateResourceRecordEx(client2, {
|
|
18536
|
+
const resourceRunResult = await this.#dbSTSResource.UpdateResourceRecordEx(client2, {
|
|
18536
18537
|
RES_TYPE,
|
|
18537
18538
|
RES_ID,
|
|
18538
18539
|
RES_VER,
|
|
18539
18540
|
RES_UPDATED: now2
|
|
18540
18541
|
});
|
|
18541
|
-
const resourceVersionRunResult = this.#dbSTSResourceVersion.InsertResourceVersionEx(client2, {
|
|
18542
|
+
const resourceVersionRunResult = await this.#dbSTSResourceVersion.InsertResourceVersionEx(client2, {
|
|
18542
18543
|
PID: v4(),
|
|
18543
18544
|
PARTITION_ID: 0,
|
|
18544
18545
|
PARTITION_DATE: 0,
|
|
@@ -18548,7 +18549,6 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18548
18549
|
OPERATION: operation,
|
|
18549
18550
|
RES
|
|
18550
18551
|
});
|
|
18551
|
-
await this.UpdateIndexes(client2, resource);
|
|
18552
18552
|
if (useTransaction) {
|
|
18553
18553
|
await client2.query("COMMIT");
|
|
18554
18554
|
}
|
|
@@ -18586,14 +18586,14 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18586
18586
|
if (useTransaction) {
|
|
18587
18587
|
await client2.query("BEGIN");
|
|
18588
18588
|
}
|
|
18589
|
-
const resourceRunResult = this.#dbSTSResource.DeleteResourceRecordEx(client2, {
|
|
18589
|
+
const resourceRunResult = await this.#dbSTSResource.DeleteResourceRecordEx(client2, {
|
|
18590
18590
|
RES_ID,
|
|
18591
18591
|
RES_TYPE,
|
|
18592
18592
|
RES_VER,
|
|
18593
18593
|
RES_DELETED_AT: now2,
|
|
18594
18594
|
RES_UPDATED: now2
|
|
18595
18595
|
});
|
|
18596
|
-
const resourceVersionRunResult = this.#dbSTSResourceVersion.InsertResourceVersionEx(client2, {
|
|
18596
|
+
const resourceVersionRunResult = await this.#dbSTSResourceVersion.InsertResourceVersionEx(client2, {
|
|
18597
18597
|
PID: v4(),
|
|
18598
18598
|
PARTITION_ID: 0,
|
|
18599
18599
|
PARTITION_DATE: 0,
|
|
@@ -18603,7 +18603,6 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18603
18603
|
OPERATION: "DELETE",
|
|
18604
18604
|
RES: ""
|
|
18605
18605
|
});
|
|
18606
|
-
await this.UpdateIndexes(client2, resource);
|
|
18607
18606
|
if (useTransaction) {
|
|
18608
18607
|
await client2.query("COMMIT");
|
|
18609
18608
|
}
|