@nsshunt/stsfhirpg 1.2.1 → 1.2.2

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.
@@ -7025,7 +7025,8 @@ class ResourceHelper {
7025
7025
  this.#definitions = {
7026
7026
  resources: {},
7027
7027
  types: {},
7028
- searchParameters: {}
7028
+ searchParametersByUrl: {},
7029
+ searchParametersByResourceType: {}
7029
7030
  };
7030
7031
  }
7031
7032
  __resources.entry.forEach((entry) => {
@@ -7042,25 +7043,22 @@ class ResourceHelper {
7042
7043
  }
7043
7044
  });
7044
7045
  __searchParams.entry.forEach((entry) => {
7045
- this.#definitions.searchParameters[entry.fullUrl] = entry.resource;
7046
+ this.#definitions.searchParametersByUrl[entry.fullUrl] = entry.resource;
7046
7047
  });
7048
+ this._LoadSearchParameters();
7047
7049
  return this.#definitions;
7048
7050
  };
7049
- GetType = (typeName) => {
7051
+ get definitions() {
7050
7052
  if (!this.#definitions) {
7051
7053
  this.#LoadDefinitions();
7052
7054
  }
7053
- if (this.#definitions) {
7054
- const foundType = this.#definitions.types[typeName];
7055
- return foundType;
7056
- }
7057
- return [];
7055
+ return this.#definitions;
7056
+ }
7057
+ GetType = (typeName) => {
7058
+ return this.definitions.types[typeName];
7058
7059
  };
7059
7060
  GetResource = (resourceType) => {
7060
- if (!this.#definitions) {
7061
- this.#LoadDefinitions();
7062
- }
7063
- return this.#definitions.resources[resourceType];
7061
+ return this.definitions.resources[resourceType];
7064
7062
  };
7065
7063
  GetResourceField = (resourceType, fieldPath) => {
7066
7064
  const resource = this.GetResource(resourceType);
@@ -7073,22 +7071,215 @@ class ResourceHelper {
7073
7071
  }
7074
7072
  };
7075
7073
  GetSearchParam = (url) => {
7076
- if (!this.#definitions) {
7077
- this.#LoadDefinitions();
7078
- }
7079
- return this.#definitions.searchParameters[url];
7074
+ return this.definitions.searchParametersByUrl[url];
7080
7075
  };
7081
7076
  GetSearchParams = () => {
7082
- if (!this.#definitions) {
7083
- this.#LoadDefinitions();
7084
- }
7085
- return this.#definitions.searchParameters;
7077
+ return this.definitions.searchParametersByUrl;
7086
7078
  };
7087
7079
  GetSearchParamsByResource = (resource) => {
7088
- if (!this.#definitions) {
7089
- this.#LoadDefinitions();
7080
+ return Object.values(this.definitions.searchParametersByUrl).filter((sp) => sp.base.includes(resource)).map((sp) => sp);
7081
+ };
7082
+ // ------------------------------------------------------------------------------------------------------------------
7083
+ // Remove ( ) when either are present
7084
+ #RemoveOuterParentheses = (input) => {
7085
+ return input.replace(/^\(|\)$/g, "");
7086
+ };
7087
+ // Remove ( ) only when both are present
7088
+ #RemoveSurroundingParentheses = (input) => {
7089
+ return input.replace(/^\((.*)\)$/, "$1").trim();
7090
+ };
7091
+ /*
7092
+
7093
+ NamingSystem derived-from reference NamingSystem.relatedArtifact.where(type='derived-from').resource
7094
+
7095
+ NamingSystem predecessor reference NamingSystem.relatedArtifact.where(type='predecessor').resource
7096
+
7097
+ ClinicalUseDefinition product reference ClinicalUseDefinition.subject.where(resolve() is MedicinalProductDefinition)
7098
+
7099
+ OrganizationAffiliation email token OrganizationAffiliation.contact.telecom.where(system='email')
7100
+ OrganizationAffiliation phone token OrganizationAffiliation.contact.telecom.where(system='phone')
7101
+
7102
+ PackagedProductDefinition biological reference PackagedProductDefinition.packaging.containedItem.item.reference
7103
+ PackagedProductDefinition contained-item reference PackagedProductDefinition.packaging.containedItem.item.reference
7104
+
7105
+ Patient deceased token Patient.deceased.exists() and Patient.deceased != false
7106
+ Practitioner deceased token Practitioner.deceased.exists() and Practitioner.deceased != false
7107
+
7108
+ Location contains special Location.extension('http://hl7.org/fhir/StructureDefinition/location-boundary-geojson').value
7109
+
7110
+ QuestionnaireResponse item-subject reference QuestionnaireResponse.item.where(extension('http://hl7.org/fhir/StructureDefinition/questionnaireresponse-isSubject').exists()).answer.valueReference
7111
+ */
7112
+ ProcessExpressions = (resourceName, SP_EXPRESSION) => {
7113
+ let expressions = [];
7114
+ expressions = SP_EXPRESSION.split("|").map((e) => e.trim());
7115
+ expressions = expressions.map((e) => this.#RemoveSurroundingParentheses(e).trim());
7116
+ if (resourceName !== "") {
7117
+ expressions = expressions.filter((e) => e.split(".")[0].trim().localeCompare(resourceName) === 0);
7118
+ }
7119
+ let original_expressions = [...expressions];
7120
+ expressions = expressions.map((e) => {
7121
+ let capturedTypeOf = void 0;
7122
+ return {
7123
+ path: e.replace(
7124
+ /\.ofType\(([^)]+)\)/g,
7125
+ (_, typeName) => {
7126
+ capturedTypeOf = true;
7127
+ return typeName.charAt(0).toUpperCase() + typeName.slice(1);
7128
+ }
7129
+ ),
7130
+ typeOf: capturedTypeOf
7131
+ };
7132
+ });
7133
+ expressions.forEach((expression) => {
7134
+ try {
7135
+ const sp = expression;
7136
+ if (sp.path.indexOf("exists()") >= 0) {
7137
+ const parts = sp.path.split(" ");
7138
+ const i = parts[0].indexOf("exists()");
7139
+ if (i >= 0) {
7140
+ let fieldExistsEx = parts[0].substring(0, i - 1);
7141
+ let op = parts[1];
7142
+ let fieldTestEx = parts[2];
7143
+ let comparator = parts[3];
7144
+ let value = parts[4];
7145
+ const fieldExistsParts = fieldExistsEx.split(".");
7146
+ let fieldExists = fieldExistsParts.slice(1).join(".");
7147
+ const fieldTestParts = fieldTestEx.split(".");
7148
+ let fieldTest = fieldTestParts.slice(1).join(".");
7149
+ sp.exists = {
7150
+ fieldExists: [`${fieldExists}Boolean`, `${fieldExists}DataTime`],
7151
+ // [x]Boolean or [x]DateTime
7152
+ op,
7153
+ fieldTest: [`${fieldTest}Boolean`, `${fieldTest}DataTime`],
7154
+ comparator,
7155
+ value: [value, void 0]
7156
+ };
7157
+ }
7158
+ }
7159
+ } catch (error) {
7160
+ }
7161
+ });
7162
+ let capturedType;
7163
+ expressions = expressions.map((obj) => {
7164
+ capturedType = void 0;
7165
+ const { path, typeOf, exists } = obj;
7166
+ return {
7167
+ path: path.replace(
7168
+ /\.where\(resolve\(\)\s+is\s+([^)]+)\)/,
7169
+ (_, typeName) => {
7170
+ capturedType = typeName;
7171
+ return "";
7172
+ }
7173
+ ),
7174
+ typeOf,
7175
+ reference: capturedType,
7176
+ exists
7177
+ };
7178
+ });
7179
+ let capturedWhere = void 0;
7180
+ expressions = expressions.map((obj) => {
7181
+ capturedWhere = void 0;
7182
+ const { path, reference, typeOf, exists } = obj;
7183
+ const retVal = {
7184
+ path: path.replace(/([^.]+)\.where\(([^=]+)='([^']+)'\)/g, (_, field, subfield, value) => {
7185
+ capturedWhere = { field, subfield, value };
7186
+ return field;
7187
+ }),
7188
+ typeOf,
7189
+ reference,
7190
+ exists
7191
+ };
7192
+ if (capturedWhere) {
7193
+ capturedWhere.full = `${capturedWhere.field}[*].${capturedWhere.subfield}=${capturedWhere.value}`;
7194
+ retVal.where = capturedWhere;
7195
+ }
7196
+ return retVal;
7197
+ });
7198
+ return {
7199
+ expressions,
7200
+ original_expressions
7201
+ };
7202
+ };
7203
+ _LoadSearchParameters = () => {
7204
+ for (const [key, val] of Object.entries(this.GetSearchParams())) {
7205
+ const { id, url, code, base, type, expression, component, target } = val;
7206
+ for (let i = 0; i < base.length; i++) {
7207
+ const resourceName = base[i];
7208
+ if (!this.#definitions?.searchParametersByResourceType[resourceName]) {
7209
+ this.#definitions.searchParametersByResourceType[resourceName] = {
7210
+ resourceName,
7211
+ params: []
7212
+ };
7213
+ }
7214
+ const SP_ID = id;
7215
+ const SP_NAME = code;
7216
+ const SP_TYPE = type;
7217
+ const SP_URL = url;
7218
+ const SP_TARGET = target;
7219
+ let SP_EXPRESSION = expression;
7220
+ let expressions = [];
7221
+ let original_expressions = [];
7222
+ if (SP_EXPRESSION) {
7223
+ const retVal = this.ProcessExpressions(resourceName, SP_EXPRESSION);
7224
+ expressions = retVal.expressions;
7225
+ original_expressions = retVal.original_expressions;
7226
+ }
7227
+ const record = {
7228
+ SP_ID,
7229
+ SP_NAME,
7230
+ SP_TYPE,
7231
+ SP_URL,
7232
+ SP_TARGET,
7233
+ expressions,
7234
+ original_expressions,
7235
+ SP_DEFINITION: this.GetSearchParam(SP_URL)
7236
+ };
7237
+ for (let i2 = 0; i2 < record.expressions.length; i2++) {
7238
+ const rf = this.GetResourceField(resourceName, record.expressions[i2].path);
7239
+ if (rf) {
7240
+ expressions[i2].RES_FIELD = rf;
7241
+ }
7242
+ }
7243
+ if (component) {
7244
+ record.component = [...component];
7245
+ record.component.forEach((c) => {
7246
+ const retVal = this.ProcessExpressions("", c.expression);
7247
+ c.expressions = retVal.expressions;
7248
+ c.original_expressions = retVal.original_expressions;
7249
+ const def = this.GetSearchParam(c.definition);
7250
+ if (def && def.type) {
7251
+ c.type = def.type;
7252
+ }
7253
+ });
7254
+ }
7255
+ this.#definitions.searchParametersByResourceType[resourceName].params.push(record);
7256
+ }
7257
+ }
7258
+ };
7259
+ GetSearchParamFromResourceTypeUrl = (resourceType, url) => {
7260
+ const filterByNameAndUrl = this.definitions.searchParametersByResourceType[resourceType].params.filter((rt) => rt.SP_URL.localeCompare(url) === 0);
7261
+ if (filterByNameAndUrl.length > 0) {
7262
+ return filterByNameAndUrl[0];
7090
7263
  }
7091
- return Object.values(this.#definitions.searchParameters).filter((sp) => sp.base.includes(resource)).map((sp) => sp);
7264
+ };
7265
+ /*
7266
+ GetSearchParamFromResourceType = (resourceType: string, name: string): ISearchParamRecord | undefined => {
7267
+ const filterByName = this.definitions.searchParametersByResourceType[resourceType].params.filter(rt => rt.SP_NAME.localeCompare(name) === 0);
7268
+ if (filterByName.length > 0) {
7269
+ return filterByName[0];
7270
+ }
7271
+ }
7272
+
7273
+ GetPathsFromResourceType = (resourceType: string, name: string): string[] => {
7274
+ const filterByName = this.definitions.searchParametersByResourceType[resourceType].params.filter(rt => rt.SP_NAME.localeCompare(name) === 0);
7275
+ if (filterByName.length > 0) {
7276
+ return filterByName[0].expressions.map(e => e.path)
7277
+ }
7278
+ return [ ];
7279
+ }
7280
+ */
7281
+ GetSearchParamsFromResourceType = (resourceType) => {
7282
+ return this.definitions.searchParametersByResourceType[resourceType].params;
7092
7283
  };
7093
7284
  }
