@nsshunt/stsfhirpg 1.2.5 → 1.2.6
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 +23 -23
- package/dist/stsfhirpg.cjs.map +1 -1
- package/dist/stsfhirpg.mjs +23 -23
- package/dist/stsfhirpg.mjs.map +1 -1
- package/package.json +1 -1
- package/types/fhir-database/dbsearchindex.d.ts +4 -4
- package/types/fhir-database/dbsearchindex.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexbase.d.ts +1 -1
- package/types/fhir-database/dbsearchindexbase.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexcomposite.d.ts +1 -1
- package/types/fhir-database/dbsearchindexcomposite.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexdates.d.ts +1 -1
- package/types/fhir-database/dbsearchindexdates.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexnumber.d.ts +1 -1
- package/types/fhir-database/dbsearchindexnumber.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexquantity.d.ts +1 -1
- package/types/fhir-database/dbsearchindexquantity.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexreference.d.ts +1 -1
- package/types/fhir-database/dbsearchindexreference.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexstring.d.ts +1 -1
- package/types/fhir-database/dbsearchindexstring.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindextesthelpers.d.ts +1 -1
- package/types/fhir-database/dbsearchindextesthelpers.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindextoken.d.ts +1 -1
- package/types/fhir-database/dbsearchindextoken.d.ts.map +1 -1
- package/types/fhir-database/dbsearchindexuri.d.ts +1 -1
- package/types/fhir-database/dbsearchindexuri.d.ts.map +1 -1
- package/types/fhir-utils/resourceHelper.d.ts +3 -3
- package/types/fhir-utils/resourceHelper.d.ts.map +1 -1
package/dist/stsfhirpg.cjs
CHANGED
|
@@ -7256,19 +7256,19 @@ class ResourceHelper {
|
|
|
7256
7256
|
}
|
|
7257
7257
|
}
|
|
7258
7258
|
};
|
|
7259
|
-
GetSearchParamFromResourceTypeUrl = (resourceType, url) => {
|
|
7259
|
+
GetSearchParamFromResourceTypeUrl = async (resourceType, url) => {
|
|
7260
7260
|
const filterByNameAndUrl = this.definitions.searchParametersByResourceType[resourceType].params.filter((rt) => rt.SP_URL.localeCompare(url) === 0);
|
|
7261
7261
|
if (filterByNameAndUrl.length > 0) {
|
|
7262
7262
|
return filterByNameAndUrl[0];
|
|
7263
7263
|
}
|
|
7264
7264
|
};
|
|
7265
|
-
GetSearchParamFromResourceType = (resourceType, name) => {
|
|
7265
|
+
GetSearchParamFromResourceType = async (resourceType, name) => {
|
|
7266
7266
|
const filterByName = this.definitions.searchParametersByResourceType[resourceType].params.filter((rt) => rt.SP_NAME.localeCompare(name) === 0);
|
|
7267
7267
|
if (filterByName.length > 0) {
|
|
7268
7268
|
return filterByName[0];
|
|
7269
7269
|
}
|
|
7270
7270
|
};
|
|
7271
|
-
GetSearchParamsFromResourceType = (resourceType) => {
|
|
7271
|
+
GetSearchParamsFromResourceType = async (resourceType) => {
|
|
7272
7272
|
return this.definitions.searchParametersByResourceType[resourceType].params;
|
|
7273
7273
|
};
|
|
7274
7274
|
}
|
|
@@ -10703,7 +10703,7 @@ class DBSearchIndexToken extends DBSearchIndexBase {
|
|
|
10703
10703
|
}
|
|
10704
10704
|
return retVal;
|
|
10705
10705
|
};
|
|
10706
|
-
OutputIndexRecord = (resource, tir, searchFieldRecord) => {
|
|
10706
|
+
OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
|
|
10707
10707
|
let retVal = [];
|
|
10708
10708
|
searchFieldRecord.expressions.forEach((expression) => {
|
|
10709
10709
|
let tokens = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
|
|
@@ -10739,15 +10739,15 @@ class DBSearchIndexComposite extends DBSearchIndexBase {
|
|
|
10739
10739
|
// / root level code and quantity, i.e. Observation.code + Observation.value[x]Quantity
|
|
10740
10740
|
// /component_0 component level at index 0 Observation.component[0].code + Observation.component[0].value[x]Quantity
|
|
10741
10741
|
// /component_1 component level at index 1 Observation.component[1].code + Observation.component[1].value[x]Quantity
|
|
10742
|
-
OutputIndexRecord = (resource, tir, searchFieldRecord) => {
|
|
10742
|
+
OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
|
|
10743
10743
|
let comboNonUniqueRecords = [];
|
|
10744
10744
|
const searchIndex = DBSearchIndex.getInstance();
|
|
10745
10745
|
let index = 0;
|
|
10746
10746
|
let components = [];
|
|
10747
|
-
searchFieldRecord.component
|
|
10747
|
+
for (const searchParamComponentRecord of searchFieldRecord.component) {
|
|
10748
10748
|
components.push([]);
|
|
10749
10749
|
const url = searchParamComponentRecord.definition;
|
|
10750
|
-
const sp = searchIndex.resourceHelper.GetSearchParamFromResourceTypeUrl(resource.resourceType, url);
|
|
10750
|
+
const sp = await searchIndex.resourceHelper.GetSearchParamFromResourceTypeUrl(resource.resourceType, url);
|
|
10751
10751
|
if (this.IsDefined(sp)) {
|
|
10752
10752
|
const tir2 = {
|
|
10753
10753
|
PID: v4(),
|
|
@@ -10763,7 +10763,7 @@ class DBSearchIndexComposite extends DBSearchIndexBase {
|
|
|
10763
10763
|
COMPOSITE: null,
|
|
10764
10764
|
COMPOSITE_HASH_EXACT: null
|
|
10765
10765
|
};
|
|
10766
|
-
const retVal = SearchRegistry.getInstance().searchIndexBaseRegistry[sp.SP_TYPE].OutputIndexRecord(resource, tir2, sp);
|
|
10766
|
+
const retVal = await SearchRegistry.getInstance().searchIndexBaseRegistry[sp.SP_TYPE].OutputIndexRecord(resource, tir2, sp);
|
|
10767
10767
|
retVal.forEach((rv) => {
|
|
10768
10768
|
if (!(rv.SP_MISSING && rv.SP_MISSING === true)) {
|
|
10769
10769
|
if (rv.SP_STR && rv.SP_STR !== void 0) {
|
|
@@ -10773,7 +10773,7 @@ class DBSearchIndexComposite extends DBSearchIndexBase {
|
|
|
10773
10773
|
});
|
|
10774
10774
|
index++;
|
|
10775
10775
|
}
|
|
10776
|
-
}
|
|
10776
|
+
}
|
|
10777
10777
|
for (let i = 0; i < components[0].length; i++) {
|
|
10778
10778
|
for (let j = 0; j < components[1].length; j++) {
|
|
10779
10779
|
const idxString = `${components[0][i].SP_STR}|${components[1][j].SP_STR}`;
|
|
@@ -10886,7 +10886,7 @@ class DBSearchIndexDates extends DBSearchIndexBase {
|
|
|
10886
10886
|
}
|
|
10887
10887
|
return retVal;
|
|
10888
10888
|
};
|
|
10889
|
-
OutputIndexRecord = (resource, tir, searchFieldRecord) => {
|
|
10889
|
+
OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
|
|
10890
10890
|
let retVal = [];
|
|
10891
10891
|
searchFieldRecord.expressions.forEach((expression) => {
|
|
10892
10892
|
let referenceVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
|
|
@@ -10974,7 +10974,7 @@ class DBSearchIndexQuantity extends DBSearchIndexBase {
|
|
|
10974
10974
|
}
|
|
10975
10975
|
return retVal;
|
|
10976
10976
|
};
|
|
10977
|
-
OutputIndexRecord = (resource, tir, searchFieldRecord) => {
|
|
10977
|
+
OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
|
|
10978
10978
|
const retVal = [];
|
|
10979
10979
|
searchFieldRecord.expressions.forEach((expression) => {
|
|
10980
10980
|
let quantityVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
|
|
@@ -11081,7 +11081,7 @@ class DBSearchIndexReference extends DBSearchIndexBase {
|
|
|
11081
11081
|
}
|
|
11082
11082
|
return retVal;
|
|
11083
11083
|
};
|
|
11084
|
-
OutputIndexRecord = (resource, tir, searchFieldRecord) => {
|
|
11084
|
+
OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
|
|
11085
11085
|
let retVal = [];
|
|
11086
11086
|
searchFieldRecord.expressions.forEach((expression) => {
|
|
11087
11087
|
const referenceVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
|
|
@@ -11197,7 +11197,7 @@ class DBSearchIndexString extends DBSearchIndexBase {
|
|
|
11197
11197
|
}
|
|
11198
11198
|
return retVal;
|
|
11199
11199
|
};
|
|
11200
|
-
OutputIndexRecord = (resource, tir, searchParamRecord) => {
|
|
11200
|
+
OutputIndexRecord = async (resource, tir, searchParamRecord) => {
|
|
11201
11201
|
const retVal = [];
|
|
11202
11202
|
searchParamRecord.expressions.forEach((expression) => {
|
|
11203
11203
|
let stringVal = this.GetValueFromPath(resource, expression.path, searchParamRecord, expression);
|
|
@@ -11251,7 +11251,7 @@ class DBSearchIndexNumber extends DBSearchIndexBase {
|
|
|
11251
11251
|
}
|
|
11252
11252
|
return retVal;
|
|
11253
11253
|
};
|
|
11254
|
-
OutputIndexRecord = (resource, tir, searchFieldRecord) => {
|
|
11254
|
+
OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
|
|
11255
11255
|
const retVal = [];
|
|
11256
11256
|
searchFieldRecord.expressions.forEach((expression) => {
|
|
11257
11257
|
let numberVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
|
|
@@ -11311,7 +11311,7 @@ class DBSearchIndexURI extends DBSearchIndexBase {
|
|
|
11311
11311
|
}
|
|
11312
11312
|
return retVal;
|
|
11313
11313
|
};
|
|
11314
|
-
OutputIndexRecord = (resource, tir, searchFieldRecord) => {
|
|
11314
|
+
OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
|
|
11315
11315
|
const retVal = [];
|
|
11316
11316
|
searchFieldRecord.expressions.forEach((expression) => {
|
|
11317
11317
|
let uriVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
|
|
@@ -11370,7 +11370,7 @@ class DBSearchIndex {
|
|
|
11370
11370
|
this.#debug("------------------");
|
|
11371
11371
|
this.#debug(`resource: [${hl(resourceName)}] resourceId: [${hl(resourceId)}] SP_NAME: [${hl(searchFieldRecord.SP_NAME)}] SP_TYPE: [${hl(searchFieldRecord.SP_TYPE)}] SP_BASE: [${hl(searchFieldRecord.SP_BASE)}] path: [${hl(searchFieldRecord.path)}] RESOURCE_DATATYPE: [${hl(searchFieldRecord.RESOURCE_DATATYPE)}] subFieldDataType: [${hl(searchFieldRecord.subFieldDataType)}] stringIndexFields: [${hl(searchFieldRecord.stringIndexFields)}]`);
|
|
11372
11372
|
};
|
|
11373
|
-
UpdateIndex = (resource, searchFieldRecord) => {
|
|
11373
|
+
UpdateIndex = async (resource, searchFieldRecord) => {
|
|
11374
11374
|
try {
|
|
11375
11375
|
const tir = {
|
|
11376
11376
|
PID: v4(),
|
|
@@ -11389,7 +11389,7 @@ class DBSearchIndex {
|
|
|
11389
11389
|
let saveRecord;
|
|
11390
11390
|
const searchIndexBaseProcessor = this.searchRegistry.searchIndexBaseRegistry[searchFieldRecord.SP_TYPE];
|
|
11391
11391
|
if (searchIndexBaseProcessor) {
|
|
11392
|
-
saveRecord = searchIndexBaseProcessor.OutputIndexRecord(resource, tir, searchFieldRecord);
|
|
11392
|
+
saveRecord = await searchIndexBaseProcessor.OutputIndexRecord(resource, tir, searchFieldRecord);
|
|
11393
11393
|
} else if (searchFieldRecord.SP_TYPE.localeCompare("special") === 0) {
|
|
11394
11394
|
} else {
|
|
11395
11395
|
const message = `DBSearchIndex:UpdateIndex(): Error: Search field paramater type: [${searchFieldRecord.SP_TYPE}] unknown.`;
|
|
@@ -11402,14 +11402,14 @@ class DBSearchIndex {
|
|
|
11402
11402
|
return [];
|
|
11403
11403
|
}
|
|
11404
11404
|
};
|
|
11405
|
-
GetSearchIndexData = (resource) => {
|
|
11405
|
+
GetSearchIndexData = async (resource) => {
|
|
11406
11406
|
try {
|
|
11407
|
-
const searchParamRecords = this.resourceHelper.GetSearchParamsFromResourceType(resource.resourceType);
|
|
11407
|
+
const searchParamRecords = await this.resourceHelper.GetSearchParamsFromResourceType(resource.resourceType);
|
|
11408
11408
|
const searchIndexData = [];
|
|
11409
11409
|
for (let i = 0; i < searchParamRecords.length; i++) {
|
|
11410
11410
|
const searchRecord = searchParamRecords[i];
|
|
11411
11411
|
try {
|
|
11412
|
-
const retVal = this.UpdateIndex(resource, searchRecord);
|
|
11412
|
+
const retVal = await this.UpdateIndex(resource, searchRecord);
|
|
11413
11413
|
if (retVal && retVal.length > 0) {
|
|
11414
11414
|
searchIndexData.push(...retVal);
|
|
11415
11415
|
}
|
|
@@ -11423,10 +11423,10 @@ class DBSearchIndex {
|
|
|
11423
11423
|
return [];
|
|
11424
11424
|
}
|
|
11425
11425
|
};
|
|
11426
|
-
GetSearchParamFromResourceType = (resourceType, name) => {
|
|
11426
|
+
GetSearchParamFromResourceType = async (resourceType, name) => {
|
|
11427
11427
|
return this.resourceHelper.GetSearchParamFromResourceType(resourceType, name);
|
|
11428
11428
|
};
|
|
11429
|
-
GetSearchParamFromResourceTypeUrl = (resourceType, url) => {
|
|
11429
|
+
GetSearchParamFromResourceTypeUrl = async (resourceType, url) => {
|
|
11430
11430
|
return this.resourceHelper.GetSearchParamFromResourceTypeUrl(resourceType, url);
|
|
11431
11431
|
};
|
|
11432
11432
|
}
|
|
@@ -18204,7 +18204,7 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
|
|
|
18204
18204
|
UpdateIndexes = async (client2, resource) => {
|
|
18205
18205
|
let start = performance.now();
|
|
18206
18206
|
const oa = start;
|
|
18207
|
-
const searchIndexData = this.#dbSearchIndex.GetSearchIndexData(resource);
|
|
18207
|
+
const searchIndexData = await this.#dbSearchIndex.GetSearchIndexData(resource);
|
|
18208
18208
|
const lap1 = performance.now() - start;
|
|
18209
18209
|
start = performance.now();
|
|
18210
18210
|
const InsertResourceLinkRecord = async (client22, resourceLinkIndexRecord) => {
|