@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.
Files changed (29) hide show
  1. package/dist/stsfhirpg.cjs +23 -23
  2. package/dist/stsfhirpg.cjs.map +1 -1
  3. package/dist/stsfhirpg.mjs +23 -23
  4. package/dist/stsfhirpg.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/types/fhir-database/dbsearchindex.d.ts +4 -4
  7. package/types/fhir-database/dbsearchindex.d.ts.map +1 -1
  8. package/types/fhir-database/dbsearchindexbase.d.ts +1 -1
  9. package/types/fhir-database/dbsearchindexbase.d.ts.map +1 -1
  10. package/types/fhir-database/dbsearchindexcomposite.d.ts +1 -1
  11. package/types/fhir-database/dbsearchindexcomposite.d.ts.map +1 -1
  12. package/types/fhir-database/dbsearchindexdates.d.ts +1 -1
  13. package/types/fhir-database/dbsearchindexdates.d.ts.map +1 -1
  14. package/types/fhir-database/dbsearchindexnumber.d.ts +1 -1
  15. package/types/fhir-database/dbsearchindexnumber.d.ts.map +1 -1
  16. package/types/fhir-database/dbsearchindexquantity.d.ts +1 -1
  17. package/types/fhir-database/dbsearchindexquantity.d.ts.map +1 -1
  18. package/types/fhir-database/dbsearchindexreference.d.ts +1 -1
  19. package/types/fhir-database/dbsearchindexreference.d.ts.map +1 -1
  20. package/types/fhir-database/dbsearchindexstring.d.ts +1 -1
  21. package/types/fhir-database/dbsearchindexstring.d.ts.map +1 -1
  22. package/types/fhir-database/dbsearchindextesthelpers.d.ts +1 -1
  23. package/types/fhir-database/dbsearchindextesthelpers.d.ts.map +1 -1
  24. package/types/fhir-database/dbsearchindextoken.d.ts +1 -1
  25. package/types/fhir-database/dbsearchindextoken.d.ts.map +1 -1
  26. package/types/fhir-database/dbsearchindexuri.d.ts +1 -1
  27. package/types/fhir-database/dbsearchindexuri.d.ts.map +1 -1
  28. package/types/fhir-utils/resourceHelper.d.ts +3 -3
  29. package/types/fhir-utils/resourceHelper.d.ts.map +1 -1
@@ -7254,19 +7254,19 @@ class ResourceHelper {
7254
7254
  }
7255
7255
  }
7256
7256
  };
