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
@@ -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.0.0",
56
- "User-Agent": "phenoml/5.0.0",
55
+ "X-Fern-SDK-Version": "5.2.0",
56
+ "User-Agent": "phenoml/5.2.0",
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) });
@@ -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
  *
@@ -63,16 +63,19 @@ class Construe {
63
63
  *
64
64
  * @throws {@link phenoml.construe.BadRequestError}
65
65
  * @throws {@link phenoml.construe.UnauthorizedError}
66
+ * @throws {@link phenoml.construe.ForbiddenError}
66
67
  * @throws {@link phenoml.construe.ConflictError}
67
68
  * @throws {@link phenoml.construe.FailedDependencyError}
68
69
  * @throws {@link phenoml.construe.InternalServerError}
69
70
  *
70
71
  * @example
71
72
  * await client.construe.uploadCodeSystem({
73
+ * format: "csv",
72
74
  * name: "CUSTOM_CODES",
73
75
  * version: "1.0",
74
- * format: "json",
75
- * file: "file"
76
+ * file: "file",
77
+ * code_col: "code",
78
+ * desc_col: "description"
76
79
  * })
77
80
  */
78
81
  uploadCodeSystem(request, requestOptions) {
@@ -106,6 +109,8 @@ class Construe {
106
109
  throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
107
110
  case 401:
108
111
  throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
112
+ case 403:
113
+ throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
109
114
  case 409:
110
115
  throw new phenoml.construe.ConflictError(_response.error.body, _response.rawResponse);
111
116
  case 424:
@@ -276,6 +281,168 @@ class Construe {
276
281
  }
277
282
  });
278
283
  }
