phenoml 12.5.0 → 13.1.0

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 (106) hide show
  1. package/dist/cjs/BaseClient.d.ts +3 -0
  2. package/dist/cjs/BaseClient.js +17 -2
  3. package/dist/cjs/api/resources/agent/client/Client.js +17 -9
  4. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +7 -7
  5. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/cohort/client/Client.js +1 -1
  7. package/dist/cjs/api/resources/construe/client/Client.js +39 -11
  8. package/dist/cjs/api/resources/fhir/client/Client.js +10 -6
  9. package/dist/cjs/api/resources/fhirProvider/client/Client.js +7 -7
  10. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +11 -3
  11. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +16 -8
  12. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +2 -0
  13. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +2 -0
  14. package/dist/cjs/api/resources/lang2Fhir/types/CreateMultiResponse.d.ts +3 -1
  15. package/dist/cjs/api/resources/lang2Fhir/types/DocumentConfig.d.ts +7 -0
  16. package/dist/cjs/api/resources/lang2Fhir/types/DocumentConfig.js +3 -0
  17. package/dist/cjs/api/resources/lang2Fhir/types/DocumentMultiResponse.d.ts +5 -0
  18. package/dist/cjs/api/resources/lang2Fhir/types/DocumentMultiResponse.js +3 -0
  19. package/dist/cjs/api/resources/lang2Fhir/types/PageClassification.d.ts +11 -0
  20. package/dist/cjs/api/resources/lang2Fhir/types/PageClassification.js +3 -0
  21. package/dist/cjs/api/resources/lang2Fhir/types/PageFilter.d.ts +7 -0
  22. package/dist/cjs/api/resources/lang2Fhir/types/PageFilter.js +3 -0
  23. package/dist/cjs/api/resources/lang2Fhir/types/index.d.ts +4 -0
  24. package/dist/cjs/api/resources/lang2Fhir/types/index.js +4 -0
  25. package/dist/cjs/api/resources/summary/client/Client.js +6 -6
  26. package/dist/cjs/api/resources/tools/client/Client.js +4 -4
  27. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +0 -2
  28. package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +4 -4
  29. package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +4 -4
  30. package/dist/cjs/api/resources/workflows/client/Client.js +22 -6
  31. package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
  32. package/dist/cjs/core/auth/AuthProvider.js +7 -0
  33. package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
  34. package/dist/cjs/core/auth/BasicAuth.js +7 -1
  35. package/dist/cjs/core/auth/index.d.ts +1 -1
  36. package/dist/cjs/core/auth/index.js +3 -1
  37. package/dist/cjs/core/fetcher/Fetcher.d.ts +8 -0
  38. package/dist/cjs/core/fetcher/Fetcher.js +13 -8
  39. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
  40. package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
  41. package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
  42. package/dist/cjs/core/url/index.d.ts +1 -0
  43. package/dist/cjs/core/url/index.js +3 -1
  44. package/dist/cjs/core/url/qs.d.ts +2 -1
  45. package/dist/cjs/core/url/qs.js +24 -12
  46. package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
  47. package/dist/cjs/errors/phenomlError.d.ts +3 -1
  48. package/dist/cjs/errors/phenomlError.js +4 -1
  49. package/dist/cjs/errors/phenomlTimeoutError.d.ts +4 -1
  50. package/dist/cjs/errors/phenomlTimeoutError.js +4 -1
  51. package/dist/cjs/version.d.ts +1 -1
  52. package/dist/cjs/version.js +1 -1
  53. package/dist/esm/BaseClient.d.mts +3 -0
  54. package/dist/esm/BaseClient.mjs +17 -2
  55. package/dist/esm/api/resources/agent/client/Client.mjs +17 -9
  56. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +7 -7
  57. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +1 -1
  58. package/dist/esm/api/resources/cohort/client/Client.mjs +1 -1
  59. package/dist/esm/api/resources/construe/client/Client.mjs +39 -11
  60. package/dist/esm/api/resources/fhir/client/Client.mjs +10 -6
  61. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +7 -7
  62. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +11 -3
  63. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +16 -8
  64. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +2 -0
  65. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +2 -0
  66. package/dist/esm/api/resources/lang2Fhir/types/CreateMultiResponse.d.mts +3 -1
  67. package/dist/esm/api/resources/lang2Fhir/types/DocumentConfig.d.mts +7 -0
  68. package/dist/esm/api/resources/lang2Fhir/types/DocumentConfig.mjs +2 -0
  69. package/dist/esm/api/resources/lang2Fhir/types/DocumentMultiResponse.d.mts +5 -0
  70. package/dist/esm/api/resources/lang2Fhir/types/DocumentMultiResponse.mjs +2 -0
  71. package/dist/esm/api/resources/lang2Fhir/types/PageClassification.d.mts +11 -0
  72. package/dist/esm/api/resources/lang2Fhir/types/PageClassification.mjs +2 -0
  73. package/dist/esm/api/resources/lang2Fhir/types/PageFilter.d.mts +7 -0
  74. package/dist/esm/api/resources/lang2Fhir/types/PageFilter.mjs +2 -0
  75. package/dist/esm/api/resources/lang2Fhir/types/index.d.mts +4 -0
  76. package/dist/esm/api/resources/lang2Fhir/types/index.mjs +4 -0
  77. package/dist/esm/api/resources/summary/client/Client.mjs +6 -6
  78. package/dist/esm/api/resources/tools/client/Client.mjs +4 -4
  79. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +0 -2
  80. package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +4 -4
  81. package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +4 -4
  82. package/dist/esm/api/resources/workflows/client/Client.mjs +22 -6
  83. package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
  84. package/dist/esm/core/auth/AuthProvider.mjs +6 -1
  85. package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
  86. package/dist/esm/core/auth/BasicAuth.mjs +7 -1
  87. package/dist/esm/core/auth/index.d.mts +1 -1
  88. package/dist/esm/core/auth/index.mjs +1 -0
  89. package/dist/esm/core/fetcher/Fetcher.d.mts +8 -0
  90. package/dist/esm/core/fetcher/Fetcher.mjs +13 -8
  91. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
  92. package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
  93. package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
  94. package/dist/esm/core/url/index.d.mts +1 -0
  95. package/dist/esm/core/url/index.mjs +1 -0
  96. package/dist/esm/core/url/qs.d.mts +2 -1
  97. package/dist/esm/core/url/qs.mjs +24 -12
  98. package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
  99. package/dist/esm/errors/phenomlError.d.mts +3 -1
  100. package/dist/esm/errors/phenomlError.mjs +4 -1
  101. package/dist/esm/errors/phenomlTimeoutError.d.mts +4 -1
  102. package/dist/esm/errors/phenomlTimeoutError.mjs +4 -1
  103. package/dist/esm/version.d.mts +1 -1
  104. package/dist/esm/version.mjs +1 -1
  105. package/package.json +2 -2
  106. package/reference.md +11 -3