7257
- GetSearchParamFromResourceTypeUrl = (resourceType, url) => {
7257
+ GetSearchParamFromResourceTypeUrl = async (resourceType, url) => {
7258
7258
  const filterByNameAndUrl = this.definitions.searchParametersByResourceType[resourceType].params.filter((rt) => rt.SP_URL.localeCompare(url) === 0);
7259
7259
  if (filterByNameAndUrl.length > 0) {
7260
7260
  return filterByNameAndUrl[0];
7261
7261
  }
7262
7262
  };
7263
- GetSearchParamFromResourceType = (resourceType, name) => {
7263
+ GetSearchParamFromResourceType = async (resourceType, name) => {
7264
7264
  const filterByName = this.definitions.searchParametersByResourceType[resourceType].params.filter((rt) => rt.SP_NAME.localeCompare(name) === 0);
7265
7265
  if (filterByName.length > 0) {
7266
7266
  return filterByName[0];
7267
7267
  }
7268
7268
  };
7269
- GetSearchParamsFromResourceType = (resourceType) => {
7269
+ GetSearchParamsFromResourceType = async (resourceType) => {
7270
7270
  return this.definitions.searchParametersByResourceType[resourceType].params;
7271
7271
  };
7272
7272
  }
@@ -10701,7 +10701,7 @@ class DBSearchIndexToken extends DBSearchIndexBase {
10701
10701
  }
10702
10702
  return retVal;
10703
10703
  };
10704
- OutputIndexRecord = (resource, tir, searchFieldRecord) => {
10704
+ OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
10705
10705
  let retVal = [];
10706
10706
  searchFieldRecord.expressions.forEach((expression) => {
10707
10707
  let tokens = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
@@ -10737,15 +10737,15 @@ class DBSearchIndexComposite extends DBSearchIndexBase {
10737
10737
  // / root level code and quantity, i.e. Observation.code + Observation.value[x]Quantity
10738
10738
  // /component_0 component level at index 0 Observation.component[0].code + Observation.component[0].value[x]Quantity
10739
10739
  // /component_1 component level at index 1 Observation.component[1].code + Observation.component[1].value[x]Quantity
10740
- OutputIndexRecord = (resource, tir, searchFieldRecord) => {
10740
+ OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
10741
10741
  let comboNonUniqueRecords = [];
10742
10742
  const searchIndex = DBSearchIndex.getInstance();
10743
10743
  let index = 0;
10744
10744
  let components = [];
10745
- searchFieldRecord.component.forEach((searchParamComponentRecord) => {
10745
+ for (const searchParamComponentRecord of searchFieldRecord.component) {
10746
10746
  components.push([]);
10747
10747
  const url = searchParamComponentRecord.definition;
10748
- const sp = searchIndex.resourceHelper.GetSearchParamFromResourceTypeUrl(resource.resourceType, url);
10748
+ const sp = await searchIndex.resourceHelper.GetSearchParamFromResourceTypeUrl(resource.resourceType, url);
10749
10749
  if (this.IsDefined(sp)) {
10750
10750
  const tir2 = {
10751
10751
  PID: v4(),
@@ -10761,7 +10761,7 @@ class DBSearchIndexComposite extends DBSearchIndexBase {
10761
10761
  COMPOSITE: null,
10762
10762
  COMPOSITE_HASH_EXACT: null
10763
10763
  };
10764
- const retVal = SearchRegistry.getInstance().searchIndexBaseRegistry[sp.SP_TYPE].OutputIndexRecord(resource, tir2, sp);
10764
+ const retVal = await SearchRegistry.getInstance().searchIndexBaseRegistry[sp.SP_TYPE].OutputIndexRecord(resource, tir2, sp);
10765
10765
  retVal.forEach((rv) => {
10766
10766
  if (!(rv.SP_MISSING && rv.SP_MISSING === true)) {
10767
10767
  if (rv.SP_STR && rv.SP_STR !== void 0) {
@@ -10771,7 +10771,7 @@ class DBSearchIndexComposite extends DBSearchIndexBase {
10771
10771
  });
10772
10772
  index++;
10773
10773
  }
10774
- });
10774
+ }
10775
10775
  for (let i = 0; i < components[0].length; i++) {
10776
10776
  for (let j = 0; j < components[1].length; j++) {
10777
10777
  const idxString = `${components[0][i].SP_STR}|${components[1][j].SP_STR}`;
@@ -10884,7 +10884,7 @@ class DBSearchIndexDates extends DBSearchIndexBase {
10884
10884
  }
10885
10885
  return retVal;
10886
10886
  };
10887
- OutputIndexRecord = (resource, tir, searchFieldRecord) => {
10887
+ OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
10888
10888
  let retVal = [];
10889
10889
  searchFieldRecord.expressions.forEach((expression) => {
10890
10890
  let referenceVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
@@ -10972,7 +10972,7 @@ class DBSearchIndexQuantity extends DBSearchIndexBase {
10972
10972
  }
10973
10973
  return retVal;
10974
10974
  };
10975
- OutputIndexRecord = (resource, tir, searchFieldRecord) => {
10975
+ OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
10976
10976
  const retVal = [];
10977
10977
  searchFieldRecord.expressions.forEach((expression) => {
10978
10978
  let quantityVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
@@ -11079,7 +11079,7 @@ class DBSearchIndexReference extends DBSearchIndexBase {
11079
11079
  }
11080
11080
  return retVal;
11081
11081
  };
11082
- OutputIndexRecord = (resource, tir, searchFieldRecord) => {
11082
+ OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
11083
11083
  let retVal = [];
11084
11084
  searchFieldRecord.expressions.forEach((expression) => {
11085
11085
  const referenceVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
@@ -11195,7 +11195,7 @@ class DBSearchIndexString extends DBSearchIndexBase {
11195
11195
  }
11196
11196
  return retVal;
11197
11197
  };
11198
- OutputIndexRecord = (resource, tir, searchParamRecord) => {
11198
+ OutputIndexRecord = async (resource, tir, searchParamRecord) => {
11199
11199
  const retVal = [];
11200
11200
  searchParamRecord.expressions.forEach((expression) => {
11201
11201
  let stringVal = this.GetValueFromPath(resource, expression.path, searchParamRecord, expression);
@@ -11249,7 +11249,7 @@ class DBSearchIndexNumber extends DBSearchIndexBase {
11249
11249
  }
11250
11250
  return retVal;
11251
11251
  };
11252
- OutputIndexRecord = (resource, tir, searchFieldRecord) => {
11252
+ OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
11253
11253
  const retVal = [];
11254
11254
  searchFieldRecord.expressions.forEach((expression) => {
11255
11255
  let numberVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
@@ -11309,7 +11309,7 @@ class DBSearchIndexURI extends DBSearchIndexBase {
11309
11309
  }
11310
11310
  return retVal;
11311
11311
  };
11312
- OutputIndexRecord = (resource, tir, searchFieldRecord) => {
11312
+ OutputIndexRecord = async (resource, tir, searchFieldRecord) => {
11313
11313
  const retVal = [];
11314
11314
  searchFieldRecord.expressions.forEach((expression) => {
11315
11315
  let uriVal = this.GetValueFromPath(resource, expression.path, searchFieldRecord, expression);
@@ -11368,7 +11368,7 @@ class DBSearchIndex {
11368
11368
  this.#debug("------------------");
11369
11369
  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)}]`);
11370
11370
  };
11371
- UpdateIndex = (resource, searchFieldRecord) => {
11371
+ UpdateIndex = async (resource, searchFieldRecord) => {
11372
11372
  try {
11373
11373
  const tir = {
11374
11374
  PID: v4(),
@@ -11387,7 +11387,7 @@ class DBSearchIndex {
11387
11387
  let saveRecord;
11388
11388
  const searchIndexBaseProcessor = this.searchRegistry.searchIndexBaseRegistry[searchFieldRecord.SP_TYPE];
11389
11389
  if (searchIndexBaseProcessor) {
11390
- saveRecord = searchIndexBaseProcessor.OutputIndexRecord(resource, tir, searchFieldRecord);
11390
+ saveRecord = await searchIndexBaseProcessor.OutputIndexRecord(resource, tir, searchFieldRecord);
11391
11391
  } else if (searchFieldRecord.SP_TYPE.localeCompare("special") === 0) {
11392
11392
  } else {
11393
11393
  const message = `DBSearchIndex:UpdateIndex(): Error: Search field paramater type: [${searchFieldRecord.SP_TYPE}] unknown.`;
@@ -11400,14 +11400,14 @@ class DBSearchIndex {
11400
11400
  return [];
11401
11401
  }
11402
11402
  };
11403
- GetSearchIndexData = (resource) => {
11403
+ GetSearchIndexData = async (resource) => {
11404
11404
  try {
11405
- const searchParamRecords = this.resourceHelper.GetSearchParamsFromResourceType(resource.resourceType);
11405
+ const searchParamRecords = await this.resourceHelper.GetSearchParamsFromResourceType(resource.resourceType);
11406
11406
  const searchIndexData = [];
11407
11407
  for (let i = 0; i < searchParamRecords.length; i++) {
11408
11408
  const searchRecord = searchParamRecords[i];
11409
11409
  try {
11410
- const retVal = this.UpdateIndex(resource, searchRecord);
11410
+ const retVal = await this.UpdateIndex(resource, searchRecord);
11411
11411
  if (retVal && retVal.length > 0) {
11412
11412
  searchIndexData.push(...retVal);
11413
11413
  }
@@ -11421,10 +11421,10 @@ class DBSearchIndex {
11421
11421
  return [];
11422
11422
  }
11423
11423
  };
11424
- GetSearchParamFromResourceType = (resourceType, name) => {
11424
+ GetSearchParamFromResourceType = async (resourceType, name) => {
11425
11425
  return this.resourceHelper.GetSearchParamFromResourceType(resourceType, name);
11426
11426
  };
11427
- GetSearchParamFromResourceTypeUrl = (resourceType, url) => {
11427
+ GetSearchParamFromResourceTypeUrl = async (resourceType, url) => {
11428
11428
  return this.resourceHelper.GetSearchParamFromResourceTypeUrl(resourceType, url);
11429
11429
  };
11430
11430
  }
@@ -18202,7 +18202,7 @@ class PGFhirAccessLayer extends tinyEmitterExports.TinyEmitter {
18202
18202
  UpdateIndexes = async (client2, resource) => {
18203
18203
  let start = performance.now();
18204
18204
  const oa = start;
18205
- const searchIndexData = this.#dbSearchIndex.GetSearchIndexData(resource);
18205
+ const searchIndexData = await this.#dbSearchIndex.GetSearchIndexData(resource);
18206
18206
  const lap1 = performance.now() - start;
18207
18207
  start = performance.now();
18208
18208
  const InsertResourceLinkRecord = async (client22, resourceLinkIndexRecord) => {