phenoml 5.0.0 → 5.2.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 (58) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/construe/client/Client.d.ts +51 -2
  3. package/dist/cjs/api/resources/construe/client/Client.js +175 -2
  4. package/dist/cjs/api/resources/construe/client/requests/DeleteConstrueCodesSystemsCodesystemRequest.d.ts +10 -0
  5. package/dist/cjs/api/resources/construe/client/requests/DeleteConstrueCodesSystemsCodesystemRequest.js +3 -0
  6. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemRequest.d.ts +10 -0
  7. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemRequest.js +3 -0
  8. package/dist/cjs/api/resources/construe/client/requests/index.d.ts +2 -1
  9. package/dist/cjs/api/resources/construe/errors/ForbiddenError.d.ts +5 -0
  10. package/dist/cjs/api/resources/construe/errors/ForbiddenError.js +50 -0
  11. package/dist/cjs/api/resources/construe/errors/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/construe/errors/index.js +1 -0
  13. package/dist/cjs/api/resources/construe/types/DeleteCodeSystemResponse.d.ts +4 -0
  14. package/dist/cjs/api/resources/construe/types/DeleteCodeSystemResponse.js +3 -0
  15. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.d.ts +35 -0
  16. package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.js +18 -0
  17. package/dist/cjs/api/resources/construe/types/UploadRequest.d.ts +10 -0
  18. package/dist/cjs/api/resources/construe/types/UploadRequest.js +3 -0
  19. package/dist/cjs/api/resources/construe/types/UploadRequestCsv.d.ts +32 -0
  20. package/dist/cjs/api/resources/construe/types/UploadRequestCsv.js +3 -0
  21. package/dist/cjs/api/resources/construe/types/UploadRequestJson.d.ts +40 -0
  22. package/dist/cjs/api/resources/construe/types/UploadRequestJson.js +3 -0
  23. package/dist/cjs/api/resources/construe/types/index.d.ts +5 -0
  24. package/dist/cjs/api/resources/construe/types/index.js +5 -0
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/Client.mjs +2 -2
  28. package/dist/esm/api/resources/construe/client/Client.d.mts +51 -2
  29. package/dist/esm/api/resources/construe/client/Client.mjs +175 -2
  30. package/dist/esm/api/resources/construe/client/requests/DeleteConstrueCodesSystemsCodesystemRequest.d.mts +10 -0
  31. package/dist/esm/api/resources/construe/client/requests/DeleteConstrueCodesSystemsCodesystemRequest.mjs +2 -0
  32. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemRequest.d.mts +10 -0
  33. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemRequest.mjs +2 -0
  34. package/dist/esm/api/resources/construe/client/requests/index.d.mts +2 -1
  35. package/dist/esm/api/resources/construe/errors/ForbiddenError.d.mts +5 -0
  36. package/dist/esm/api/resources/construe/errors/ForbiddenError.mjs +13 -0
  37. package/dist/esm/api/resources/construe/errors/index.d.mts +1 -0
  38. package/dist/esm/api/resources/construe/errors/index.mjs +1 -0
  39. package/dist/esm/api/resources/construe/types/DeleteCodeSystemResponse.d.mts +4 -0
  40. package/dist/esm/api/resources/construe/types/DeleteCodeSystemResponse.mjs +2 -0
  41. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.d.mts +35 -0
  42. package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.mjs +15 -0
  43. package/dist/esm/api/resources/construe/types/UploadRequest.d.mts +10 -0
  44. package/dist/esm/api/resources/construe/types/UploadRequest.mjs +2 -0
  45. package/dist/esm/api/resources/construe/types/UploadRequestCsv.d.mts +32 -0
  46. package/dist/esm/api/resources/construe/types/UploadRequestCsv.mjs +2 -0
  47. package/dist/esm/api/resources/construe/types/UploadRequestJson.d.mts +40 -0
  48. package/dist/esm/api/resources/construe/types/UploadRequestJson.mjs +2 -0
  49. package/dist/esm/api/resources/construe/types/index.d.mts +5 -0
  50. package/dist/esm/api/resources/construe/types/index.mjs +5 -0
  51. package/dist/esm/version.d.mts +1 -1
  52. package/dist/esm/version.mjs +1 -1
  53. package/package.json +1 -1
  54. package/reference.md +158 -3
  55. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +0 -35
  56. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.js +0 -12
  57. package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +0 -35
  58. package/dist/esm/api/resources/construe/client/requests/UploadRequest.mjs +0 -9
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.0.0";
1
+ export declare const SDK_VERSION = "5.2.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.0.0";
4
+ exports.SDK_VERSION = "5.2.0";
@@ -16,8 +16,8 @@ export class phenomlClient {
16
16
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
17
17
  "X-Fern-Language": "JavaScript",
18
18
  "X-Fern-SDK-Name": "phenoml",
19
- "X-Fern-SDK-Version": "5.0.0",
20
- "User-Agent": "phenoml/5.0.0",
19
+ "X-Fern-SDK-Version": "5.2.0",
20
+ "User-Agent": "phenoml/5.2.0",
21
21
  "X-Fern-Runtime": core.RUNTIME.type,
22
22
  "X-Fern-Runtime-Version": core.RUNTIME.version,
23
23
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -20,16 +20,19 @@ export declare class Construe {
20
20
  *
21
21
  * @throws {@link phenoml.construe.BadRequestError}
22
22
  * @throws {@link phenoml.construe.UnauthorizedError}
23
+ * @throws {@link phenoml.construe.ForbiddenError}
23
24
  * @throws {@link phenoml.construe.ConflictError}
24
25
  * @throws {@link phenoml.construe.FailedDependencyError}
25
26
  * @throws {@link phenoml.construe.InternalServerError}
26
27
  *
27
28
  * @example
28
29
  * await client.construe.uploadCodeSystem({
30
+ * format: "csv",
29
31
  * name: "CUSTOM_CODES",
30
32
  * version: "1.0",
31
- * format: "json",
32
- * file: "file"
33
+ * file: "file",
34
+ * code_col: "code",
35
+ * desc_col: "description"
33
36
  * })
34
37
  */
35
38
  uploadCodeSystem(request: phenoml.construe.UploadRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ConstrueUploadCodeSystemResponse>;
@@ -67,6 +70,46 @@ export declare class Construe {
67
70
  */
68
71
  listAvailableCodeSystems(requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ListCodeSystemsResponse>;
69
72
  private __listAvailableCodeSystems;
73
+ /**
74
+ * Returns full metadata for a single code system, including timestamps and builtin status.
75
+ *
76
+ * @param {string} codesystem - Code system name (e.g., "ICD-10-CM", "SNOMED_CT_US_LITE")
77
+ * @param {phenoml.construe.GetConstrueCodesSystemsCodesystemRequest} request
78
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link phenoml.construe.BadRequestError}
81
+ * @throws {@link phenoml.construe.UnauthorizedError}
82
+ * @throws {@link phenoml.construe.NotFoundError}
83
+ * @throws {@link phenoml.construe.InternalServerError}
84
+ *
85
+ * @example
86
+ * await client.construe.getCodeSystemDetail("ICD-10-CM", {
87
+ * version: "2025"
88
+ * })
89
+ */
90
+ getCodeSystemDetail(codesystem: string, request?: phenoml.construe.GetConstrueCodesSystemsCodesystemRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.GetCodeSystemDetailResponse>;
91
+ private __getCodeSystemDetail;
92
+ /**
93
+ * Deletes a custom (non-builtin) code system and all its codes. Builtin systems cannot be deleted.
94
+ * Only available on dedicated instances. Large systems may take up to a minute to delete.
95
+ *
96
+ * @param {string} codesystem - Code system name
97
+ * @param {phenoml.construe.DeleteConstrueCodesSystemsCodesystemRequest} request
98
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
99
+ *
100
+ * @throws {@link phenoml.construe.BadRequestError}
101
+ * @throws {@link phenoml.construe.UnauthorizedError}
102
+ * @throws {@link phenoml.construe.ForbiddenError}
103
+ * @throws {@link phenoml.construe.NotFoundError}
104
+ * @throws {@link phenoml.construe.InternalServerError}
105
+ *
106
+ * @example
107
+ * await client.construe.deleteCustomCodeSystem("CUSTOM_CODES", {
108
+ * version: "version"
109
+ * })
110
+ */
111
+ deleteCustomCodeSystem(codesystem: string, request?: phenoml.construe.DeleteConstrueCodesSystemsCodesystemRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.DeleteCodeSystemResponse>;
112
+ private __deleteCustomCodeSystem;
70
113
  /**
71
114
  * Returns a paginated list of all codes in the specified code system from the terminology server.
72
115
  *
@@ -115,6 +158,8 @@ export declare class Construe {
115
158
  /**
116
159
  * Performs semantic similarity search using vector embeddings.
117
160
  *
161
+ * **Availability**: This endpoint works for both **built-in and custom** code systems.
162
+ *
118
163
  * **When to use**: Best for natural language queries where you want to find conceptually
119
164
  * related codes, even when different terminology is used. The search understands meaning,
120
165
  * not just keywords.
@@ -152,6 +197,10 @@ export declare class Construe {
152
197
  /**
153
198
  * Performs fast full-text search over code IDs and descriptions.
154
199
  *
200
+ * **Availability**: This endpoint is only available for **built-in code systems**.
201
+ * Custom code systems uploaded via `/construe/upload` are not indexed for full-text search
202
+ * and will return empty results. Use `/search/semantic` to search custom code systems.
203
+ *
155
204
  * **When to use**: Best for autocomplete UIs, code lookup, or when users know part of
156
205
  * the code ID or specific keywords. Fast response times suitable for typeahead interfaces.
157
206
  *
@@ -27,16 +27,19 @@ export class Construe {
27
27
  *
28
28
  * @throws {@link phenoml.construe.BadRequestError}
29
29
  * @throws {@link phenoml.construe.UnauthorizedError}
30
+ * @throws {@link phenoml.construe.ForbiddenError}
30
31
  * @throws {@link phenoml.construe.ConflictError}
31
32
  * @throws {@link phenoml.construe.FailedDependencyError}
32
33
  * @throws {@link phenoml.construe.InternalServerError}
33
34
  *
34
35
  * @example
35
36
  * await client.construe.uploadCodeSystem({
37
+ * format: "csv",
36
38
  * name: "CUSTOM_CODES",
37
39
  * version: "1.0",
38
- * format: "json",
39
- * file: "file"
40
+ * file: "file",
41
+ * code_col: "code",
42
+ * desc_col: "description"
40
43
  * })
41
44
  */
42
45
  uploadCodeSystem(request, requestOptions) {
@@ -70,6 +73,8 @@ export class Construe {
70
73
  throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
71
74
  case 401:
72
75
  throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
76
+ case 403:
77
+ throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
73
78
  case 409:
74
79
  throw new phenoml.construe.ConflictError(_response.error.body, _response.rawResponse);
75
80
  case 424:
@@ -240,6 +245,168 @@ export class Construe {
240
245
  }
241
246
  });
242
247
  }
248
+ /**
249
+ * Returns full metadata for a single code system, including timestamps and builtin status.
250
+ *
251
+ * @param {string} codesystem - Code system name (e.g., "ICD-10-CM", "SNOMED_CT_US_LITE")
252
+ * @param {phenoml.construe.GetConstrueCodesSystemsCodesystemRequest} request
253
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
254
+ *
255
+ * @throws {@link phenoml.construe.BadRequestError}
256
+ * @throws {@link phenoml.construe.UnauthorizedError}
257
+ * @throws {@link phenoml.construe.NotFoundError}
258
+ * @throws {@link phenoml.construe.InternalServerError}
259
+ *
260
+ * @example
261
+ * await client.construe.getCodeSystemDetail("ICD-10-CM", {
262
+ * version: "2025"
263
+ * })
264
+ */
265
+ getCodeSystemDetail(codesystem, request = {}, requestOptions) {
266
+ return core.HttpResponsePromise.fromPromise(this.__getCodeSystemDetail(codesystem, request, requestOptions));
267
+ }
268
+ __getCodeSystemDetail(codesystem_1) {
269
+ return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
270
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
271
+ const { version } = request;
272
+ const _queryParams = {};
273
+ if (version != null) {
274
+ _queryParams.version = version;
275
+ }
276
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
277
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
278
+ 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)}`),
279
+ method: "GET",
280
+ headers: _headers,
281
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
282
+ 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,
283
+ 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,
284
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
285
+ });
286
+ if (_response.ok) {
287
+ return {
288
+ data: _response.body,
289
+ rawResponse: _response.rawResponse,
290
+ };
291
+ }
292
+ if (_response.error.reason === "status-code") {
293
+ switch (_response.error.statusCode) {
294
+ case 400:
295
+ throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
296
+ case 401:
297
+ throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
298
+ case 404:
299
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
300
+ case 500:
301
+ throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
302
+ default:
303
+ throw new errors.phenomlError({
304
+ statusCode: _response.error.statusCode,
305
+ body: _response.error.body,
306
+ rawResponse: _response.rawResponse,
307
+ });
308
+ }
309
+ }
310
+ switch (_response.error.reason) {
311
+ case "non-json":
312
+ throw new errors.phenomlError({
313
+ statusCode: _response.error.statusCode,
314
+ body: _response.error.rawBody,
315
+ rawResponse: _response.rawResponse,
316
+ });
317
+ case "timeout":
318
+ throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /construe/codes/systems/{codesystem}.");
319
+ case "unknown":
320
+ throw new errors.phenomlError({
321
+ message: _response.error.errorMessage,
322
+ rawResponse: _response.rawResponse,
323
+ });
324
+ }
325
+ });
326
+ }
327
+ /**
328
+ * Deletes a custom (non-builtin) code system and all its codes. Builtin systems cannot be deleted.
329
+ * Only available on dedicated instances. Large systems may take up to a minute to delete.
330
+ *
331
+ * @param {string} codesystem - Code system name
332
+ * @param {phenoml.construe.DeleteConstrueCodesSystemsCodesystemRequest} request
333
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
334
+ *
335
+ * @throws {@link phenoml.construe.BadRequestError}
336
+ * @throws {@link phenoml.construe.UnauthorizedError}
337
+ * @throws {@link phenoml.construe.ForbiddenError}
338
+ * @throws {@link phenoml.construe.NotFoundError}
339
+ * @throws {@link phenoml.construe.InternalServerError}
340
+ *
341
+ * @example
342
+ * await client.construe.deleteCustomCodeSystem("CUSTOM_CODES", {
343
+ * version: "version"
344
+ * })
345
+ */
346
+ deleteCustomCodeSystem(codesystem, request = {}, requestOptions) {
347
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomCodeSystem(codesystem, request, requestOptions));
348
+ }
349
+ __deleteCustomCodeSystem(codesystem_1) {
350
+ return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
351
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
352
+ const { version } = request;
353
+ const _queryParams = {};
354
+ if (version != null) {
355
+ _queryParams.version = version;
356
+ }
357
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
358
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
359
+ 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)}`),
360
+ method: "DELETE",
361
+ headers: _headers,
362
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
363
+ 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,
364
+ 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,
365
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
366
+ });
367
+ if (_response.ok) {
368
+ return {
369
+ data: _response.body,
370
+ rawResponse: _response.rawResponse,
371
+ };
372
+ }
373
+ if (_response.error.reason === "status-code") {
374
+ switch (_response.error.statusCode) {
375
+ case 400:
376
+ throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
377
+ case 401:
378
+ throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
379
+ case 403:
380
+ throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
381
+ case 404:
382
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
383
+ case 500:
384
+ throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
385
+ default:
386
+ throw new errors.phenomlError({
387
+ statusCode: _response.error.statusCode,
388
+ body: _response.error.body,
389
+ rawResponse: _response.rawResponse,
390
+ });
391
+ }
392
+ }
393
+ switch (_response.error.reason) {
394
+ case "non-json":
395
+ throw new errors.phenomlError({
396
+ statusCode: _response.error.statusCode,
397
+ body: _response.error.rawBody,
398
+ rawResponse: _response.rawResponse,
399
+ });
400
+ case "timeout":
401
+ throw new errors.phenomlTimeoutError("Timeout exceeded when calling DELETE /construe/codes/systems/{codesystem}.");
402
+ case "unknown":
403
+ throw new errors.phenomlError({
404
+ message: _response.error.errorMessage,
405
+ rawResponse: _response.rawResponse,
406
+ });
407
+ }
408
+ });
409
+ }
243
410
  /**
244
411
  * Returns a paginated list of all codes in the specified code system from the terminology server.
245
412
  *
@@ -408,6 +575,8 @@ export class Construe {
408
575
  /**
409
576
  * Performs semantic similarity search using vector embeddings.
410
577
  *
578
+ * **Availability**: This endpoint works for both **built-in and custom** code systems.
579
+ *
411
580
  * **When to use**: Best for natural language queries where you want to find conceptually
412
581
  * related codes, even when different terminology is used. The search understands meaning,
413
582
  * not just keywords.
@@ -509,6 +678,10 @@ export class Construe {
509
678
  /**
510
679
  * Performs fast full-text search over code IDs and descriptions.
511
680
  *
681
+ * **Availability**: This endpoint is only available for **built-in code systems**.
682
+ * Custom code systems uploaded via `/construe/upload` are not indexed for full-text search
683
+ * and will return empty results. Use `/search/semantic` to search custom code systems.
684
+ *
512
685
  * **When to use**: Best for autocomplete UIs, code lookup, or when users know part of
513
686
  * the code ID or specific keywords. Fast response times suitable for typeahead interfaces.
514
687
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * version: "version"
5
+ * }
6
+ */
7
+ export interface DeleteConstrueCodesSystemsCodesystemRequest {
8
+ /** Specific version of the code system. Required if multiple versions exist. */
9
+ version?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * version: "2025"
5
+ * }
6
+ */
7
+ export interface GetConstrueCodesSystemsCodesystemRequest {
8
+ /** Specific version of the code system. Required if multiple versions exist. */
9
+ version?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,6 +1,7 @@
1
+ export type { DeleteConstrueCodesSystemsCodesystemRequest } from "./DeleteConstrueCodesSystemsCodesystemRequest.mjs";
1
2
  export type { ExtractRequest } from "./ExtractRequest.mjs";
2
3
  export type { GetConstrueCodesCodesystemCodeIdRequest } from "./GetConstrueCodesCodesystemCodeIdRequest.mjs";
3
4
  export type { GetConstrueCodesCodesystemRequest } from "./GetConstrueCodesCodesystemRequest.mjs";
4
5
  export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConstrueCodesCodesystemSearchSemanticRequest.mjs";
5
6
  export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.mjs";
6
- export type { UploadRequest } from "./UploadRequest.mjs";
7
+ export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.mjs";
@@ -0,0 +1,5 @@
1
+ import type * as core from "../../../../core/index.mjs";
2
+ import * as errors from "../../../../errors/index.mjs";
3
+ export declare class ForbiddenError extends errors.phenomlError {
4
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
5
+ }
@@ -0,0 +1,13 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../../../errors/index.mjs";
3
+ export class ForbiddenError extends errors.phenomlError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "ForbiddenError",
7
+ statusCode: 403,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, ForbiddenError.prototype);
12
+ }
13
+ }
@@ -1,6 +1,7 @@
1
1
  export * from "./BadRequestError.mjs";
