phenoml 5.2.0 → 6.0.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 (74) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/agent/types/ChatMessageTemplate.d.ts +0 -2
  3. package/dist/cjs/api/resources/agent/types/ChatSessionTemplate.d.ts +0 -2
  4. package/dist/cjs/api/resources/construe/client/Client.d.ts +31 -8
  5. package/dist/cjs/api/resources/construe/client/Client.js +103 -12
  6. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemExportRequest.d.ts +10 -0
  7. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +55 -0
  8. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.js +12 -0
  9. package/dist/cjs/api/resources/construe/client/requests/index.d.ts +2 -0
  10. package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.d.ts +5 -0
  11. package/dist/cjs/api/resources/construe/errors/GatewayTimeoutError.js +50 -0
  12. package/dist/cjs/api/resources/construe/errors/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/construe/errors/index.js +1 -0
  14. package/dist/cjs/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.ts +2 -0
  15. package/dist/cjs/api/resources/construe/types/ExportCodeSystemResponse.d.ts +11 -0
  16. package/dist/cjs/api/resources/construe/types/ExtractedCodeResult.d.ts +1 -3
  17. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.d.ts +4 -4
  18. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.js +2 -2
  19. package/dist/cjs/api/resources/construe/types/index.d.ts +1 -3
  20. package/dist/cjs/api/resources/construe/types/index.js +1 -3
  21. package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +0 -1
  22. package/dist/cjs/api/resources/fhirProvider/client/Client.js +0 -3
  23. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +0 -2
  24. package/dist/cjs/api/resources/summary/types/SummaryTemplate.d.ts +0 -1
  25. package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +0 -2
  26. package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +0 -2
  27. package/dist/cjs/api/resources/workflows/types/WorkflowDefinition.d.ts +0 -2
  28. package/dist/cjs/api/resources/workflows/types/WorkflowResponse.d.ts +0 -2
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/esm/Client.mjs +2 -2
  32. package/dist/esm/api/resources/agent/types/ChatMessageTemplate.d.mts +0 -2
  33. package/dist/esm/api/resources/agent/types/ChatSessionTemplate.d.mts +0 -2
  34. package/dist/esm/api/resources/construe/client/Client.d.mts +31 -8
  35. package/dist/esm/api/resources/construe/client/Client.mjs +103 -12
  36. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemExportRequest.d.mts +10 -0
  37. package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +55 -0
  38. package/dist/esm/api/resources/construe/client/requests/UploadRequest.mjs +9 -0
  39. package/dist/esm/api/resources/construe/client/requests/index.d.mts +2 -0
  40. package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.d.mts +5 -0
  41. package/dist/esm/api/resources/construe/errors/GatewayTimeoutError.mjs +13 -0
  42. package/dist/esm/api/resources/construe/errors/index.d.mts +1 -0
  43. package/dist/esm/api/resources/construe/errors/index.mjs +1 -0
  44. package/dist/esm/api/resources/construe/types/ConstrueUploadCodeSystemResponse.d.mts +2 -0
  45. package/dist/esm/api/resources/construe/types/ExportCodeSystemResponse.d.mts +11 -0
  46. package/dist/esm/api/resources/construe/types/ExtractedCodeResult.d.mts +1 -3
  47. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.d.mts +4 -4
  48. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.mjs +2 -2
  49. package/dist/esm/api/resources/construe/types/index.d.mts +1 -3
  50. package/dist/esm/api/resources/construe/types/index.mjs +1 -3
  51. package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +0 -1
  52. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +0 -3
  53. package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +0 -2
  54. package/dist/esm/api/resources/summary/types/SummaryTemplate.d.mts +0 -1
  55. package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +0 -2
  56. package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +0 -2
  57. package/dist/esm/api/resources/workflows/types/WorkflowDefinition.d.mts +0 -2
  58. package/dist/esm/api/resources/workflows/types/WorkflowResponse.d.mts +0 -2
  59. package/dist/esm/version.d.mts +1 -1
  60. package/dist/esm/version.mjs +1 -1
  61. package/package.json +1 -1
  62. package/reference.md +80 -7
  63. package/dist/cjs/api/resources/construe/types/UploadRequest.d.ts +0 -10
  64. package/dist/cjs/api/resources/construe/types/UploadRequestCsv.d.ts +0 -32
  65. package/dist/cjs/api/resources/construe/types/UploadRequestJson.d.ts +0 -40
  66. package/dist/cjs/api/resources/construe/types/UploadRequestJson.js +0 -3
  67. package/dist/esm/api/resources/construe/types/UploadRequest.d.mts +0 -10
  68. package/dist/esm/api/resources/construe/types/UploadRequestCsv.d.mts +0 -32
  69. package/dist/esm/api/resources/construe/types/UploadRequestJson.d.mts +0 -40
  70. package/dist/esm/api/resources/construe/types/UploadRequestJson.mjs +0 -2
  71. /package/dist/cjs/api/resources/construe/{types/UploadRequest.js → client/requests/GetConstrueCodesSystemsCodesystemExportRequest.js} +0 -0
  72. /package/dist/cjs/api/resources/construe/types/{UploadRequestCsv.js → ExportCodeSystemResponse.js} +0 -0
  73. /package/dist/esm/api/resources/construe/{types/UploadRequest.mjs → client/requests/GetConstrueCodesSystemsCodesystemExportRequest.mjs} +0 -0
  74. /package/dist/esm/api/resources/construe/types/{UploadRequestCsv.mjs → ExportCodeSystemResponse.mjs} +0 -0