@@ -55,7 +55,7 @@ export class ConstrueClient {
55
55
  method: "POST",
56
56
  headers: _headers,
57
57
  contentType: "application/json",
58
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
58
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
59
59
  requestType: "json",
60
60
  body: request,
61
61
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -128,7 +128,7 @@ export class ConstrueClient {
128
128
  method: "POST",
129
129
  headers: _headers,
130
130
  contentType: "application/json",
131
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
131
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
132
132
  requestType: "json",
133
133
  body: request,
134
134
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -188,7 +188,7 @@ export class ConstrueClient {
188
188
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "construe/codes/systems"),
189
189
  method: "GET",
190
190
  headers: _headers,
191
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
191
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
192
192
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
193
193
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
194
194
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -251,7 +251,11 @@ export class ConstrueClient {
251
251
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/systems/${core.url.encodePathParam(codesystem)}`),
252
252
  method: "GET",
253
253
  headers: _headers,
254
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
254
+ queryString: core.url
255
+ .queryBuilder()
256
+ .addMany(_queryParams)
257
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
258
+ .build(),
255
259
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
256
260
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
257
261
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -320,7 +324,11 @@ export class ConstrueClient {
320
324
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/systems/${core.url.encodePathParam(codesystem)}`),
321
325
  method: "DELETE",
322
326
  headers: _headers,
323
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
327
+ queryString: core.url
328
+ .queryBuilder()
329
+ .addMany(_queryParams)
330
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
331
+ .build(),
324
332
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
325
333
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
326
334
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -394,7 +402,11 @@ export class ConstrueClient {
394
402
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/systems/${core.url.encodePathParam(codesystem)}/export`),
395
403
  method: "GET",
396
404
  headers: _headers,
397
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
405
+ queryString: core.url
406
+ .queryBuilder()
407
+ .addMany(_queryParams)
408
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
409
+ .build(),
398
410
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
399
411
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
400
412
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -473,7 +485,11 @@ export class ConstrueClient {
473
485
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}`),
474
486
  method: "GET",
475
487
  headers: _headers,
476
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
488
+ queryString: core.url
489
+ .queryBuilder()
490
+ .addMany(_queryParams)
491
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
492
+ .build(),
477
493
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
478
494
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
479
495
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -540,7 +556,11 @@ export class ConstrueClient {
540
556
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}/${core.url.encodePathParam(codeID)}`),
541
557
  method: "GET",
542
558
  headers: _headers,
543
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
559
+ queryString: core.url
560
+ .queryBuilder()
561
+ .addMany(_queryParams)
562
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
563
+ .build(),
544
564
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
545
565
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
546
566
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -626,7 +646,11 @@ export class ConstrueClient {
626
646
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}/search/semantic`),
627
647
  method: "GET",
628
648
  headers: _headers,
629
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
649
+ queryString: core.url
650
+ .queryBuilder()
651
+ .addMany(_queryParams)
652
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
653
+ .build(),
630
654
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
631
655
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
632
656
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -706,7 +730,7 @@ export class ConstrueClient {
706
730
  method: "POST",
707
731
  headers: _headers,
708
732
  contentType: "application/json",
709
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
733
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
710
734
  requestType: "json",
711
735
  body: request,
712
736
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -800,7 +824,11 @@ export class ConstrueClient {
800
824
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `construe/codes/${core.url.encodePathParam(codesystem)}/search/text`),
801
825
  method: "GET",
802
826
  headers: _headers,
803
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
827
+ queryString: core.url
828
+ .queryBuilder()
829
+ .addMany(_queryParams)
830
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
831
+ .build(),
804
832
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
805
833
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
806
834
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -69,7 +69,11 @@ export class FhirClient {
69
69
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `fhir-provider/${core.url.encodePathParam(fhir_provider_id)}/fhir/${core.url.encodePathParam(fhir_path)}`),
70
70
  method: "GET",
71
71
  headers: _headers,
72
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
72
+ queryString: core.url
73
+ .queryBuilder()
74
+ .addMany(_queryParams)
75
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
76
+ .build(),
73
77
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
74
78
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
75
79
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -155,7 +159,7 @@ export class FhirClient {
155
159
  method: "POST",
156
160
  headers: _headers,
157
161
  contentType: "application/fhir+json",
158
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
162
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
159
163
  requestType: "json",
160
164
  body: _body,
161
165
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -242,7 +246,7 @@ export class FhirClient {
242
246
  method: "PUT",
243
247
  headers: _headers,
244
248
  contentType: "application/fhir+json",
245
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
249
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
246
250
  requestType: "json",
247
251
  body: _body,
248
252
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -325,7 +329,7 @@ export class FhirClient {
325
329
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `fhir-provider/${core.url.encodePathParam(fhir_provider_id)}/fhir/${core.url.encodePathParam(fhir_path)}`),
326
330
  method: "DELETE",
327
331
  headers: _headers,
328
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
332
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
329
333
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
330
334
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
331
335
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -470,7 +474,7 @@ export class FhirClient {
470
474
  method: "PATCH",
471
475
  headers: _headers,
472
476
  contentType: "application/json-patch+json",
473
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
477
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
474
478
  requestType: "json",
475
479
  body: _body,
476
480
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -584,7 +588,7 @@ export class FhirClient {
584
588
  method: "POST",
585
589
  headers: _headers,
586
590
  contentType: "application/fhir+json",
587
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
591
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
588
592
  requestType: "json",
589
593
  body: _body,
590
594
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -56,7 +56,7 @@ export class FhirProviderClient {
56
56
  method: "POST",
57
57
  headers: _headers,
58
58
  contentType: "application/json",
59
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
59
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
60
60
  requestType: "json",
61
61
  body: request,
62
62
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -118,7 +118,7 @@ export class FhirProviderClient {
118
118
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "fhir-provider/list"),
119
119
  method: "GET",
120
120
  headers: _headers,
121
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
121
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
122
122
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
123
123
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
124
124
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -176,7 +176,7 @@ export class FhirProviderClient {
176
176
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `fhir-provider/${core.url.encodePathParam(fhir_provider_id)}`),
177
177
  method: "GET",
178
178
  headers: _headers,
179
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
179
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
180
180
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
181
181
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
182
182
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -236,7 +236,7 @@ export class FhirProviderClient {
236
236
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `fhir-provider/${core.url.encodePathParam(fhir_provider_id)}`),
237
237
  method: "DELETE",
238
238
  headers: _headers,
239
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
239
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
240
240
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
241
241
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
242
242
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -305,7 +305,7 @@ export class FhirProviderClient {
305
305
  method: "PATCH",
306
306
  headers: _headers,
307
307
  contentType: "application/json",
308
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
308
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
309
309
  requestType: "json",
310
310
  body: request,
311
311
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -380,7 +380,7 @@ export class FhirProviderClient {
380
380
  method: "PATCH",
381
381
  headers: _headers,
382
382
  contentType: "application/json",
383
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
383
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
384
384
  requestType: "json",
385
385
  body: request,
386
386
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -452,7 +452,7 @@ export class FhirProviderClient {
452
452
  method: "PATCH",
453
453
  headers: _headers,
454
454
  contentType: "application/json",
455
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
455
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
456
456
  requestType: "json",
457
457
  body: request,
458
458
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -11,7 +11,9 @@ export declare class Lang2FhirClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<Lang2FhirClient.Options>;
12
12
  constructor(options?: Lang2FhirClient.Options);
13
13
  /**
14
- * Converts natural language text into a structured FHIR resource
14
+ * Converts natural language text into a structured FHIR resource.
15
+ *
16
+ * **Patient identifier handling.** When generating a `patient` (or `patient-canvas`) resource, US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the resource remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
15
17
  *
16
18
  * @param {phenoml.lang2Fhir.CreateRequest} request
17
19
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -34,6 +36,8 @@ export declare class Lang2FhirClient {
34
36
  * Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text.
35
37
  * Resources are linked with proper references (e.g., Conditions reference the Patient).
36
38
  *
39
+ * **Patient identifier handling.** US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the bundle remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
40
+ *
37
41
  * @param {phenoml.lang2Fhir.CreateMultiRequest} request
38
42
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
39
43
  *
@@ -101,7 +105,9 @@ export declare class Lang2FhirClient {
101
105
  uploadProfile(request: phenoml.lang2Fhir.ProfileUploadRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.Lang2FhirUploadProfileResponse>;
102
106
  private __uploadProfile;
103
107
  /**
104
- * Extracts text from a document (PDF or image) and converts it into a structured FHIR resource
108
+ * Extracts text from a document (PDF or image) and converts it into a structured FHIR resource.
109
+ *
110
+ * **Patient identifier handling.** When generating a `patient` (or `patient-canvas`) resource, US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the resource remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
105
111
  *
106
112
  * @param {phenoml.lang2Fhir.DocumentRequest} request
107
113
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -125,6 +131,8 @@ export declare class Lang2FhirClient {
125
131
  * Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types.
126
132
  * Resources are linked with proper references (e.g., Conditions reference the Patient).
127
133
  *
134
+ * **Patient identifier handling.** US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the bundle remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
135
+ *
128
136
  * @param {phenoml.lang2Fhir.DocumentMultiRequest} request
129
137
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
130
138
  *
@@ -139,6 +147,6 @@ export declare class Lang2FhirClient {
139
147
  * content: "content"
140
148
  * })
141
149
  */
142
- extractMultipleFhirResourcesFromADocument(request: phenoml.lang2Fhir.DocumentMultiRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.CreateMultiResponse>;
150
+ extractMultipleFhirResourcesFromADocument(request: phenoml.lang2Fhir.DocumentMultiRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.DocumentMultiResponse>;
143
151
  private __extractMultipleFhirResourcesFromADocument;
144
152
  }
@@ -20,7 +20,9 @@ export class Lang2FhirClient {
20
20
  this._options = normalizeClientOptionsWithAuth(options);
21
21
  }
22
22
  /**
23
- * Converts natural language text into a structured FHIR resource
23
+ * Converts natural language text into a structured FHIR resource.
24
+ *
25
+ * **Patient identifier handling.** When generating a `patient` (or `patient-canvas`) resource, US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the resource remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
24
26
  *
25
27
  * @param {phenoml.lang2Fhir.CreateRequest} request
26
28
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -49,7 +51,7 @@ export class Lang2FhirClient {
49
51
  method: "POST",
50
52
  headers: _headers,
51
53
  contentType: "application/json",
52
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
54
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
53
55
  requestType: "json",
54
56
  body: request,
55
57
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -85,6 +87,8 @@ export class Lang2FhirClient {
85
87
  * Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text.
86
88
  * Resources are linked with proper references (e.g., Conditions reference the Patient).
87
89
  *
90
+ * **Patient identifier handling.** US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the bundle remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
91
+ *
88
92
  * @param {phenoml.lang2Fhir.CreateMultiRequest} request
89
93
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
90
94
  *
@@ -110,7 +114,7 @@ export class Lang2FhirClient {
110
114
  method: "POST",
111
115
  headers: _headers,
112
116
  contentType: "application/json",
113
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
117
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
114
118
  requestType: "json",
115
119
  body: request,
116
120
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -180,7 +184,7 @@ export class Lang2FhirClient {
180
184
  method: "POST",
181
185
  headers: _headers,
182
186
  contentType: "application/json",
183
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
187
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
184
188
  requestType: "json",
185
189
  body: request,
186
190
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -251,7 +255,7 @@ export class Lang2FhirClient {
251
255
  method: "POST",
252
256
  headers: _headers,
253
257
  contentType: "application/json",
254
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
258
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
255
259
  requestType: "json",
256
260
  body: request,
257
261
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -288,7 +292,9 @@ export class Lang2FhirClient {
288
292
  });
289
293
  }
290
294
  /**
291
- * Extracts text from a document (PDF or image) and converts it into a structured FHIR resource
295
+ * Extracts text from a document (PDF or image) and converts it into a structured FHIR resource.
296
+ *
297
+ * **Patient identifier handling.** When generating a `patient` (or `patient-canvas`) resource, US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the resource remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
292
298
  *
293
299
  * @param {phenoml.lang2Fhir.DocumentRequest} request
294
300
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -317,7 +323,7 @@ export class Lang2FhirClient {
317
323
  method: "POST",
318
324
  headers: _headers,
319
325
  contentType: "application/json",
320
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
326
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
321
327
  requestType: "json",
322
328
  body: request,
323
329
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -354,6 +360,8 @@ export class Lang2FhirClient {
354
360
  * Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types.
355
361
  * Resources are linked with proper references (e.g., Conditions reference the Patient).
356
362
  *
363
+ * **Patient identifier handling.** US Core requires `Patient.identifier` (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with `system: "urn:phenoml:lang2fhir-generated-id"` and a UUID `value` so the bundle remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
364
+ *
357
365
  * @param {phenoml.lang2Fhir.DocumentMultiRequest} request
358
366
  * @param {Lang2FhirClient.RequestOptions} requestOptions - Request-specific configuration.
359
367
  *
@@ -381,7 +389,7 @@ export class Lang2FhirClient {
381
389
  method: "POST",
382
390
  headers: _headers,
383
391
  contentType: "application/json",
384
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
392
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
385
393
  requestType: "json",
386
394
  body: request,
387
395
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -1,3 +1,4 @@
1
+ import type * as phenoml from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -22,6 +23,7 @@ export interface DocumentMultiRequest {
22
23
  detection_effort?: DocumentMultiRequest.DetectionEffort;
23
24
  /** FHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips. */
24
25
  validation_method?: DocumentMultiRequest.ValidationMethod;
26
+ config?: phenoml.lang2Fhir.DocumentConfig;
25
27
  }
26
28
  export declare namespace DocumentMultiRequest {
27
29
  /** Detection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall. */
@@ -1,3 +1,4 @@
1
+ import type * as phenoml from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -17,4 +18,5 @@ export interface DocumentRequest {
17
18
  * File type is auto-detected from content magic bytes.
18
19
  */
19
20
  content: string;
21
+ config?: phenoml.lang2Fhir.DocumentConfig;
20
22
  }
@@ -42,8 +42,10 @@ export declare namespace CreateMultiResponse {
42
42
  tempId?: string | undefined;
43
43
  /** FHIR resource type */
44
44
  resourceType?: string | undefined;
45
- /** Text excerpt this resource was extracted from */
45
+ /** Context-enriched rewritten text excerpt for this resource */
46
46
  description?: string | undefined;
47
+ /** Verbatim text excerpt from the original clinical document */
48
+ originalText?: string | undefined;
47
49
  }
48
50
  }
49
51
  /**
@@ -0,0 +1,7 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ /**
3
+ * Optional processing configuration shared across document endpoints.
4
+ */
5
+ export interface DocumentConfig {
6
+ page_filter?: phenoml.lang2Fhir.PageFilter | undefined;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export interface DocumentMultiResponse extends phenoml.lang2Fhir.CreateMultiResponse {
3
+ /** Per-page classifier decisions. Populated only when a page_filter was supplied in the request. Contains one entry per input page, including both kept and dropped pages. */
4
+ page_classifications?: phenoml.lang2Fhir.PageClassification[] | undefined;
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The classifier's decision for a single page of the input document.
3
+ */
4
+ export interface PageClassification {
5
+ /** 1-indexed page number. */
6
+ page_number?: number | undefined;
7
+ /** Whether the page was kept (true) or dropped (false) from FHIR extraction. */
8
+ include?: boolean | undefined;
9
+ /** Short LLM-generated explanation of the decision. */
10
+ reason?: string | undefined;
11
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Configures per-page pre-extraction filtering. When set, each page of text extracted from the document is classified by an LLM, and pages classified as irrelevant to the supplied context are dropped before FHIR extraction.
3
+ */
4
+ export interface PageFilter {
5
+ /** Natural-language description of what IS relevant to the extraction goal. Pages that do not match are dropped from downstream FHIR extraction. */
6
+ context: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,4 +1,8 @@
1
1
  export * from "./CreateMultiResponse.mjs";
2
+ export * from "./DocumentConfig.mjs";
3
+ export * from "./DocumentMultiResponse.mjs";
2
4
  export * from "./FhirResource.mjs";
3
5
  export * from "./Lang2FhirUploadProfileResponse.mjs";
6
+ export * from "./PageClassification.mjs";
7
+ export * from "./PageFilter.mjs";
4
8
  export * from "./SearchResponse.mjs";
@@ -1,4 +1,8 @@
1
1
  export * from "./CreateMultiResponse.mjs";
2
+ export * from "./DocumentConfig.mjs";
3
+ export * from "./DocumentMultiResponse.mjs";
2
4
  export * from "./FhirResource.mjs";
3
5
  export * from "./Lang2FhirUploadProfileResponse.mjs";
6
+ export * from "./PageClassification.mjs";
7
+ export * from "./PageFilter.mjs";
4
8
  export * from "./SearchResponse.mjs";
@@ -42,7 +42,7 @@ export class SummaryClient {
42
42
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, "fhir2summary/templates"),
43
43
  method: "GET",
44
44
  headers: _headers,
45
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
45
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
46
46
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
47
47
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
48
48
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -103,7 +103,7 @@ export class SummaryClient {
103
103
  method: "POST",
104
104
  headers: _headers,
105
105
  contentType: "application/json",
106
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
106
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
107
107
  requestType: "json",
108
108
  body: request,
109
109
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -163,7 +163,7 @@ export class SummaryClient {
163
163
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `fhir2summary/template/${core.url.encodePathParam(id)}`),
164
164
  method: "GET",
165
165
  headers: _headers,
166
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
166
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
167
167
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
168
168
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
169
169
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -231,7 +231,7 @@ export class SummaryClient {
231
231
  method: "PUT",
232
232
  headers: _headers,
233
233
  contentType: "application/json",
234
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
234
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
235
235
  requestType: "json",
236
236
  body: request,
237
237
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
@@ -295,7 +295,7 @@ export class SummaryClient {
295
295
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.phenomlEnvironment.Default, `fhir2summary/template/${core.url.encodePathParam(id)}`),
296
296
  method: "DELETE",
297
297
  headers: _headers,
298
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
298
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
299
299
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
300
300
  maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
301
301
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -364,7 +364,7 @@ export class SummaryClient {
364
364
  method: "POST",
365
365
  headers: _headers,
366
366
  contentType: "application/json",
367
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
367
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
368
368
  requestType: "json",
369
369
  body: request,
370
370
  timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,