284
+ /**
285
+ * Returns full metadata for a single code system, including timestamps and builtin status.
286
+ *
287
+ * @param {string} codesystem - Code system name (e.g., "ICD-10-CM", "SNOMED_CT_US_LITE")
288
+ * @param {phenoml.construe.GetConstrueCodesSystemsCodesystemRequest} request
289
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
290
+ *
291
+ * @throws {@link phenoml.construe.BadRequestError}
292
+ * @throws {@link phenoml.construe.UnauthorizedError}
293
+ * @throws {@link phenoml.construe.NotFoundError}
294
+ * @throws {@link phenoml.construe.InternalServerError}
295
+ *
296
+ * @example
297
+ * await client.construe.getCodeSystemDetail("ICD-10-CM", {
298
+ * version: "2025"
299
+ * })
300
+ */
301
+ getCodeSystemDetail(codesystem, request = {}, requestOptions) {
302
+ return core.HttpResponsePromise.fromPromise(this.__getCodeSystemDetail(codesystem, request, requestOptions));
303
+ }
304
+ __getCodeSystemDetail(codesystem_1) {
305
+ return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
306
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
307
+ const { version } = request;
308
+ const _queryParams = {};
309
+ if (version != null) {
310
+ _queryParams.version = version;
311
+ }
312
+ 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);
313
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
314
+ 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)}`),
315
+ method: "GET",
316
+ headers: _headers,
317
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
318
+ 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,
319
+ 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,
320
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
321
+ });
322
+ if (_response.ok) {
323
+ return {
324
+ data: _response.body,
325
+ rawResponse: _response.rawResponse,
326
+ };
327
+ }
328
+ if (_response.error.reason === "status-code") {
329
+ switch (_response.error.statusCode) {
330
+ case 400:
331
+ throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
332
+ case 401:
333
+ throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
334
+ case 404:
335
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
336
+ case 500:
337
+ throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
338
+ default:
339
+ throw new errors.phenomlError({
340
+ statusCode: _response.error.statusCode,
341
+ body: _response.error.body,
342
+ rawResponse: _response.rawResponse,
343
+ });
344
+ }
345
+ }
346
+ switch (_response.error.reason) {
347
+ case "non-json":
348
+ throw new errors.phenomlError({
349
+ statusCode: _response.error.statusCode,
350
+ body: _response.error.rawBody,
351
+ rawResponse: _response.rawResponse,
352
+ });
353
+ case "timeout":
354
+ throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /construe/codes/systems/{codesystem}.");
355
+ case "unknown":
356
+ throw new errors.phenomlError({
357
+ message: _response.error.errorMessage,
358
+ rawResponse: _response.rawResponse,
359
+ });
360
+ }
361
+ });
362
+ }
363
+ /**
364
+ * Deletes a custom (non-builtin) code system and all its codes. Builtin systems cannot be deleted.
365
+ * Only available on dedicated instances. Large systems may take up to a minute to delete.
366
+ *
367
+ * @param {string} codesystem - Code system name
368
+ * @param {phenoml.construe.DeleteConstrueCodesSystemsCodesystemRequest} request
369
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
370
+ *
371
+ * @throws {@link phenoml.construe.BadRequestError}
372
+ * @throws {@link phenoml.construe.UnauthorizedError}
373
+ * @throws {@link phenoml.construe.ForbiddenError}
374
+ * @throws {@link phenoml.construe.NotFoundError}
375
+ * @throws {@link phenoml.construe.InternalServerError}
376
+ *
377
+ * @example
378
+ * await client.construe.deleteCustomCodeSystem("CUSTOM_CODES", {
379
+ * version: "version"
380
+ * })
381
+ */
382
+ deleteCustomCodeSystem(codesystem, request = {}, requestOptions) {
383
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomCodeSystem(codesystem, request, requestOptions));
384
+ }
385
+ __deleteCustomCodeSystem(codesystem_1) {
386
+ return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
387
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
388
+ const { version } = request;
389
+ const _queryParams = {};
390
+ if (version != null) {
391
+ _queryParams.version = version;
392
+ }
393
+ 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);
394
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
395
+ 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)}`),
396
+ method: "DELETE",
397
+ headers: _headers,
398
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
399
+ 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,
400
+ 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,
401
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
402
+ });
403
+ if (_response.ok) {
404
+ return {
405
+ data: _response.body,
406
+ rawResponse: _response.rawResponse,
407
+ };
408
+ }
409
+ if (_response.error.reason === "status-code") {
410
+ switch (_response.error.statusCode) {
411
+ case 400:
412
+ throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
413
+ case 401:
414
+ throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
415
+ case 403:
416
+ throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
417
+ case 404:
418
+ throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
419
+ case 500:
420
+ throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
421
+ default:
422
+ throw new errors.phenomlError({
423
+ statusCode: _response.error.statusCode,
424
+ body: _response.error.body,
425
+ rawResponse: _response.rawResponse,
426
+ });
427
+ }
428
+ }
429
+ switch (_response.error.reason) {
430
+ case "non-json":
431
+ throw new errors.phenomlError({
432
+ statusCode: _response.error.statusCode,
433
+ body: _response.error.rawBody,
434
+ rawResponse: _response.rawResponse,
435
+ });
436
+ case "timeout":
437
+ throw new errors.phenomlTimeoutError("Timeout exceeded when calling DELETE /construe/codes/systems/{codesystem}.");
438
+ case "unknown":
439
+ throw new errors.phenomlError({
440
+ message: _response.error.errorMessage,
441
+ rawResponse: _response.rawResponse,
442
+ });
443
+ }
444
+ });
445
+ }
279
446
  /**
280
447
  * Returns a paginated list of all codes in the specified code system from the terminology server.
281
448
  *
@@ -444,6 +611,8 @@ class Construe {
444
611
  /**
445
612
  * Performs semantic similarity search using vector embeddings.
446
613
  *
614
+ * **Availability**: This endpoint works for both **built-in and custom** code systems.
615
+ *
447
616
  * **When to use**: Best for natural language queries where you want to find conceptually
448
617
  * related codes, even when different terminology is used. The search understands meaning,
449
618
  * not just keywords.
@@ -545,6 +714,10 @@ class Construe {
545
714
  /**
546
715
  * Performs fast full-text search over code IDs and descriptions.
547
716
  *
717
+ * **Availability**: This endpoint is only available for **built-in code systems**.
718
+ * Custom code systems uploaded via `/construe/upload` are not indexed for full-text search
719
+ * and will return empty results. Use `/search/semantic` to search custom code systems.
720
+ *
548
721
  * **When to use**: Best for autocomplete UIs, code lookup, or when users know part of
549
722
  * the code ID or specific keywords. Fast response times suitable for typeahead interfaces.
550
723
  *
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
+ export type { DeleteConstrueCodesSystemsCodesystemRequest } from "./DeleteConstrueCodesSystemsCodesystemRequest.js";
1
2
  export type { ExtractRequest } from "./ExtractRequest.js";
2
3
  export type { GetConstrueCodesCodesystemCodeIdRequest } from "./GetConstrueCodesCodesystemCodeIdRequest.js";
3
4
  export type { GetConstrueCodesCodesystemRequest } from "./GetConstrueCodesCodesystemRequest.js";
4
5
  export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConstrueCodesCodesystemSearchSemanticRequest.js";
5
6
  export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.js";
6
- export type { UploadRequest } from "./UploadRequest.js";
7
+ export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.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 ForbiddenError 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.ForbiddenError = void 0;
38
+ const errors = __importStar(require("../../../../errors/index.js"));
39
+ class ForbiddenError extends errors.phenomlError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "ForbiddenError",
43
+ statusCode: 403,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, ForbiddenError.prototype);
48
+ }
49
+ }
50
+ exports.ForbiddenError = ForbiddenError;
@@ -1,6 +1,7 @@
1
1
  export * from "./BadRequestError.js";
2
2
  export * from "./ConflictError.js";
3
3
  export * from "./FailedDependencyError.js";
4
+ export * from "./ForbiddenError.js";
4
5
  export * from "./InternalServerError.js";
5
6
  export * from "./NotFoundError.js";
6
7
  export * from "./NotImplementedError.js";
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BadRequestError.js"), exports);
18
18
  __exportStar(require("./ConflictError.js"), exports);
19
19
  __exportStar(require("./FailedDependencyError.js"), exports);
20
+ __exportStar(require("./ForbiddenError.js"), exports);
20
21
  __exportStar(require("./InternalServerError.js"), exports);
21
22
  __exportStar(require("./NotFoundError.js"), exports);
22
23
  __exportStar(require("./NotImplementedError.js"), exports);
@@ -0,0 +1,4 @@
1
+ export interface DeleteCodeSystemResponse {
2
+ /** Confirmation message */
3
+ message: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,18 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.GetCodeSystemDetailResponse = void 0;
5
+ var GetCodeSystemDetailResponse;
6
+ (function (GetCodeSystemDetailResponse) {
7
+ /**
8
+ * Processing status of the code system.
9
+ * - "processing": embeddings are being generated (async upload in progress)
10
+ * - "ready": code system is ready for use
11
+ * - "failed": async processing failed (re-upload with replace=true to retry)
12
+ */
13
+ GetCodeSystemDetailResponse.Status = {
14
+ Processing: "processing",
15
+ Ready: "ready",
16
+ Failed: "failed",
17
+ };
18
+ })(GetCodeSystemDetailResponse || (exports.GetCodeSystemDetailResponse = GetCodeSystemDetailResponse = {}));
@@ -0,0 +1,10 @@
1
+ import type * as phenoml from "../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,40 @@
1
+ import type * as phenoml from "../../../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,14 +3,19 @@ export * from "./CodeResponse.js";
3
3
  export * from "./CodeSystemDetails.js";