@@ -52,8 +52,8 @@ class phenomlClient {
52
52
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
53
53
  "X-Fern-Language": "JavaScript",
54
54
  "X-Fern-SDK-Name": "phenoml",
55
- "X-Fern-SDK-Version": "5.2.0",
56
- "User-Agent": "phenoml/5.2.0",
55
+ "X-Fern-SDK-Version": "6.0.0",
56
+ "User-Agent": "phenoml/auto",
57
57
  "X-Fern-Runtime": core.RUNTIME.type,
58
58
  "X-Fern-Runtime-Version": core.RUNTIME.version,
59
59
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -17,8 +17,6 @@ export interface ChatMessageTemplate {
17
17
  created?: string;
18
18
  /** Message updated time */
19
19
  updated?: string;
20
- /** User ID */
21
- user_id?: string;
22
20
  /** Function name */
23
21
  function_name?: string;
24
22
  /** Function arguments */
@@ -1,8 +1,6 @@
1
1
  export interface ChatSessionTemplate {
2
2
  /** Chat session ID */
3
3
  id?: string;
4
- /** User ID */
5
- user_id?: string;
6
4
  /** Chat session ID */
7
5
  session_id?: string;
8
6
  /** Chat session status */
@@ -12,8 +12,9 @@ export declare class Construe {
12
12
  constructor(_options: Construe.Options);
13
13
  /**
14
14
  * Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
15
- * Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
16
- * subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
15
+ * Returns 202 immediately; embedding generation runs asynchronously. Poll
16
+ * GET /construe/codes/systems/{codesystem}?version={version} to check when status
17
+ * transitions from "processing" to "ready" or "failed".
17
18
  *
18
19
  * @param {phenoml.construe.UploadRequest} request
19
20
  * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
@@ -27,12 +28,9 @@ export declare class Construe {
27
28
  *
28
29
  * @example
29
30
  * await client.construe.uploadCodeSystem({
30
- * format: "csv",
31
31
  * name: "CUSTOM_CODES",
32
32
  * version: "1.0",
33
- * file: "file",
34
- * code_col: "code",
35
- * desc_col: "description"
33
+ * format: "csv"
36
34
  * })
37
35
  */
38
36
  uploadCodeSystem(request: phenoml.construe.UploadRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ConstrueUploadCodeSystemResponse>;
@@ -47,8 +45,10 @@ export declare class Construe {
47
45
  *
48
46
  * @throws {@link phenoml.construe.BadRequestError}
49
47
  * @throws {@link phenoml.construe.UnauthorizedError}
50
- * @throws {@link phenoml.construe.FailedDependencyError}
48
+ * @throws {@link phenoml.construe.NotFoundError}
51
49
  * @throws {@link phenoml.construe.InternalServerError}
50
+ * @throws {@link phenoml.construe.ServiceUnavailableError}
51
+ * @throws {@link phenoml.construe.GatewayTimeoutError}
52
52
  *
53
53
  * @example
54
54
  * await client.construe.extractCodes({
@@ -110,6 +110,30 @@ export declare class Construe {
110
110
  */
111
111
  deleteCustomCodeSystem(codesystem: string, request?: phenoml.construe.DeleteConstrueCodesSystemsCodesystemRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.DeleteCodeSystemResponse>;
112
112
  private __deleteCustomCodeSystem;
113
+ /**
114
+ * Exports a custom (non-builtin) code system as a JSON file compatible with the upload format.
115
+ * The exported file can be re-uploaded directly via POST /construe/upload with format "json".
116
+ * Only available on dedicated instances. Builtin systems cannot be exported.
117
+ *
118
+ * @param {string} codesystem - Code system name
119
+ * @param {phenoml.construe.GetConstrueCodesSystemsCodesystemExportRequest} request
120
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
121
+ *
122
+ * @throws {@link phenoml.construe.BadRequestError}
123
+ * @throws {@link phenoml.construe.UnauthorizedError}
124
+ * @throws {@link phenoml.construe.ForbiddenError}
125
+ * @throws {@link phenoml.construe.NotFoundError}
126
+ * @throws {@link phenoml.construe.ConflictError}
127
+ * @throws {@link phenoml.construe.FailedDependencyError}
128
+ * @throws {@link phenoml.construe.InternalServerError}
129
+ *
130
+ * @example
131
+ * await client.construe.exportCustomCodeSystem("CUSTOM_CODES", {
132
+ * version: "version"
133
+ * })
134
+ */
135
+ exportCustomCodeSystem(codesystem: string, request?: phenoml.construe.GetConstrueCodesSystemsCodesystemExportRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ExportCodeSystemResponse>;
136
+ private __exportCustomCodeSystem;
113
137
  /**
114
138
  * Returns a paginated list of all codes in the specified code system from the terminology server.
115
139
  *
@@ -229,7 +253,6 @@ export declare class Construe {
229
253
  * @throws {@link phenoml.construe.NotFoundError}
230
254
  * @throws {@link phenoml.construe.InternalServerError}
231
255
  * @throws {@link phenoml.construe.NotImplementedError}
232
- * @throws {@link phenoml.construe.ServiceUnavailableError}
233
256
  *
234
257
  * @example
235
258
  * await client.construe.terminologyServerTextSearch("ICD-10-CM", {
@@ -55,8 +55,9 @@ class Construe {
55
55
  }
56
56
  /**
57
57
  * Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
58
- * Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
59
- * subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
58
+ * Returns 202 immediately; embedding generation runs asynchronously. Poll
59
+ * GET /construe/codes/systems/{codesystem}?version={version} to check when status
60
+ * transitions from "processing" to "ready" or "failed".
60
61
  *
61
62
  * @param {phenoml.construe.UploadRequest} request
62
63
  * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
@@ -70,12 +71,9 @@ class Construe {
70
71
  *
71
72
  * @example
72
73
  * await client.construe.uploadCodeSystem({
73
- * format: "csv",
74
74
  * name: "CUSTOM_CODES",
75
75
  * version: "1.0",
76
- * file: "file",
77
- * code_col: "code",
78
- * desc_col: "description"
76
+ * format: "csv"
79
77
  * })
80
78
  */
81
79
  uploadCodeSystem(request, requestOptions) {
@@ -152,8 +150,10 @@ class Construe {
152
150
  *
153
151
  * @throws {@link phenoml.construe.BadRequestError}
154
152
  * @throws {@link phenoml.construe.UnauthorizedError}
155
- * @throws {@link phenoml.construe.FailedDependencyError}
153
+ * @throws {@link phenoml.construe.NotFoundError}
156
154
  * @throws {@link phenoml.construe.InternalServerError}
155
+ * @throws {@link phenoml.construe.ServiceUnavailableError}
156
+ * @throws {@link phenoml.construe.GatewayTimeoutError}
157
157
  *
158
158
  * @example
159
159
  * await client.construe.extractCodes({
@@ -188,10 +188,14 @@ class Construe {
188
188
  throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
189
189
  case 401:
190
190
  throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
191
- case 424:
192
- throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
191
+ case 404:
192
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
193
193
  case 500:
194
194
  throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
195
+ case 503:
196
+ throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
197
+ case 504:
198
+ throw new phenoml.construe.GatewayTimeoutError(_response.error.body, _response.rawResponse);
195
199
  default:
196
200
  throw new errors.phenomlError({
197
201
  statusCode: _response.error.statusCode,
@@ -443,6 +447,96 @@ class Construe {
443
447
  }
444
448
  });
445
449
  }
450
+ /**
451
+ * Exports a custom (non-builtin) code system as a JSON file compatible with the upload format.
452
+ * The exported file can be re-uploaded directly via POST /construe/upload with format "json".
453
+ * Only available on dedicated instances. Builtin systems cannot be exported.
454
+ *
455
+ * @param {string} codesystem - Code system name
456
+ * @param {phenoml.construe.GetConstrueCodesSystemsCodesystemExportRequest} request
457
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
458
+ *
459
+ * @throws {@link phenoml.construe.BadRequestError}
460
+ * @throws {@link phenoml.construe.UnauthorizedError}
461
+ * @throws {@link phenoml.construe.ForbiddenError}
462
+ * @throws {@link phenoml.construe.NotFoundError}
463
+ * @throws {@link phenoml.construe.ConflictError}
464
+ * @throws {@link phenoml.construe.FailedDependencyError}
465
+ * @throws {@link phenoml.construe.InternalServerError}
466
+ *
467
+ * @example
468
+ * await client.construe.exportCustomCodeSystem("CUSTOM_CODES", {
469
+ * version: "version"
470
+ * })
471
+ */
472
+ exportCustomCodeSystem(codesystem, request = {}, requestOptions) {
473
+ return core.HttpResponsePromise.fromPromise(this.__exportCustomCodeSystem(codesystem, request, requestOptions));
474
+ }
475
+ __exportCustomCodeSystem(codesystem_1) {
476
+ return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
477
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
478
+ const { version } = request;
479
+ const _queryParams = {};
480
+ if (version != null) {
481
+ _queryParams.version = version;
482
+ }
483
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
484
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
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/systems/${core.url.encodePathParam(codesystem)}/export`),
486
+ method: "GET",
487
+ headers: _headers,
488
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
489
+ 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,
490
+ 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,
491
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
492
+ });
493
+ if (_response.ok) {
494
+ return {
495
+ data: _response.body,
496
+ rawResponse: _response.rawResponse,
497
+ };
498
+ }
499
+ if (_response.error.reason === "status-code") {
500
+ switch (_response.error.statusCode) {
501
+ case 400:
502
+ throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
503
+ case 401:
504
+ throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
505
+ case 403:
506
+ throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
507
+ case 404:
508
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
509
+ case 409:
510
+ throw new phenoml.construe.ConflictError(_response.error.body, _response.rawResponse);
511
+ case 424:
512
+ throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
513
+ case 500:
514
+ throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
515
+ default:
516
+ throw new errors.phenomlError({
517
+ statusCode: _response.error.statusCode,
518
+ body: _response.error.body,
519
+ rawResponse: _response.rawResponse,
520
+ });
521
+ }
522
+ }
523
+ switch (_response.error.reason) {
524
+ case "non-json":
525
+ throw new errors.phenomlError({
526
+ statusCode: _response.error.statusCode,
527
+ body: _response.error.rawBody,
528
+ rawResponse: _response.rawResponse,
529
+ });
530
+ case "timeout":
531
+ throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /construe/codes/systems/{codesystem}/export.");
532
+ case "unknown":
533
+ throw new errors.phenomlError({
534
+ message: _response.error.errorMessage,
535
+ rawResponse: _response.rawResponse,
536
+ });
537
+ }
538
+ });
539
+ }
446
540
  /**
447
541
  * Returns a paginated list of all codes in the specified code system from the terminology server.
448
542
  *
@@ -746,7 +840,6 @@ class Construe {
746
840
  * @throws {@link phenoml.construe.NotFoundError}
747
841
  * @throws {@link phenoml.construe.InternalServerError}
748
842
  * @throws {@link phenoml.construe.NotImplementedError}
749
- * @throws {@link phenoml.construe.ServiceUnavailableError}
750
843
  *
751
844
  * @example
752
845
  * await client.construe.terminologyServerTextSearch("ICD-10-CM", {
@@ -795,8 +888,6 @@ class Construe {
795
888
  throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
796
889
  case 501:
797
890
  throw new phenoml.construe.NotImplementedError(_response.error.body, _response.rawResponse);
798
- case 503:
799
- throw new phenoml.construe.ServiceUnavailableError(_response.error.body, _response.rawResponse);
800
891
  default:
801
892
  throw new errors.phenomlError({
802
893
  statusCode: _response.error.statusCode,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * version: "version"
5
+ * }
6
+ */
7
+ export interface GetConstrueCodesSystemsCodesystemExportRequest {
8
+ /** Specific version of the code system. Required if multiple versions exist. */
9
+ version?: string;
10
+ }
@@ -0,0 +1,55 @@
1
+ import type * as phenoml from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * name: "CUSTOM_CODES",
6
+ * version: "1.0",
7
+ * format: "csv"
8
+ * }
9
+ */
10
+ export interface UploadRequest {
11
+ /**
12
+ * Name of the code system. Names are case-insensitive and stored uppercase.
13
+ * Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
14
+ * reserved and cannot be used for custom uploads; attempts return HTTP 403 Forbidden.
15
+ */
16
+ name: string;
17
+ /** Version of the code system */
18
+ version: string;
19
+ /** Optional revision number */
20
+ revision?: number;
21
+ /** Upload format */
22
+ format: UploadRequest.Format;
23
+ /**
24
+ * The file contents as a base64-encoded string.
25
+ * For CSV format, this is the CSV file contents.
26
+ * For JSON format, this is a base64-encoded JSON array; prefer using 'codes' instead.
27
+ */
28
+ file?: string;
29
+ /** Column name containing codes (required for CSV format) */
30
+ code_col?: string;
31
+ /** Column name containing descriptions (required for CSV format) */
32
+ desc_col?: string;
33
+ /** Optional column name containing long definitions (for CSV format) */
34
+ defn_col?: string;
35
+ /**
36
+ * The codes to upload as a JSON array (JSON format only).
37
+ * This is the preferred way to upload JSON codes, as it avoids unnecessary base64 encoding.
38
+ * If both 'codes' and 'file' are provided, 'codes' takes precedence.
39
+ */
40
+ codes?: phenoml.construe.CodeResponse[];
41
+ /**
42
+ * If true, replaces an existing code system with the same name and version.
43
+ * Builtin systems cannot be replaced; attempts to do so return HTTP 403 Forbidden.
44
+ * When false (default), uploading a duplicate returns 409 Conflict.
45
+ */
46
+ replace?: boolean;
47
+ }
48
+ export declare namespace UploadRequest {
49
+ /** Upload format */
50
+ const Format: {
51
+ readonly Csv: "csv";
52
+ readonly Json: "json";
53
+ };
54
+ type Format = (typeof Format)[keyof typeof Format];
55
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.UploadRequest = void 0;
5
+ var UploadRequest;
6
+ (function (UploadRequest) {
7
+ /** Upload format */
8
+ UploadRequest.Format = {
9
+ Csv: "csv",
10
+ Json: "json",
11
+ };
12
+ })(UploadRequest || (exports.UploadRequest = UploadRequest = {}));
@@ -4,4 +4,6 @@ export type { GetConstrueCodesCodesystemCodeIdRequest } from "./GetConstrueCodes
4
4
  export type { GetConstrueCodesCodesystemRequest } from "./GetConstrueCodesCodesystemRequest.js";
5
5
  export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConstrueCodesCodesystemSearchSemanticRequest.js";
6
6
  export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.js";
7
+ export type { GetConstrueCodesSystemsCodesystemExportRequest } from "./GetConstrueCodesSystemsCodesystemExportRequest.js";
7
8
  export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.js";
9
+ export type { UploadRequest } from "./UploadRequest.js";
@@ -0,0 +1,5 @@
1
+ import type * as core from "../../../../core/index.js";
2
+ import * as errors from "../../../../errors/index.js";
3
+ export declare class GatewayTimeoutError extends errors.phenomlError {
4
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
5
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.GatewayTimeoutError = void 0;
38
+ const errors = __importStar(require("../../../../errors/index.js"));
39
+ class GatewayTimeoutError extends errors.phenomlError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "GatewayTimeoutError",
43
+ statusCode: 504,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, GatewayTimeoutError.prototype);
48
+ }
49
+ }
50
+ exports.GatewayTimeoutError = GatewayTimeoutError;
@@ -2,6 +2,7 @@ export * from "./BadRequestError.js";
2
2
  export * from "./ConflictError.js";
3
3
  export * from "./FailedDependencyError.js";
4
4
  export * from "./ForbiddenError.js";
5
+ export * from "./GatewayTimeoutError.js";
5
6
  export * from "./InternalServerError.js";
6
7
  export * from "./NotFoundError.js";
7
8
  export * from "./NotImplementedError.js";
@@ -18,6 +18,7 @@ __exportStar(require("./BadRequestError.js"), exports);
18
18
  __exportStar(require("./ConflictError.js"), exports);
19
19
  __exportStar(require("./FailedDependencyError.js"), exports);
20
20
  __exportStar(require("./ForbiddenError.js"), exports);
21
+ __exportStar(require("./GatewayTimeoutError.js"), exports);
21
22
  __exportStar(require("./InternalServerError.js"), exports);
22
23
  __exportStar(require("./NotFoundError.js"), exports);
23
24
  __exportStar(require("./NotImplementedError.js"), exports);
@@ -1,3 +1,5 @@
1
1
  export interface ConstrueUploadCodeSystemResponse {
2
2
  status?: string;
3
+ name?: string;
4
+ version?: string;
3
5
  }
@@ -0,0 +1,11 @@
1
+ import type * as phenoml from "../../../index.js";
2
+ export interface ExportCodeSystemResponse {
3
+ /** Code system name */
4
+ name: string;
5
+ /** Code system version */
6
+ version: string;
7
+ /** Upload format (always "json") */
8
+ format: "json";
9
+ /** All codes in the system */
10
+ codes: phenoml.construe.CodeResponse[];
11
+ }
@@ -6,10 +6,8 @@ export interface ExtractedCodeResult {
6
6
  description: string;
7
7
  /** Whether the code passed validation. Always true unless include_invalid is set to true, in which case invalid codes will have this set to false. */
8
8
  valid: boolean;
9
- /** Long description of the code */
10
- longDescription?: string;
11
9
  /** Explanation for why this code was extracted (if include_rationale is true) */
12
- rationale?: string;
10
+ reason?: string;
13
11
  /**
14
12
  * Whether this code is an ancestor (parent) of an extracted code rather than directly extracted.
15
13
  * Only present when include_ancestors is true.
@@ -9,9 +9,9 @@ export interface GetCodeSystemDetailResponse {
9
9
  builtin: boolean;
10
10
  /**
11
11
  * Processing status of the code system.
12
- * - "processing": embeddings are being generated (async upload in progress)
12
+ * - "processing": embeddings are being generated
13
13
  * - "ready": code system is ready for use
14
- * - "failed": async processing failed (re-upload with replace=true to retry)
14
+ * - "failed": processing failed (re-upload with replace=true to retry)
15
15
  */
16
16
  status: GetCodeSystemDetailResponse.Status;
17
17
  /** When the code system was created */
@@ -22,9 +22,9 @@ export interface GetCodeSystemDetailResponse {
22
22
  export declare namespace GetCodeSystemDetailResponse {
23
23
  /**
24
24
  * Processing status of the code system.
25
- * - "processing": embeddings are being generated (async upload in progress)
25
+ * - "processing": embeddings are being generated
26
26
  * - "ready": code system is ready for use
27
- * - "failed": async processing failed (re-upload with replace=true to retry)
27
+ * - "failed": processing failed (re-upload with replace=true to retry)
28
28
  */
29
29
  const Status: {
30
30
  readonly Processing: "processing";
@@ -6,9 +6,9 @@ var GetCodeSystemDetailResponse;
6
6
  (function (GetCodeSystemDetailResponse) {
7
7
  /**
8
8
  * Processing status of the code system.
9
- * - "processing": embeddings are being generated (async upload in progress)
9
+ * - "processing": embeddings are being generated
10
10
  * - "ready": code system is ready for use
11
- * - "failed": async processing failed (re-upload with replace=true to retry)
11
+ * - "failed": processing failed (re-upload with replace=true to retry)
12
12
  */
13
13
  GetCodeSystemDetailResponse.Status = {
14
14
  Processing: "processing",
@@ -4,6 +4,7 @@ export * from "./CodeSystemDetails.js";
4
4
  export * from "./CodeSystemInfo.js";
5
5
  export * from "./ConstrueUploadCodeSystemResponse.js";
6
6
  export * from "./DeleteCodeSystemResponse.js";
7
+ export * from "./ExportCodeSystemResponse.js";
7
8
  export * from "./ExtractCodesResult.js";
8
9
  export * from "./ExtractedCodeResult.js";
9
10
  export * from "./ExtractRequestConfig.js";
@@ -16,6 +17,3 @@ export * from "./SemanticSearchResponse.js";
16
17
  export * from "./SemanticSearchResult.js";
17
18
  export * from "./TextSearchResponse.js";
18
19
  export * from "./TextSearchResult.js";
19
- export * from "./UploadRequest.js";
20
- export * from "./UploadRequestCsv.js";
21
- export * from "./UploadRequestJson.js";
@@ -20,6 +20,7 @@ __exportStar(require("./CodeSystemDetails.js"), exports);
20
20
  __exportStar(require("./CodeSystemInfo.js"), exports);
21
21
  __exportStar(require("./ConstrueUploadCodeSystemResponse.js"), exports);
22
22
  __exportStar(require("./DeleteCodeSystemResponse.js"), exports);
23
+ __exportStar(require("./ExportCodeSystemResponse.js"), exports);
23
24
  __exportStar(require("./ExtractCodesResult.js"), exports);
24
25
  __exportStar(require("./ExtractedCodeResult.js"), exports);
25
26
  __exportStar(require("./ExtractRequestConfig.js"), exports);
@@ -32,6 +33,3 @@ __exportStar(require("./SemanticSearchResponse.js"), exports);
32
33
  __exportStar(require("./SemanticSearchResult.js"), exports);
33
34
  __exportStar(require("./TextSearchResponse.js"), exports);
34
35
  __exportStar(require("./TextSearchResult.js"), exports);
35
- __exportStar(require("./UploadRequest.js"), exports);
36
- __exportStar(require("./UploadRequestCsv.js"), exports);
37
- __exportStar(require("./UploadRequestJson.js"), exports);
@@ -59,7 +59,6 @@ export declare class FhirProvider {
59
59
  * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
60
60
  *
61
61
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
62
- * @throws {@link phenoml.fhirProvider.ForbiddenError}
63
62
  * @throws {@link phenoml.fhirProvider.NotFoundError}
64
63
  * @throws {@link phenoml.fhirProvider.InternalServerError}
65
64
  *
@@ -211,7 +211,6 @@ class FhirProvider {
211
211
  * @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
212
212
  *
213
213
  * @throws {@link phenoml.fhirProvider.UnauthorizedError}
214
- * @throws {@link phenoml.fhirProvider.ForbiddenError}
215
214
  * @throws {@link phenoml.fhirProvider.NotFoundError}
216
215
  * @throws {@link phenoml.fhirProvider.InternalServerError}
217
216
  *
@@ -244,8 +243,6 @@ class FhirProvider {
244
243
  switch (_response.error.statusCode) {
245
244
  case 401:
246
245
  throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
247
- case 403:
248
- throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
249
246
  case 404:
250
247
  throw new phenoml.fhirProvider.NotFoundError(_response.error.body, _response.rawResponse);
251
248
  case 500:
@@ -2,8 +2,6 @@ import type * as phenoml from "../../../index.js";
2
2
  export interface FhirProviderTemplate {
3
3
  /** Unique identifier for the FHIR provider */
4
4
  id?: string;
5
- /** ID of the user who owns this FHIR provider */
6
- user_id?: string;
7
5
  /** Display name for the FHIR provider */
8
6
  name?: string;
9
7
  /** Optional description of the FHIR provider */
@@ -1,6 +1,5 @@
1
1
  export interface SummaryTemplate {
2
2
  id?: string;
3
- user_id?: string;
4
3
  name?: string;
5
4
  description?: string;
6
5
  /** Template with {{resource.field}} placeholders */
@@ -13,8 +13,6 @@ export declare namespace McpServerResponse {
13
13
  interface Data {
14
14
  /** ID of the MCP server */
15
15
  id?: string;
16
- /** ID of the user who created the MCP server */
17
- user_id?: string;
18
16
  /** Name of the MCP server */
19
17
  name?: string;
20
18
  /** Description of the MCP server */
@@ -13,8 +13,6 @@ export declare namespace McpServerToolResponse {
13
13
  interface Data {
14
14
  /** ID of the MCP server tool */
15
15
  id?: string;
16
- /** ID of the user who created the MCP server tool */
17
- user_id?: string;
18
16
  /** Name of the MCP server tool */
19
17
  name?: string;
20
18
  /** Description of the MCP server tool */
@@ -2,8 +2,6 @@ import type * as phenoml from "../../../index.js";
2
2
  export interface WorkflowDefinition {
3
3
  /** Unique identifier for the workflow */
4
4
  id?: string;
5
- /** ID of the user who created the workflow */
6
- user_id?: string;
7
5
  /** Human-readable name for the workflow */
8
6
  name?: string;
9
7
  /** Natural language instructions that define the workflow logic */
@@ -5,8 +5,6 @@ import type * as phenoml from "../../../index.js";
5
5
  export interface WorkflowResponse {
6
6
  /** Unique identifier for the workflow */
7
7
  id?: string;
8
- /** ID of the user who created the workflow */
9
- user_id?: string;
10
8
  /** Human-readable name for the workflow */
11
9
  name?: string;
12
10
  /** Natural language instructions that define the workflow logic */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.2.0";
1
+ export declare const SDK_VERSION = "6.0.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "5.2.0";
4
+ exports.SDK_VERSION = "6.0.0";