7094
7285
  var ansiStyles = { exports: {} };
@@ -10566,7 +10757,7 @@ class DBSearchIndexComposite extends DBSearchIndexBase {
10566
10757
  searchFieldRecord.component.forEach((searchParamComponentRecord) => {
10567
10758
  components.push([]);
10568
10759
  const url = searchParamComponentRecord.definition;
10569
- const sp = searchIndex.GetSearchParamFromResourceTypeUrl(resource.resourceType, url);
10760
+ const sp = searchIndex.resourceHelper.GetSearchParamFromResourceTypeUrl(resource.resourceType, url);
10570
10761
  if (this.IsDefined(sp)) {
10571
10762
  const tir2 = {
10572
10763
  PID: v4(),
@@ -11221,27 +11412,13 @@ class DBSearchIndex {
11221
11412
  return [];
11222
11413
  }
11223
11414
  };
11224
- ResolveFhirChoiceType = (path) => {
11225
- const match2 = path.match(/^(.+?)\.ofType\((.+?)\)$/);
11226
- if (!match2) {
11227
- return path;
11228
- }
11229
- const base = match2[1];
11230
- const fhirType = match2[2];
11231
- const capitalizedType = fhirType.charAt(0).toUpperCase() + fhirType.slice(1);
11232
- return `${base}${capitalizedType}`;
11233
- };
11234
11415
  GetSearchIndexData = (resource) => {
11235
11416
  try {
11236
- const st = performance.now();
11237
- if (!this.#searchParams) {
11238
- this.LoadSearchParameters();
11239
- }
11417
+ const searchParamRecords = this.resourceHelper.GetSearchParamsFromResourceType(resource.resourceType);
11240
11418
  const searchIndexData = [];
11241
- for (let i = 0; i < this.#searchParams[resource.resourceType].params.length; i++) {
11242
- const searchRecord = this.#searchParams[resource.resourceType].params[i];
11419
+ for (let i = 0; i < searchParamRecords.length; i++) {
11420
+ const searchRecord = searchParamRecords[i];
11243
11421
  try {
11244
- const st2 = performance.now();
11245
11422
  const retVal = this.UpdateIndex(resource, searchRecord);
11246
11423
  if (retVal && retVal.length > 0) {
11247
11424
  searchIndexData.push(...retVal);
@@ -11256,286 +11433,19 @@ class DBSearchIndex {
11256
11433
  return [];
11257
11434
  }
11258
11435
  };
11259
- GetSearchParamFromResourceTypeUrl = (resourceType, url) => {
11260
- if (!this.#searchParams) {
11261
- this.LoadSearchParameters();
11262
- }
11263
- const filterByNameAndUrl = this.#searchParams[resourceType].params.filter((rt) => rt.SP_URL.localeCompare(url) === 0);
11264
- if (filterByNameAndUrl.length > 0) {
11265
- return filterByNameAndUrl[0];
11266
- }
11267
- };
11268
- GetSearchParamFromResourceType = (resourceType, name) => {
11269
- if (!this.#searchParams) {
11270
- this.LoadSearchParameters();
11271
- }
11272
- const filterByName = this.#searchParams[resourceType].params.filter((rt) => rt.SP_NAME.localeCompare(name) === 0);
11273
- if (filterByName.length > 0) {
11274
- return filterByName[0];
11275
- }
11276
- };
11277
- GetPathsFromResourceType = (resourceType, name) => {
11278
- if (!this.#searchParams) {
11279
- this.LoadSearchParameters();
11280
- }
11281
- const filterByName = this.#searchParams[resourceType].params.filter((rt) => rt.SP_NAME.localeCompare(name) === 0);
11282
- if (filterByName.length > 0) {
11283
- return filterByName[0].expressions.map((e) => e.path);
11284
- }
11285
- return [];
11286
- };
11287
- // Remove ( ) when either are present
11288
- #RemoveOuterParentheses = (input) => {
11289
- return input.replace(/^\(|\)$/g, "");
11290
- };
11291
- // Remove ( ) only when both are present
11292
- #RemoveSurroundingParentheses = (input) => {
11293
- return input.replace(/^\((.*)\)$/, "$1").trim();
11294
- };
11295
11436
  /*
11296
-
11297
- NamingSystem derived-from reference NamingSystem.relatedArtifact.where(type='derived-from').resource
11298
-
11299
- NamingSystem predecessor reference NamingSystem.relatedArtifact.where(type='predecessor').resource
11300
-
11301
- ClinicalUseDefinition product reference ClinicalUseDefinition.subject.where(resolve() is MedicinalProductDefinition)
11302
-
11303
- OrganizationAffiliation email token OrganizationAffiliation.contact.telecom.where(system='email')
11304
- OrganizationAffiliation phone token OrganizationAffiliation.contact.telecom.where(system='phone')
11305
-
11306
- PackagedProductDefinition biological reference PackagedProductDefinition.packaging.containedItem.item.reference
11307
- PackagedProductDefinition contained-item reference PackagedProductDefinition.packaging.containedItem.item.reference
11308
-
11309
- Patient deceased token Patient.deceased.exists() and Patient.deceased != false
11310
- Practitioner deceased token Practitioner.deceased.exists() and Practitioner.deceased != false
11311
-
11312
- Location contains special Location.extension('http://hl7.org/fhir/StructureDefinition/location-boundary-geojson').value
11313
-
11314
- QuestionnaireResponse item-subject reference QuestionnaireResponse.item.where(extension('http://hl7.org/fhir/StructureDefinition/questionnaireresponse-isSubject').exists()).answer.valueReference
11315
- */
11316
- ProcessExpressions = (resourceName, SP_EXPRESSION) => {
11317
- let expressions = [];
11318
- expressions = SP_EXPRESSION.split("|").map((e) => e.trim());
11319
- expressions = expressions.map((e) => this.#RemoveSurroundingParentheses(e).trim());
11320
- if (resourceName !== "") {
11321
- expressions = expressions.filter((e) => e.split(".")[0].trim().localeCompare(resourceName) === 0);
11322
- }
11323
- let original_expressions = [...expressions];
11324
- expressions = expressions.map((e) => {
11325
- let capturedTypeOf = void 0;
11326
- return {
11327
- path: e.replace(
11328
- /\.ofType\(([^)]+)\)/g,
11329
- (_, typeName) => {
11330
- capturedTypeOf = true;
11331
- return typeName.charAt(0).toUpperCase() + typeName.slice(1);
11332
- }
11333
- ),
11334
- typeOf: capturedTypeOf
11335
- };
11336
- });
11337
- expressions.forEach((expression) => {
11338
- try {
11339
- const sp = expression;
11340
- if (sp.path.indexOf("exists()") >= 0) {
11341
- const parts = sp.path.split(" ");
11342
- const i = parts[0].indexOf("exists()");
11343
- if (i >= 0) {
11344
- let fieldExistsEx = parts[0].substring(0, i - 1);
11345
- let op = parts[1];
11346
- let fieldTestEx = parts[2];
11347
- let comparator = parts[3];
11348
- let value = parts[4];
11349
- const fieldExistsParts = fieldExistsEx.split(".");
11350
- let fieldExists = fieldExistsParts.slice(1).join(".");
11351
- const fieldTestParts = fieldTestEx.split(".");
11352
- let fieldTest = fieldTestParts.slice(1).join(".");
11353
- sp.exists = {
11354
- fieldExists: [`${fieldExists}Boolean`, `${fieldExists}DataTime`],
11355
- // [x]Boolean or [x]DateTime
11356
- op,
11357
- fieldTest: [`${fieldTest}Boolean`, `${fieldTest}DataTime`],
11358
- comparator,
11359
- value: [value, void 0]
11360
- };
11361
- }
11362
- }
11363
- } catch (error) {
11364
- }
11365
- });
11366
- let capturedType;
11367
- expressions = expressions.map((obj) => {
11368
- capturedType = void 0;
11369
- const { path, typeOf, exists } = obj;
11370
- return {
11371
- path: path.replace(
11372
- /\.where\(resolve\(\)\s+is\s+([^)]+)\)/,
11373
- (_, typeName) => {
11374
- capturedType = typeName;
11375
- return "";
11376
- }
11377
- ),
11378
- typeOf,
11379
- reference: capturedType,
11380
- exists
11381
- };
11382
- });
11383
- let capturedWhere = void 0;
11384
- expressions = expressions.map((obj) => {
11385
- capturedWhere = void 0;
11386
- const { path, reference, typeOf, exists } = obj;
11387
- const retVal = {
11388
- path: path.replace(/([^.]+)\.where\(([^=]+)='([^']+)'\)/g, (_, field, subfield, value) => {
11389
- capturedWhere = { field, subfield, value };
11390
- return field;
11391
- }),
11392
- typeOf,
11393
- reference,
11394
- exists
11395
- };
11396
- if (capturedWhere) {
11397
- capturedWhere.full = `${capturedWhere.field}[*].${capturedWhere.subfield}=${capturedWhere.value}`;
11398
- retVal.where = capturedWhere;
11437
+ GetSearchParamFromResourceTypeUrl = (resourceType: string, url: string): ISearchParamRecord | undefined => {
11438
+ return this.resourceHelper.GetSearchParamFromResourceTypeUrl(resourceType, url);
11399
11439
  }
11400
- return retVal;
11401
- });
11402
- return {
11403
- expressions,
11404
- original_expressions
11405
- };
11406
- };
11407
- LoadSearchParameters = () => {
11408
- const searchParamData = {};
11409
- for (const [key, val] of Object.entries(this.resourceHelper.GetSearchParams())) {
11410
- const { id, url, code, base, type, expression, component, target } = val;
11411
- for (let i = 0; i < base.length; i++) {
11412
- const resourceName = base[i];
11413
- if (!searchParamData[resourceName]) {
11414
- searchParamData[resourceName] = {
11415
- resourceName,
11416
- params: []
11417
- };
11418
- }
11419
- const SP_ID = id;
11420
- const SP_NAME = code;
11421
- const SP_TYPE = type;
11422
- const SP_URL = url;
11423
- const SP_TARGET = target;
11424
- let SP_EXPRESSION = expression;
11425
- let expressions = [];
11426
- let original_expressions = [];
11427
- if (SP_EXPRESSION) {
11428
- const retVal = this.ProcessExpressions(resourceName, SP_EXPRESSION);
11429
- expressions = retVal.expressions;
11430
- original_expressions = retVal.original_expressions;
11431
- }
11432
- const record = {
11433
- SP_ID,
11434
- SP_NAME,
11435
- SP_TYPE,
11436
- SP_URL,
11437
- SP_TARGET,
11438
- expressions,
11439
- original_expressions,
11440
- SP_DEFINITION: this.resourceHelper.GetSearchParam(SP_URL)
11441
- };
11442
- for (let i2 = 0; i2 < record.expressions.length; i2++) {
11443
- const rf = this.resourceHelper.GetResourceField(resourceName, record.expressions[i2].path);
11444
- if (rf) {
11445
- expressions[i2].RES_FIELD = rf;
11446
- }
11447
- }
11448
- if (component) {
11449
- record.component = [...component];
11450
- record.component.forEach((c) => {
11451
- const retVal = this.ProcessExpressions("", c.expression);
11452
- c.expressions = retVal.expressions;
11453
- c.original_expressions = retVal.original_expressions;
11454
- const def = this.resourceHelper.GetSearchParam(c.definition);
11455
- if (def && def.type) {
11456
- c.type = def.type;
11457
- }
11458
- });
11459
- }
11460
- searchParamData[resourceName].params.push(record);
11461
- }
11462
- }
11463
- this.#searchParams = searchParamData;
11464
- return searchParamData;
11465
- };
11466
- /*
11467
-
11468
-
11469
- for (const [resourceName,val] of Object.entries(searchParams)) {
11470
-
11471
- const patientSearchList: Record<string, any> = (val as any).resourceSpecific;
11472
-
11473
- for (const [key2,val2] of Object.entries(patientSearchList)) {
11474
-
11475
- const SP_ID = val2.id;
11476
- const SP_NAME = key2;
11477
- const SP_TYPE = val2.type;
11478
- const SP_URL = val2.url;
11479
- let SP_EXPRESSION: string = val2.expression;
11480
- let expressions: any[] = [];
11481
- let original_expressions: any[] = [];
11482
- if (SP_EXPRESSION) {
11483
- const retVal = this.ProcessExpressions(resourceName, SP_EXPRESSION);
11484
- expressions = retVal.expressions;
11485
- original_expressions = retVal.original_expressions;
11486
- }
11487
11440
 
11488
- if (!searchParamData[resourceName]) {
11489
- searchParamData[resourceName] = {
11490
- resourceName,
11491
- params: [ ]
11492
- }
11493
- }
11494
-
11495
- // GetResourceField
11496
-
11497
- const record: ISearchParamRecord = {
11498
- SP_ID,
11499
- SP_NAME,
11500
- SP_TYPE,
11501
- SP_URL,
11502
- expressions,
11503
- original_expressions,
11504
- SP_DEFINITION: this.resourceHelper.GetSearchParam(SP_URL)
11505
- };
11506
-
11507
- for (let i=0; i < record.expressions.length; i++) {
11508
- //console.log(record.expressions[i]);
11509
- const rf = this.resourceHelper.GetResourceField(resourceName, record.expressions[i].path);
11510
- if (rf) {
11511
- expressions[i].RES_FIELD = rf;
11512
- }
11513
- }
11514
-
11515
- if (val2.component) {
11516
- record.component = [ ...val2.component ];
11517
- (record.component as any[]).forEach(c => {
11518
- //c.SP_RAW_PATHS = (c.expression.split('|') as any[]).map(rp => rp.trim());
11519
- //c.SP_PATHS = (c.SP_RAW_PATHS as any[]).map(rawPath => this.ResolveFhirChoiceType(rawPath));
11520
- const retVal = this.ProcessExpressions('', c.expression);
11521
- c.expressions = retVal.expressions;
11522
- c.original_expressions = retVal.original_expressions;
11523
- const def = this.resourceHelper.GetSearchParam(c.definition);
11524
- if (def && def.type) {
11525
- c.type = def.type
11526
- }
11527
- })
11528
- }
11529
-
11530
- searchParamData[resourceName].params.push(record);
11531
- }
11532
- }
11533
-
11534
- this.#searchParams = searchParamData;
11441
+ GetSearchParamFromResourceType = (resourceType: string, name: string): ISearchParamRecord | undefined => {
11442
+ return this.resourceHelper.GetSearchParamFromResourceType(resourceType, name);
11443
+ }
11535
11444
 
11536
- return searchParamData;
11445
+ GetPathsFromResourceType = (resourceType: string, name: string): string[] => {
11446
+ return this.resourceHelper.GetPathsFromResourceType(resourceType, name);
11537
11447
  }
11538
- */
11448
+ */
11539
11449
  }
11540
11450
  var lib$1 = { exports: {} };
11541
11451
  var defaults = { exports: {} };