@nsshunt/ststestrunner 1.0.13 → 1.0.14
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
CHANGED
|
@@ -13007,41 +13007,40 @@ class StartUpDelFhirResources extends TestCaseFhirBase {
|
|
|
13007
13007
|
let totalRecordsDelete = 0;
|
|
13008
13008
|
while (!complete) {
|
|
13009
13009
|
console.log(chalk$1.magenta(`ExecuteRunner() - pre GetResources()`));
|
|
13010
|
-
const
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13010
|
+
const promGet = () => {
|
|
13011
|
+
const request = {
|
|
13012
|
+
headers: {
|
|
13013
|
+
"x-sts_user_id": "someuser"
|
|
13014
|
+
},
|
|
13015
|
+
params: {},
|
|
13016
|
+
query: {
|
|
13017
|
+
limit: options.batchDeleteSize,
|
|
13018
|
+
prefix: options.personPrefix
|
|
13019
|
+
},
|
|
13020
|
+
body: {}
|
|
13021
|
+
};
|
|
13022
|
+
return new Promise((resolve, reject) => {
|
|
13023
|
+
this.socket.emit("getFhirResources", "Person", request, (res) => {
|
|
13024
|
+
console.log(res);
|
|
13025
|
+
resolve(res);
|
|
13026
|
+
});
|
|
13027
|
+
});
|
|
13020
13028
|
};
|
|
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
|
-
});
|
|
13029
|
+
const retVal = (await promGet()).value;
|
|
13030
13030
|
console.log(chalk$1.magenta(`ExecuteRunner() - post GetResources()`));
|
|
13031
13031
|
console.log(retVal);
|
|
13032
13032
|
if (retVal) {
|
|
13033
13033
|
console.log(`Records already exist - going to delete ...`);
|
|
13034
13034
|
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
13035
|
const prom = () => {
|
|
13036
|
+
const delRequest = {
|
|
13037
|
+
headers: {
|
|
13038
|
+
"x-sts_user_id": "someuser"
|
|
13039
|
+
},
|
|
13040
|
+
params: {},
|
|
13041
|
+
query: {},
|
|
13042
|
+
body: retVal
|
|
13043
|
+
};
|
|
13045
13044
|
return new Promise((resolve, reject) => {
|
|
13046
13045
|
this.socket.emit("deleteFhirResources", "Person", delRequest, (res2) => {
|
|
13047
13046
|
console.log(`socket.emit deleteFhirResources()`);
|
|
@@ -15093,9 +15092,23 @@ class SetupFhirTestResources extends TestCaseFhirBase {
|
|
|
15093
15092
|
const personRecord = __privateGet(this, _GetPersonRecord).call(this, options.testBlocksPrefix, options.personPrefix, this.runner.iteration, options.blockSize);
|
|
15094
15093
|
console.log(chalk$1.yellow(JSON.stringify(personRecord).length));
|
|
15095
15094
|
try {
|
|
15096
|
-
const
|
|
15097
|
-
|
|
15098
|
-
|
|
15095
|
+
const promCreate = () => {
|
|
15096
|
+
const request = {
|
|
15097
|
+
headers: {
|
|
15098
|
+
"x-sts_user_id": "someuser"
|
|
15099
|
+
},
|
|
15100
|
+
params: {},
|
|
15101
|
+
query: {},
|
|
15102
|
+
body: personRecord
|
|
15103
|
+
};
|
|
15104
|
+
return new Promise((resolve, reject) => {
|
|
15105
|
+
this.socket.emit("createFhirResource", "Person", request, (res) => {
|
|
15106
|
+
console.log(res);
|
|
15107
|
+
resolve(res);
|
|
15108
|
+
});
|
|
15109
|
+
});
|
|
15110
|
+
};
|
|
15111
|
+
const retVal = (await promCreate()).value;
|
|
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));
|