@nsshunt/ststestrunner 1.1.143 → 1.1.145
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/ststestrunner.cjs +28 -11
- package/dist/ststestrunner.cjs.map +1 -1
- package/dist/ststestrunner.mjs +28 -11
- package/dist/ststestrunner.mjs.map +1 -1
- package/package.json +1 -1
- package/types/libmodule/testCaseFhir02.d.ts +3 -0
- package/types/libmodule/testCaseFhir02.d.ts.map +1 -1
- package/types/libmodule/testCaseFhir02bundle.d.ts +7 -0
- package/types/libmodule/testCaseFhir02bundle.d.ts.map +1 -0
- package/types/libmodule/testCaseFhir02single.d.ts +7 -0
- package/types/libmodule/testCaseFhir02single.d.ts.map +1 -0
package/dist/ststestrunner.mjs
CHANGED
|
@@ -1444,18 +1444,23 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
|
|
|
1444
1444
|
//#endregion
|
|
1445
1445
|
//#region src/libmodule/testCaseFhir02.ts
|
|
1446
1446
|
var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
|
|
1447
|
+
blockSize = 2;
|
|
1448
|
+
bundleBatch;
|
|
1449
|
+
personRecords = [];
|
|
1447
1450
|
PerformExecuteQuery = async () => {
|
|
1448
1451
|
const __snapshot1 = performance.now();
|
|
1449
1452
|
const client = await this.GetClient();
|
|
1450
1453
|
const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
|
|
1451
1454
|
const prefix = this.runner.options.personPrefix;
|
|
1452
|
-
|
|
1453
|
-
const bundleBatch = {
|
|
1455
|
+
if (this.runner.iteration === 0) this.bundleBatch = {
|
|
1454
1456
|
"resourceType": "Bundle",
|
|
1455
1457
|
"type": "transaction",
|
|
1456
1458
|
"entry": []
|
|
1457
1459
|
};
|
|
1458
|
-
|
|
1460
|
+
const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
|
|
1461
|
+
const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
|
|
1462
|
+
this.personRecords.push(personRecord);
|
|
1463
|
+
this.bundleBatch.entry.push({
|
|
1459
1464
|
fullUrl: personRecord.id,
|
|
1460
1465
|
resource: personRecord,
|
|
1461
1466
|
request: {
|
|
@@ -1463,16 +1468,28 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
|
|
|
1463
1468
|
url: "Person"
|
|
1464
1469
|
}
|
|
1465
1470
|
});
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1471
|
+
let retVal = void 0;
|
|
1472
|
+
if (this.runner.iteration % this.blockSize === this.blockSize - 1) {
|
|
1473
|
+
retVal = await client.ProcessBatchOrTransactionResources(this.bundleBatch);
|
|
1469
1474
|
this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1475
|
+
this.bundleBatch.entry = [];
|
|
1476
|
+
} else if (this.runner.iteration === this.runner.options.executionProfile.iterations - 1) {
|
|
1477
|
+
retVal = await client.ProcessBatchOrTransactionResources(this.bundleBatch);
|
|
1478
|
+
this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
|
|
1479
|
+
this.bundleBatch.entry = [];
|
|
1480
|
+
}
|
|
1481
|
+
if (retVal && retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
|
|
1482
|
+
if (retVal) {
|
|
1483
|
+
for (let i = 0; i < retVal.body.entry.length - 1; i++) {
|
|
1484
|
+
const personRecord = this.personRecords[i];
|
|
1485
|
+
delete personRecord.meta;
|
|
1486
|
+
const retPersonData = { ...retVal.body.entry[i].resource };
|
|
1487
|
+
delete retPersonData.meta;
|
|
1488
|
+
this.CheckReturnData(personRecord, retPersonData);
|
|
1489
|
+
}
|
|
1490
|
+
this.personRecords = [];
|
|
1474
1491
|
}
|
|
1475
|
-
|
|
1492
|
+
return personRecord;
|
|
1476
1493
|
};
|
|
1477
1494
|
};
|
|
1478
1495
|
//#endregion
|