@openhi/constructs 0.0.182 → 0.0.184

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.
@@ -11247,10 +11247,25 @@ function wrapTokenInShape(shape, value) {
11247
11247
  return { [shape.field]: [{ [shape.subfield]: value }] };
11248
11248
  }
11249
11249
  }
11250
+ function wrapTokenWithSystem(shape, systemSubfield, parsed) {
11251
+ if (shape.kind !== "array-of-objects") {
11252
+ throw new Error(
11253
+ `Token predicate option "systemSubfield" requires an array-of-objects JSONPath ("$.field[*].subfield"); got shape "${shape.kind}".`
11254
+ );
11255
+ }
11256
+ const entry = {};
11257
+ if (parsed.system !== void 0) {
11258
+ entry[systemSubfield] = parsed.system;
11259
+ }
11260
+ if (parsed.system === void 0 || parsed.code.length > 0) {
11261
+ entry[shape.subfield] = parsed.code;
11262
+ }
11263
+ return { [shape.field]: [entry] };
11264
+ }
11250
11265
  function emitTokenPredicate(opts) {
11251
11266
  const shape = jsonbPathToTokenShape(opts.jsonbPath);
11252
- const { code } = parseTokenValue(opts.rawValue);
11253
- const payload = wrapTokenInShape(shape, code);
11267
+ const parsed = parseTokenValue(opts.rawValue);
11268
+ const payload = opts.systemSubfield !== void 0 ? wrapTokenWithSystem(shape, opts.systemSubfield, parsed) : wrapTokenInShape(shape, parsed.code);
11254
11269
  const sql = `resource @> :${opts.paramName}::jsonb`;
11255
11270
  const params = [
11256
11271
  { name: opts.paramName, value: JSON.stringify(payload) }
@@ -11324,6 +11339,7 @@ function emitOne(opts) {
11324
11339
  rawValue,
11325
11340
  paramName,
11326
11341
  modifier: effectiveModifier,
11342
+ systemSubfield: param.systemSubfield,
11327
11343
  context
11328
11344
  });
11329
11345
  if (!negate) {
@@ -11345,6 +11361,7 @@ function emitForType(opts) {
11345
11361
  jsonbPath: opts.jsonbPath,
11346
11362
  rawValue: opts.rawValue,
11347
11363
  paramName: opts.paramName,
11364
+ systemSubfield: opts.systemSubfield,
11348
11365
  context: opts.context
11349
11366
  });
11350
11367
  case "date":
@@ -11529,7 +11546,13 @@ var APPOINTMENT_SEARCH_PARAMETERS = [
11529
11546
  type: "token",
11530
11547
  jsonbPath: "$.appointmentType"
11531
11548
  },
11532
- { code: "slot", type: "reference", jsonbPath: "$.slot[*]" }
11549
+ { code: "slot", type: "reference", jsonbPath: "$.slot[*]" },
11550
+ {
11551
+ code: "identifier",
11552
+ type: "token",
11553
+ jsonbPath: "$.identifier[*].value",
11554
+ systemSubfield: "system"
11555
+ }
11533
11556
  ];
11534
11557
 
11535
11558
  // src/data/search/registry/chargeitem-search-parameters.ts
@@ -11779,6 +11802,12 @@ var ENCOUNTER_SEARCH_PARAMETERS = [
11779
11802
  code: "episode-of-care",
11780
11803
  type: "reference",
11781
11804
  jsonbPath: "$.episodeOfCare[*]"
11805
+ },
11806
+ {
11807
+ code: "identifier",
11808
+ type: "token",
11809
+ jsonbPath: "$.identifier[*].value",
11810
+ systemSubfield: "system"
11782
11811
  }
11783
11812
  ];
11784
11813