@nsshunt/stsfhirpg 1.2.1 → 1.2.3

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