2
2
  export * from "./ConflictError.mjs";
3
3
  export * from "./FailedDependencyError.mjs";
4
+ export * from "./ForbiddenError.mjs";
4
5
  export * from "./InternalServerError.mjs";
5
6
  export * from "./NotFoundError.mjs";
6
7
  export * from "./NotImplementedError.mjs";
@@ -1,6 +1,7 @@
1
1
  export * from "./BadRequestError.mjs";
2
2
  export * from "./ConflictError.mjs";
3
3
  export * from "./FailedDependencyError.mjs";
4
+ export * from "./ForbiddenError.mjs";
4
5
  export * from "./InternalServerError.mjs";
5
6
  export * from "./NotFoundError.mjs";
6
7
  export * from "./NotImplementedError.mjs";
@@ -0,0 +1,4 @@
1
+ export interface DeleteCodeSystemResponse {
2
+ /** Confirmation message */
3
+ message: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,35 @@
1
+ export interface GetCodeSystemDetailResponse {
2
+ /** Code system name */
3
+ name: string;
4
+ /** Code system version */
5
+ version: string;
6
+ /** Total number of codes in the system */
7
+ code_count: number;
8
+ /** Whether this is a built-in system (vs custom uploaded) */
9
+ builtin: boolean;
10
+ /**
11
+ * Processing status of the code system.
12
+ * - "processing": embeddings are being generated (async upload in progress)
13
+ * - "ready": code system is ready for use
14
+ * - "failed": async processing failed (re-upload with replace=true to retry)
15
+ */
16
+ status: GetCodeSystemDetailResponse.Status;
17
+ /** When the code system was created */
18
+ created_at: string;
19
+ /** When the code system was last updated */
20
+ updated_at: string;
21
+ }
22
+ export declare namespace GetCodeSystemDetailResponse {
23
+ /**
24
+ * Processing status of the code system.
25
+ * - "processing": embeddings are being generated (async upload in progress)
26
+ * - "ready": code system is ready for use
27
+ * - "failed": async processing failed (re-upload with replace=true to retry)
28
+ */
29
+ const Status: {
30
+ readonly Processing: "processing";
31
+ readonly Ready: "ready";
32
+ readonly Failed: "failed";
33
+ };
34
+ type Status = (typeof Status)[keyof typeof Status];
35
+ }
@@ -0,0 +1,15 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var GetCodeSystemDetailResponse;
3
+ (function (GetCodeSystemDetailResponse) {
4
+ /**
5
+ * Processing status of the code system.
6
+ * - "processing": embeddings are being generated (async upload in progress)
7
+ * - "ready": code system is ready for use
8
+ * - "failed": async processing failed (re-upload with replace=true to retry)
9
+ */
10
+ GetCodeSystemDetailResponse.Status = {
11
+ Processing: "processing",
12
+ Ready: "ready",
13
+ Failed: "failed",
14
+ };
15
+ })(GetCodeSystemDetailResponse || (GetCodeSystemDetailResponse = {}));
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ export type UploadRequest = phenoml.construe.UploadRequest.Csv | phenoml.construe.UploadRequest.Json;
3
+ export declare namespace UploadRequest {
4
+ interface Csv extends phenoml.construe.UploadRequestCsv {
5
+ format: "csv";
6
+ }
7
+ interface Json extends phenoml.construe.UploadRequestJson {
8
+ format: "json";
9
+ }
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,32 @@
1
+ export interface UploadRequestCsv {
2
+ /**
3
+ * Name of the code system. Names are case-insensitive and stored uppercase.
4
+ * Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
5
+ * reserved and cannot be used for custom uploads; attempts return HTTP 403 Forbidden.
6
+ */
7
+ name: string;
8
+ /** Version of the code system */
9
+ version: string;
10
+ /** Optional revision number */
11
+ revision?: number;
12
+ /** The CSV file contents as a base64-encoded string. */
13
+ file: string;
14
+ /** Column name containing codes */
15
+ code_col: string;
16
+ /** Column name containing descriptions */
17
+ desc_col: string;
18
+ /** Optional column name containing long definitions */
19
+ defn_col?: string;
20
+ /**
21
+ * If true, replaces an existing code system with the same name and version.
22
+ * Builtin systems cannot be replaced; attempts to do so return HTTP 403 Forbidden.
23
+ * When false (default), uploading a duplicate returns 409 Conflict.
24
+ */
25
+ replace?: boolean;
26
+ /**
27
+ * If true, returns 202 Accepted immediately after validation and starts processing
28
+ * in the background. Poll GET /construe/codes/systems/{name}?version={version} to
29
+ * check when status transitions from "processing" to "ready" or "failed".
30
+ */
31
+ async?: boolean;
32
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,40 @@
1
+ import type * as phenoml from "../../../index.mjs";
2
+ /**
3
+ * Upload codes in JSON format. Either 'file' or 'codes' must be provided.
4
+ * If both are provided, 'codes' takes precedence.
5
+ */
6
+ export interface UploadRequestJson {
7
+ /**
8
+ * Name of the code system. Names are case-insensitive and stored uppercase.
9
+ * Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
10
+ * reserved and cannot be used for custom uploads; attempts return HTTP 403 Forbidden.
11
+ */
12
+ name: string;
13
+ /** Version of the code system */
14
+ version: string;
15
+ /** Optional revision number */
16
+ revision?: number;
17
+ /**
18
+ * The file contents as a base64-encoded JSON array string.
19
+ * Prefer using 'codes' instead to pass the array directly without base64 encoding.
20
+ */
21
+ file?: string;
22
+ /**
23
+ * The codes to upload as a JSON array.
24
+ * This is the preferred way to upload JSON codes, as it avoids unnecessary base64 encoding.
25
+ * If both 'codes' and 'file' are provided, 'codes' takes precedence.
26
+ */
27
+ codes?: phenoml.construe.CodeResponse[];
28
+ /**
29
+ * If true, replaces an existing code system with the same name and version.
30
+ * Builtin systems cannot be replaced; attempts to do so return HTTP 403 Forbidden.
31
+ * When false (default), uploading a duplicate returns 409 Conflict.
32
+ */
33
+ replace?: boolean;
34
+ /**
35
+ * If true, returns 202 Accepted immediately after validation and starts processing
36
+ * in the background. Poll GET /construe/codes/systems/{name}?version={version} to
37
+ * check when status transitions from "processing" to "ready" or "failed".
38
+ */
39
+ async?: boolean;
40
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -3,14 +3,19 @@ export * from "./CodeResponse.mjs";
3
3
  export * from "./CodeSystemDetails.mjs";
4
4
  export * from "./CodeSystemInfo.mjs";
5
5
  export * from "./ConstrueUploadCodeSystemResponse.mjs";
6
+ export * from "./DeleteCodeSystemResponse.mjs";
6
7
  export * from "./ExtractCodesResult.mjs";
7
8
  export * from "./ExtractedCodeResult.mjs";
8
9
  export * from "./ExtractRequestConfig.mjs";
9
10
  export * from "./ExtractRequestSystem.mjs";
10
11
  export * from "./GetCodeResponse.mjs";
12
+ export * from "./GetCodeSystemDetailResponse.mjs";
11
13
  export * from "./ListCodeSystemsResponse.mjs";
12
14
  export * from "./ListCodesResponse.mjs";
13
15
  export * from "./SemanticSearchResponse.mjs";
14
16
  export * from "./SemanticSearchResult.mjs";
15
17
  export * from "./TextSearchResponse.mjs";
16
18
  export * from "./TextSearchResult.mjs";
19
+ export * from "./UploadRequest.mjs";
20
+ export * from "./UploadRequestCsv.mjs";
21
+ export * from "./UploadRequestJson.mjs";
@@ -3,14 +3,19 @@ export * from "./CodeResponse.mjs";
3
3
  export * from "./CodeSystemDetails.mjs";
4
4
  export * from "./CodeSystemInfo.mjs";
5
5
  export * from "./ConstrueUploadCodeSystemResponse.mjs";
6
+ export * from "./DeleteCodeSystemResponse.mjs";
6
7
  export * from "./ExtractCodesResult.mjs";
7
8
  export * from "./ExtractedCodeResult.mjs";
8
9
  export * from "./ExtractRequestConfig.mjs";
9
10
  export * from "./ExtractRequestSystem.mjs";
10
11
  export * from "./GetCodeResponse.mjs";
12
+ export * from "./GetCodeSystemDetailResponse.mjs";
11
13
  export * from "./ListCodeSystemsResponse.mjs";
12
14
  export * from "./ListCodesResponse.mjs";
13
15
  export * from "./SemanticSearchResponse.mjs";
14
16
  export * from "./SemanticSearchResult.mjs";
15
17
  export * from "./TextSearchResponse.mjs";
16
18
  export * from "./TextSearchResult.mjs";
19
+ export * from "./UploadRequest.mjs";
20
+ export * from "./UploadRequestCsv.mjs";
21
+ export * from "./UploadRequestJson.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.0.0";
1
+ export declare const SDK_VERSION = "5.2.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "5.0.0";
1
+ export const SDK_VERSION = "5.2.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "private": false,
5
5
  "repository": "github:PhenoML/phenoml-ts-sdk",
6
6
  "type": "commonjs",