4
4
  export * from "./CodeSystemInfo.js";
5
5
  export * from "./ConstrueUploadCodeSystemResponse.js";
6
+ export * from "./DeleteCodeSystemResponse.js";
6
7
  export * from "./ExtractCodesResult.js";
7
8
  export * from "./ExtractedCodeResult.js";
8
9
  export * from "./ExtractRequestConfig.js";
9
10
  export * from "./ExtractRequestSystem.js";
10
11
  export * from "./GetCodeResponse.js";
12
+ export * from "./GetCodeSystemDetailResponse.js";
11
13
  export * from "./ListCodeSystemsResponse.js";
12
14
  export * from "./ListCodesResponse.js";
13
15
  export * from "./SemanticSearchResponse.js";
14
16
  export * from "./SemanticSearchResult.js";
15
17
  export * from "./TextSearchResponse.js";
16
18
  export * from "./TextSearchResult.js";
19
+ export * from "./UploadRequest.js";
20
+ export * from "./UploadRequestCsv.js";
21
+ export * from "./UploadRequestJson.js";
@@ -19,14 +19,19 @@ __exportStar(require("./CodeResponse.js"), exports);
19
19
  __exportStar(require("./CodeSystemDetails.js"), exports);
20
20
  __exportStar(require("./CodeSystemInfo.js"), exports);
21
21
  __exportStar(require("./ConstrueUploadCodeSystemResponse.js"), exports);
22
+ __exportStar(require("./DeleteCodeSystemResponse.js"), exports);
22
23
  __exportStar(require("./ExtractCodesResult.js"), exports);
23
24
  __exportStar(require("./ExtractedCodeResult.js"), exports);
24
25
  __exportStar(require("./ExtractRequestConfig.js"), exports);
25
26
  __exportStar(require("./ExtractRequestSystem.js"), exports);
26
27
  __exportStar(require("./GetCodeResponse.js"), exports);
28
+ __exportStar(require("./GetCodeSystemDetailResponse.js"), exports);
27
29
  __exportStar(require("./ListCodeSystemsResponse.js"), exports);
28
30
  __exportStar(require("./ListCodesResponse.js"), exports);
29
31
  __exportStar(require("./SemanticSearchResponse.js"), exports);
30
32
  __exportStar(require("./SemanticSearchResult.js"), exports);
31
33
  __exportStar(require("./TextSearchResponse.js"), exports);
32
34
  __exportStar(require("./TextSearchResult.js"), exports);
35
+ __exportStar(require("./UploadRequest.js"), exports);
36
+ __exportStar(require("./UploadRequestCsv.js"), exports);
37
+ __exportStar(require("./UploadRequestJson.js"), exports);