@nsshunt/ststestrunner 1.0.13 → 1.0.15
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.mjs +48 -35
- package/dist/ststestrunner.mjs.map +1 -1
- package/dist/ststestrunner.umd.js +48 -35
- package/dist/ststestrunner.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/setupFhirTestResources.d.ts.map +1 -1
- package/types/startUpDelFhirResources.d.ts.map +1 -1
- package/types/testCaseFhir02.d.ts.map +1 -1
- package/types/testCaseFhirBase.d.ts +2 -1
- package/types/testCaseFhirBase.d.ts.map +1 -1
- package/types/wsFhirEvents.d.ts +3 -35
- package/types/wsFhirEvents.d.ts.map +1 -1
package/dist/ststestrunner.mjs
CHANGED
|
@@ -12569,6 +12569,25 @@ class TestCaseFhirBase {
|
|
|
12569
12569
|
await __privateGet(this, _ForcePublishTelemetryData2).call(this);
|
|
12570
12570
|
return true;
|
|
12571
12571
|
});
|
|
12572
|
+
__publicField(this, "CreateResource", async (personRecord) => {
|
|
12573
|
+
const promCreate = () => {
|
|
12574
|
+
const request = {
|
|
12575
|
+
headers: {
|
|
12576
|
+
"x-sts_user_id": "someuser"
|
|
12577
|
+
},
|
|
12578
|
+
params: {},
|
|
12579
|
+
query: {},
|
|
12580
|
+
body: personRecord
|
|
12581
|
+
};
|
|
12582
|
+
return new Promise((resolve, reject) => {
|
|
12583
|
+
this.socket.emit("createFhirResource", "Person", request, (res) => {
|
|
12584
|
+
console.log(res);
|
|
12585
|
+
resolve(res);
|
|
12586
|
+
});
|
|
12587
|
+
});
|
|
12588
|
+
};
|
|
12589
|
+
return (await promCreate()).value;
|
|
12590
|
+
});
|
|
12572
12591
|
__privateSet(this, _options2, runner.options);
|
|
12573
12592
|
__privateSet(this, _workerInstance2, workerInstance);
|
|
12574
12593
|
__privateSet(this, _runner2, runner);
|
|
@@ -12714,10 +12733,7 @@ class TestCaseFhir02 extends TestCaseFhirBase {
|
|
|
12714
12733
|
const personRecord = this.GetPersonRecord(`${options.personPrefix}`, iteration);
|
|
12715
12734
|
console.log(chalk$1.yellow(JSON.stringify(personRecord, null, 2)));
|
|
12716
12735
|
try {
|
|
12717
|
-
const retVal = await this.
|
|
12718
|
-
this.LogErrorMessage(`test(POST /stsresource and query using filter): ${error}`);
|
|
12719
|
-
this.runner.instrumentData.errorCount++;
|
|
12720
|
-
});
|
|
12736
|
+
const retVal = await this.CreateResource(personRecord);
|
|
12721
12737
|
console.log(chalk$1.rgb(200, 100, 50)(JSON.stringify(retVal, null, 2)));
|
|
12722
12738
|
} catch (error) {
|
|
12723
12739
|
console.log(chalk$1.rgb(200, 100, 50)(error));
|
|
@@ -13007,41 +13023,40 @@ class StartUpDelFhirResources extends TestCaseFhirBase {
|
|
|
13007
13023
|
let totalRecordsDelete = 0;
|
|
13008
13024
|
while (!complete) {
|
|
13009
13025
|
console.log(chalk$1.magenta(`ExecuteRunner() - pre GetResources()`));
|
|
13010
|
-
const
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13026
|
+
const promGet = () => {
|
|
13027
|
+
const request = {
|
|
13028
|
+
headers: {
|
|
13029
|
+
"x-sts_user_id": "someuser"
|
|
13030
|
+
},
|
|
13031
|
+
params: {},
|
|
13032
|
+
query: {
|
|
13033
|
+
limit: options.batchDeleteSize,
|
|
13034
|
+
prefix: options.personPrefix
|
|
13035
|
+
},
|
|
13036
|
+
body: {}
|
|
13037
|
+
};
|
|
13038
|
+
return new Promise((resolve, reject) => {
|
|
13039
|
+
this.socket.emit("getFhirResources", "Person", request, (res) => {
|
|
13040
|
+
console.log(res);
|
|
13041
|
+
resolve(res);
|
|
13042
|
+
});
|
|
13043
|
+
});
|
|
13020
13044
|
};
|
|
13021
|
-
|
|
13022
|
-
console.log(res);
|
|
13023
|
-
});
|
|
13024
|
-
const retVal = await this.fhirClient.GetResources("Person", null, {
|
|
13025
|
-
limit: options.batchDeleteSize,
|
|
13026
|
-
prefix: options.personPrefix
|
|
13027
|
-
}, (error) => {
|
|
13028
|
-
this.LogErrorMessage(chalk$1.red(`test(POST /stsresource and query using filter): ${error}`));
|
|
13029
|
-
});
|
|
13045
|
+
const retVal = (await promGet()).value;
|
|
13030
13046
|
console.log(chalk$1.magenta(`ExecuteRunner() - post GetResources()`));
|
|
13031
13047
|
console.log(retVal);
|
|
13032
13048
|
if (retVal) {
|
|
13033
13049
|
console.log(`Records already exist - going to delete ...`);
|
|
13034
13050
|
console.log(retVal.length);
|
|
13035
|
-
const delRequest = {
|
|
13036
|
-
headers: {
|
|
13037
|
-
"x-sts_user_id": "someuser"
|
|
13038
|
-
},
|
|
13039
|
-
params: {},
|
|
13040
|
-
query: {},
|
|
13041
|
-
body: retVal
|
|
13042
|
-
};
|
|
13043
|
-
console.log(delRequest);
|
|
13044
13051
|
const prom = () => {
|
|
13052
|
+
const delRequest = {
|
|
13053
|
+
headers: {
|
|
13054
|
+
"x-sts_user_id": "someuser"
|
|
13055
|
+
},
|
|
13056
|
+
params: {},
|
|
13057
|
+
query: {},
|
|
13058
|
+
body: retVal
|
|
13059
|
+
};
|
|
13045
13060
|
return new Promise((resolve, reject) => {
|
|
13046
13061
|
this.socket.emit("deleteFhirResources", "Person", delRequest, (res2) => {
|
|
13047
13062
|
console.log(`socket.emit deleteFhirResources()`);
|
|
@@ -15093,9 +15108,7 @@ class SetupFhirTestResources extends TestCaseFhirBase {
|
|
|
15093
15108
|
const personRecord = __privateGet(this, _GetPersonRecord).call(this, options.testBlocksPrefix, options.personPrefix, this.runner.iteration, options.blockSize);
|
|
15094
15109
|
console.log(chalk$1.yellow(JSON.stringify(personRecord).length));
|
|
15095
15110
|
try {
|
|
15096
|
-
const retVal = await this.
|
|
15097
|
-
this.LogErrorMessage(`test(POST /stsresource and query using filter): ${error}`);
|
|
15098
|
-
});
|
|
15111
|
+
const retVal = await this.CreateResource(personRecord);
|
|
15099
15112
|
console.log(chalk$1.yellow(retVal == null ? void 0 : retVal.id));
|
|
15100
15113
|
} catch (error) {
|
|
15101
15114
|
console.log(chalk$1.red(error));
|