phenoml 5.1.0 → 5.3.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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/construe/client/Client.d.ts +28 -2
- package/dist/cjs/api/resources/construe/client/Client.js +94 -2
- package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemExportRequest.d.ts +10 -0
- package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemExportRequest.js +3 -0
- package/dist/cjs/api/resources/construe/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/construe/types/ExportCodeSystemResponse.d.ts +11 -0
- package/dist/cjs/api/resources/construe/types/ExportCodeSystemResponse.js +3 -0
- package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.d.ts +21 -2
- package/dist/cjs/api/resources/construe/types/GetCodeSystemDetailResponse.js +15 -0
- package/dist/cjs/api/resources/construe/types/UploadRequest.d.ts +10 -0
- package/dist/cjs/api/resources/construe/types/UploadRequest.js +3 -0
- package/dist/cjs/api/resources/construe/types/UploadRequestCsv.d.ts +32 -0
- package/dist/cjs/api/resources/construe/types/UploadRequestCsv.js +3 -0
- package/dist/cjs/api/resources/construe/types/UploadRequestJson.d.ts +40 -0
- package/dist/cjs/api/resources/construe/types/UploadRequestJson.js +3 -0
- package/dist/cjs/api/resources/construe/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/construe/types/index.js +4 -0
- package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +0 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/construe/client/Client.d.mts +28 -2
- package/dist/esm/api/resources/construe/client/Client.mjs +94 -2
- package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemExportRequest.d.mts +10 -0
- package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesSystemsCodesystemExportRequest.mjs +2 -0
- package/dist/esm/api/resources/construe/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/construe/types/ExportCodeSystemResponse.d.mts +11 -0
- package/dist/esm/api/resources/construe/types/ExportCodeSystemResponse.mjs +2 -0
- package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.d.mts +21 -2
- package/dist/esm/api/resources/construe/types/GetCodeSystemDetailResponse.mjs +14 -1
- package/dist/esm/api/resources/construe/types/UploadRequest.d.mts +10 -0
- package/dist/esm/api/resources/construe/types/UploadRequest.mjs +2 -0
- package/dist/esm/api/resources/construe/types/UploadRequestCsv.d.mts +32 -0
- package/dist/esm/api/resources/construe/types/UploadRequestCsv.mjs +2 -0
- package/dist/esm/api/resources/construe/types/UploadRequestJson.d.mts +40 -0
- package/dist/esm/api/resources/construe/types/UploadRequestJson.mjs +2 -0
- package/dist/esm/api/resources/construe/types/index.d.mts +4 -0
- package/dist/esm/api/resources/construe/types/index.mjs +4 -0
- package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +0 -1
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +0 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +80 -3
- package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +0 -45
- package/dist/cjs/api/resources/construe/client/requests/UploadRequest.js +0 -12
- package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +0 -45
- package/dist/esm/api/resources/construe/client/requests/UploadRequest.mjs +0 -9
package/dist/cjs/Client.js
CHANGED
|
@@ -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.
|
|
56
|
-
"User-Agent": "phenoml/5.
|
|
55
|
+
"X-Fern-SDK-Version": "5.3.0",
|
|
56
|
+
"User-Agent": "phenoml/5.3.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) });
|
|
@@ -27,10 +27,12 @@ export declare class Construe {
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* await client.construe.uploadCodeSystem({
|
|
30
|
+
* format: "csv",
|
|
30
31
|
* name: "CUSTOM_CODES",
|
|
31
32
|
* version: "1.0",
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* file: "file",
|
|
34
|
+
* code_col: "code",
|
|
35
|
+
* desc_col: "description"
|
|
34
36
|
* })
|
|
35
37
|
*/
|
|
36
38
|
uploadCodeSystem(request: phenoml.construe.UploadRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ConstrueUploadCodeSystemResponse>;
|
|
@@ -108,6 +110,30 @@ export declare class Construe {
|
|
|
108
110
|
*/
|
|
109
111
|
deleteCustomCodeSystem(codesystem: string, request?: phenoml.construe.DeleteConstrueCodesSystemsCodesystemRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.DeleteCodeSystemResponse>;
|
|
110
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;
|
|
111
137
|
/**
|
|
112
138
|
* Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
113
139
|
*
|
|
@@ -70,10 +70,12 @@ class Construe {
|
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
72
72
|
* await client.construe.uploadCodeSystem({
|
|
73
|
+
* format: "csv",
|
|
73
74
|
* name: "CUSTOM_CODES",
|
|
74
75
|
* version: "1.0",
|
|
75
|
-
*
|
|
76
|
-
*
|
|
76
|
+
* file: "file",
|
|
77
|
+
* code_col: "code",
|
|
78
|
+
* desc_col: "description"
|
|
77
79
|
* })
|
|
78
80
|
*/
|
|
79
81
|
uploadCodeSystem(request, requestOptions) {
|
|
@@ -441,6 +443,96 @@ class Construe {
|
|
|
441
443
|
}
|
|
442
444
|
});
|
|
443
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
* Exports a custom (non-builtin) code system as a JSON file compatible with the upload format.
|
|
448
|
+
* The exported file can be re-uploaded directly via POST /construe/upload with format "json".
|
|
449
|
+
* Only available on dedicated instances. Builtin systems cannot be exported.
|
|
450
|
+
*
|
|
451
|
+
* @param {string} codesystem - Code system name
|
|
452
|
+
* @param {phenoml.construe.GetConstrueCodesSystemsCodesystemExportRequest} request
|
|
453
|
+
* @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
|
|
454
|
+
*
|
|
455
|
+
* @throws {@link phenoml.construe.BadRequestError}
|
|
456
|
+
* @throws {@link phenoml.construe.UnauthorizedError}
|
|
457
|
+
* @throws {@link phenoml.construe.ForbiddenError}
|
|
458
|
+
* @throws {@link phenoml.construe.NotFoundError}
|
|
459
|
+
* @throws {@link phenoml.construe.ConflictError}
|
|
460
|
+
* @throws {@link phenoml.construe.FailedDependencyError}
|
|
461
|
+
* @throws {@link phenoml.construe.InternalServerError}
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* await client.construe.exportCustomCodeSystem("CUSTOM_CODES", {
|
|
465
|
+
* version: "version"
|
|
466
|
+
* })
|
|
467
|
+
*/
|
|
468
|
+
exportCustomCodeSystem(codesystem, request = {}, requestOptions) {
|
|
469
|
+
return core.HttpResponsePromise.fromPromise(this.__exportCustomCodeSystem(codesystem, request, requestOptions));
|
|
470
|
+
}
|
|
471
|
+
__exportCustomCodeSystem(codesystem_1) {
|
|
472
|
+
return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
|
|
473
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
474
|
+
const { version } = request;
|
|
475
|
+
const _queryParams = {};
|
|
476
|
+
if (version != null) {
|
|
477
|
+
_queryParams.version = version;
|
|
478
|
+
}
|
|
479
|
+
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);
|
|
480
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
481
|
+
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`),
|
|
482
|
+
method: "GET",
|
|
483
|
+
headers: _headers,
|
|
484
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
485
|
+
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,
|
|
486
|
+
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,
|
|
487
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
488
|
+
});
|
|
489
|
+
if (_response.ok) {
|
|
490
|
+
return {
|
|
491
|
+
data: _response.body,
|
|
492
|
+
rawResponse: _response.rawResponse,
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
if (_response.error.reason === "status-code") {
|
|
496
|
+
switch (_response.error.statusCode) {
|
|
497
|
+
case 400:
|
|
498
|
+
throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
|
|
499
|
+
case 401:
|
|
500
|
+
throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
501
|
+
case 403:
|
|
502
|
+
throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
503
|
+
case 404:
|
|
504
|
+
throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
|
|
505
|
+
case 409:
|
|
506
|
+
throw new phenoml.construe.ConflictError(_response.error.body, _response.rawResponse);
|
|
507
|
+
case 424:
|
|
508
|
+
throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
|
|
509
|
+
case 500:
|
|
510
|
+
throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
|
|
511
|
+
default:
|
|
512
|
+
throw new errors.phenomlError({
|
|
513
|
+
statusCode: _response.error.statusCode,
|
|
514
|
+
body: _response.error.body,
|
|
515
|
+
rawResponse: _response.rawResponse,
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
switch (_response.error.reason) {
|
|
520
|
+
case "non-json":
|
|
521
|
+
throw new errors.phenomlError({
|
|
522
|
+
statusCode: _response.error.statusCode,
|
|
523
|
+
body: _response.error.rawBody,
|
|
524
|
+
rawResponse: _response.rawResponse,
|
|
525
|
+
});
|
|
526
|
+
case "timeout":
|
|
527
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /construe/codes/systems/{codesystem}/export.");
|
|
528
|
+
case "unknown":
|
|
529
|
+
throw new errors.phenomlError({
|
|
530
|
+
message: _response.error.errorMessage,
|
|
531
|
+
rawResponse: _response.rawResponse,
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
444
536
|
/**
|
|
445
537
|
* Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
446
538
|
*
|
|
@@ -4,5 +4,5 @@ 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";
|
|
8
|
-
export type { UploadRequest } from "./UploadRequest.js";
|
|
@@ -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
|
+
}
|
|
@@ -7,10 +7,29 @@ export interface GetCodeSystemDetailResponse {
|
|
|
7
7
|
code_count: number;
|
|
8
8
|
/** Whether this is a built-in system (vs custom uploaded) */
|
|
9
9
|
builtin: boolean;
|
|
10
|
-
/**
|
|
11
|
-
|
|
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;
|
|
12
17
|
/** When the code system was created */
|
|
13
18
|
created_at: string;
|
|
14
19
|
/** When the code system was last updated */
|
|
15
20
|
updated_at: string;
|
|
16
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
|
+
}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
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,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,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
|
+
}
|
|
@@ -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,3 +17,6 @@ export * from "./SemanticSearchResponse.js";
|
|
|
16
17
|
export * from "./SemanticSearchResult.js";
|
|
17
18
|
export * from "./TextSearchResponse.js";
|
|
18
19
|
export * from "./TextSearchResult.js";
|
|
20
|
+
export * from "./UploadRequest.js";
|
|
21
|
+
export * from "./UploadRequestCsv.js";
|
|
22
|
+
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,3 +33,6 @@ __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);
|
|
36
|
+
__exportStar(require("./UploadRequest.js"), exports);
|
|
37
|
+
__exportStar(require("./UploadRequestCsv.js"), exports);
|
|
38
|
+
__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:
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.3.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -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.
|
|
20
|
-
"User-Agent": "phenoml/5.
|
|
19
|
+
"X-Fern-SDK-Version": "5.3.0",
|
|
20
|
+
"User-Agent": "phenoml/5.3.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) });
|
|
@@ -27,10 +27,12 @@ export declare class Construe {
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* await client.construe.uploadCodeSystem({
|
|
30
|
+
* format: "csv",
|
|
30
31
|
* name: "CUSTOM_CODES",
|
|
31
32
|
* version: "1.0",
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* file: "file",
|
|
34
|
+
* code_col: "code",
|
|
35
|
+
* desc_col: "description"
|
|
34
36
|
* })
|
|
35
37
|
*/
|
|
36
38
|
uploadCodeSystem(request: phenoml.construe.UploadRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ConstrueUploadCodeSystemResponse>;
|
|
@@ -108,6 +110,30 @@ export declare class Construe {
|
|
|
108
110
|
*/
|
|
109
111
|
deleteCustomCodeSystem(codesystem: string, request?: phenoml.construe.DeleteConstrueCodesSystemsCodesystemRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.DeleteCodeSystemResponse>;
|
|
110
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;
|
|
111
137
|
/**
|
|
112
138
|
* Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
113
139
|
*
|
|
@@ -34,10 +34,12 @@ export class Construe {
|
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* await client.construe.uploadCodeSystem({
|
|
37
|
+
* format: "csv",
|
|
37
38
|
* name: "CUSTOM_CODES",
|
|
38
39
|
* version: "1.0",
|
|
39
|
-
*
|
|
40
|
-
*
|
|
40
|
+
* file: "file",
|
|
41
|
+
* code_col: "code",
|
|
42
|
+
* desc_col: "description"
|
|
41
43
|
* })
|
|
42
44
|
*/
|
|
43
45
|
uploadCodeSystem(request, requestOptions) {
|
|
@@ -405,6 +407,96 @@ export class Construe {
|
|
|
405
407
|
}
|
|
406
408
|
});
|
|
407
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* Exports a custom (non-builtin) code system as a JSON file compatible with the upload format.
|
|
412
|
+
* The exported file can be re-uploaded directly via POST /construe/upload with format "json".
|
|
413
|
+
* Only available on dedicated instances. Builtin systems cannot be exported.
|
|
414
|
+
*
|
|
415
|
+
* @param {string} codesystem - Code system name
|
|
416
|
+
* @param {phenoml.construe.GetConstrueCodesSystemsCodesystemExportRequest} request
|
|
417
|
+
* @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
|
|
418
|
+
*
|
|
419
|
+
* @throws {@link phenoml.construe.BadRequestError}
|
|
420
|
+
* @throws {@link phenoml.construe.UnauthorizedError}
|
|
421
|
+
* @throws {@link phenoml.construe.ForbiddenError}
|
|
422
|
+
* @throws {@link phenoml.construe.NotFoundError}
|
|
423
|
+
* @throws {@link phenoml.construe.ConflictError}
|
|
424
|
+
* @throws {@link phenoml.construe.FailedDependencyError}
|
|
425
|
+
* @throws {@link phenoml.construe.InternalServerError}
|
|
426
|
+
*
|
|
427
|
+
* @example
|
|
428
|
+
* await client.construe.exportCustomCodeSystem("CUSTOM_CODES", {
|
|
429
|
+
* version: "version"
|
|
430
|
+
* })
|
|
431
|
+
*/
|
|
432
|
+
exportCustomCodeSystem(codesystem, request = {}, requestOptions) {
|
|
433
|
+
return core.HttpResponsePromise.fromPromise(this.__exportCustomCodeSystem(codesystem, request, requestOptions));
|
|
434
|
+
}
|
|
435
|
+
__exportCustomCodeSystem(codesystem_1) {
|
|
436
|
+
return __awaiter(this, arguments, void 0, function* (codesystem, request = {}, requestOptions) {
|
|
437
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
438
|
+
const { version } = request;
|
|
439
|
+
const _queryParams = {};
|
|
440
|
+
if (version != null) {
|
|
441
|
+
_queryParams.version = version;
|
|
442
|
+
}
|
|
443
|
+
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);
|
|
444
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
445
|
+
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`),
|
|
446
|
+
method: "GET",
|
|
447
|
+
headers: _headers,
|
|
448
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
449
|
+
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,
|
|
450
|
+
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,
|
|
451
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
452
|
+
});
|
|
453
|
+
if (_response.ok) {
|
|
454
|
+
return {
|
|
455
|
+
data: _response.body,
|
|
456
|
+
rawResponse: _response.rawResponse,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
if (_response.error.reason === "status-code") {
|
|
460
|
+
switch (_response.error.statusCode) {
|
|
461
|
+
case 400:
|
|
462
|
+
throw new phenoml.construe.BadRequestError(_response.error.body, _response.rawResponse);
|
|
463
|
+
case 401:
|
|
464
|
+
throw new phenoml.construe.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
465
|
+
case 403:
|
|
466
|
+
throw new phenoml.construe.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
467
|
+
case 404:
|
|
468
|
+
throw new phenoml.construe.NotFoundError(_response.error.body, _response.rawResponse);
|
|
469
|
+
case 409:
|
|
470
|
+
throw new phenoml.construe.ConflictError(_response.error.body, _response.rawResponse);
|
|
471
|
+
case 424:
|
|
472
|
+
throw new phenoml.construe.FailedDependencyError(_response.error.body, _response.rawResponse);
|
|
473
|
+
case 500:
|
|
474
|
+
throw new phenoml.construe.InternalServerError(_response.error.body, _response.rawResponse);
|
|
475
|
+
default:
|
|
476
|
+
throw new errors.phenomlError({
|
|
477
|
+
statusCode: _response.error.statusCode,
|
|
478
|
+
body: _response.error.body,
|
|
479
|
+
rawResponse: _response.rawResponse,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
switch (_response.error.reason) {
|
|
484
|
+
case "non-json":
|
|
485
|
+
throw new errors.phenomlError({
|
|
486
|
+
statusCode: _response.error.statusCode,
|
|
487
|
+
body: _response.error.rawBody,
|
|
488
|
+
rawResponse: _response.rawResponse,
|
|
489
|
+
});
|
|
490
|
+
case "timeout":
|
|
491
|
+
throw new errors.phenomlTimeoutError("Timeout exceeded when calling GET /construe/codes/systems/{codesystem}/export.");
|
|
492
|
+
case "unknown":
|
|
493
|
+
throw new errors.phenomlError({
|
|
494
|
+
message: _response.error.errorMessage,
|
|
495
|
+
rawResponse: _response.rawResponse,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
}
|
|
408
500
|
/**
|
|
409
501
|
* Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
410
502
|
*
|
|
@@ -4,5 +4,5 @@ export type { GetConstrueCodesCodesystemCodeIdRequest } from "./GetConstrueCodes
|
|
|
4
4
|
export type { GetConstrueCodesCodesystemRequest } from "./GetConstrueCodesCodesystemRequest.mjs";
|
|
5
5
|
export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConstrueCodesCodesystemSearchSemanticRequest.mjs";
|
|
6
6
|
export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.mjs";
|
|
7
|
+
export type { GetConstrueCodesSystemsCodesystemExportRequest } from "./GetConstrueCodesSystemsCodesystemExportRequest.mjs";
|
|
7
8
|
export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.mjs";
|
|
8
|
-
export type { UploadRequest } from "./UploadRequest.mjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as phenoml from "../../../index.mjs";
|
|
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
|
+
}
|
|
@@ -7,10 +7,29 @@ export interface GetCodeSystemDetailResponse {
|
|
|
7
7
|
code_count: number;
|
|
8
8
|
/** Whether this is a built-in system (vs custom uploaded) */
|
|
9
9
|
builtin: boolean;
|
|
10
|
-
/**
|
|
11
|
-
|
|
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;
|
|
12
17
|
/** When the code system was created */
|
|
13
18
|
created_at: string;
|
|
14
19
|
/** When the code system was last updated */
|
|
15
20
|
updated_at: string;
|
|
16
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
|
+
}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
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,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,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
|
+
}
|
|
@@ -4,6 +4,7 @@ export * from "./CodeSystemDetails.mjs";
|
|
|
4
4
|
export * from "./CodeSystemInfo.mjs";
|
|
5
5
|
export * from "./ConstrueUploadCodeSystemResponse.mjs";
|
|
6
6
|
export * from "./DeleteCodeSystemResponse.mjs";
|
|
7
|
+
export * from "./ExportCodeSystemResponse.mjs";
|
|
7
8
|
export * from "./ExtractCodesResult.mjs";
|
|
8
9
|
export * from "./ExtractedCodeResult.mjs";
|
|
9
10
|
export * from "./ExtractRequestConfig.mjs";
|
|
@@ -16,3 +17,6 @@ export * from "./SemanticSearchResponse.mjs";
|
|
|
16
17
|
export * from "./SemanticSearchResult.mjs";
|
|
17
18
|
export * from "./TextSearchResponse.mjs";
|
|
18
19
|
export * from "./TextSearchResult.mjs";
|
|
20
|
+
export * from "./UploadRequest.mjs";
|
|
21
|
+
export * from "./UploadRequestCsv.mjs";
|
|
22
|
+
export * from "./UploadRequestJson.mjs";
|
|
@@ -4,6 +4,7 @@ export * from "./CodeSystemDetails.mjs";
|
|
|
4
4
|
export * from "./CodeSystemInfo.mjs";
|
|
5
5
|
export * from "./ConstrueUploadCodeSystemResponse.mjs";
|
|
6
6
|
export * from "./DeleteCodeSystemResponse.mjs";
|
|
7
|
+
export * from "./ExportCodeSystemResponse.mjs";
|
|
7
8
|
export * from "./ExtractCodesResult.mjs";
|
|
8
9
|
export * from "./ExtractedCodeResult.mjs";
|
|
9
10
|
export * from "./ExtractRequestConfig.mjs";
|
|
@@ -16,3 +17,6 @@ export * from "./SemanticSearchResponse.mjs";
|
|
|
16
17
|
export * from "./SemanticSearchResult.mjs";
|
|
17
18
|
export * from "./TextSearchResponse.mjs";
|
|
18
19
|
export * from "./TextSearchResult.mjs";
|
|
20
|
+
export * from "./UploadRequest.mjs";
|
|
21
|
+
export * from "./UploadRequestCsv.mjs";
|
|
22
|
+
export * from "./UploadRequestJson.mjs";
|
|
@@ -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
|
*
|
|
@@ -175,7 +175,6 @@ export class FhirProvider {
|
|
|
175
175
|
* @param {FhirProvider.RequestOptions} requestOptions - Request-specific configuration.
|
|
176
176
|
*
|
|
177
177
|
* @throws {@link phenoml.fhirProvider.UnauthorizedError}
|
|
178
|
-
* @throws {@link phenoml.fhirProvider.ForbiddenError}
|
|
179
178
|
* @throws {@link phenoml.fhirProvider.NotFoundError}
|
|
180
179
|
* @throws {@link phenoml.fhirProvider.InternalServerError}
|
|
181
180
|
*
|
|
@@ -208,8 +207,6 @@ export class FhirProvider {
|
|
|
208
207
|
switch (_response.error.statusCode) {
|
|
209
208
|
case 401:
|
|
210
209
|
throw new phenoml.fhirProvider.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
211
|
-
case 403:
|
|
212
|
-
throw new phenoml.fhirProvider.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
213
210
|
case 404:
|
|
214
211
|
throw new phenoml.fhirProvider.NotFoundError(_response.error.body, _response.rawResponse);
|
|
215
212
|
case 500:
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.3.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.
|
|
1
|
+
export const SDK_VERSION = "5.3.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1171,10 +1171,12 @@ subsequently use the code system for construe/extract and lang2fhir/create (comi
|
|
|
1171
1171
|
|
|
1172
1172
|
```typescript
|
|
1173
1173
|
await client.construe.uploadCodeSystem({
|
|
1174
|
+
format: "csv",
|
|
1174
1175
|
name: "CUSTOM_CODES",
|
|
1175
1176
|
version: "1.0",
|
|
1176
|
-
|
|
1177
|
-
|
|
1177
|
+
file: "file",
|
|
1178
|
+
code_col: "code",
|
|
1179
|
+
desc_col: "description"
|
|
1178
1180
|
});
|
|
1179
1181
|
|
|
1180
1182
|
```
|
|
@@ -1191,7 +1193,7 @@ await client.construe.uploadCodeSystem({
|
|
|
1191
1193
|
<dl>
|
|
1192
1194
|
<dd>
|
|
1193
1195
|
|
|
1194
|
-
**request:** `phenoml.
|
|
1196
|
+
**request:** `phenoml.UploadRequest`
|
|
1195
1197
|
|
|
1196
1198
|
</dd>
|
|
1197
1199
|
</dl>
|
|
@@ -1476,6 +1478,81 @@ await client.construe.deleteCustomCodeSystem("CUSTOM_CODES", {
|
|
|
1476
1478
|
</dl>
|
|
1477
1479
|
|
|
1478
1480
|
|
|
1481
|
+
</dd>
|
|
1482
|
+
</dl>
|
|
1483
|
+
</details>
|
|
1484
|
+
|
|
1485
|
+
<details><summary><code>client.construe.<a href="/src/api/resources/construe/client/Client.ts">exportCustomCodeSystem</a>(codesystem, { ...params }) -> phenoml.ExportCodeSystemResponse</code></summary>
|
|
1486
|
+
<dl>
|
|
1487
|
+
<dd>
|
|
1488
|
+
|
|
1489
|
+
#### 📝 Description
|
|
1490
|
+
|
|
1491
|
+
<dl>
|
|
1492
|
+
<dd>
|
|
1493
|
+
|
|
1494
|
+
<dl>
|
|
1495
|
+
<dd>
|
|
1496
|
+
|
|
1497
|
+
Exports a custom (non-builtin) code system as a JSON file compatible with the upload format.
|
|
1498
|
+
The exported file can be re-uploaded directly via POST /construe/upload with format "json".
|
|
1499
|
+
Only available on dedicated instances. Builtin systems cannot be exported.
|
|
1500
|
+
</dd>
|
|
1501
|
+
</dl>
|
|
1502
|
+
</dd>
|
|
1503
|
+
</dl>
|
|
1504
|
+
|
|
1505
|
+
#### 🔌 Usage
|
|
1506
|
+
|
|
1507
|
+
<dl>
|
|
1508
|
+
<dd>
|
|
1509
|
+
|
|
1510
|
+
<dl>
|
|
1511
|
+
<dd>
|
|
1512
|
+
|
|
1513
|
+
```typescript
|
|
1514
|
+
await client.construe.exportCustomCodeSystem("CUSTOM_CODES", {
|
|
1515
|
+
version: "version"
|
|
1516
|
+
});
|
|
1517
|
+
|
|
1518
|
+
```
|
|
1519
|
+
</dd>
|
|
1520
|
+
</dl>
|
|
1521
|
+
</dd>
|
|
1522
|
+
</dl>
|
|
1523
|
+
|
|
1524
|
+
#### ⚙️ Parameters
|
|
1525
|
+
|
|
1526
|
+
<dl>
|
|
1527
|
+
<dd>
|
|
1528
|
+
|
|
1529
|
+
<dl>
|
|
1530
|
+
<dd>
|
|
1531
|
+
|
|
1532
|
+
**codesystem:** `string` — Code system name
|
|
1533
|
+
|
|
1534
|
+
</dd>
|
|
1535
|
+
</dl>
|
|
1536
|
+
|
|
1537
|
+
<dl>
|
|
1538
|
+
<dd>
|
|
1539
|
+
|
|
1540
|
+
**request:** `phenoml.construe.GetConstrueCodesSystemsCodesystemExportRequest`
|
|
1541
|
+
|
|
1542
|
+
</dd>
|
|
1543
|
+
</dl>
|
|
1544
|
+
|
|
1545
|
+
<dl>
|
|
1546
|
+
<dd>
|
|
1547
|
+
|
|
1548
|
+
**requestOptions:** `Construe.RequestOptions`
|
|
1549
|
+
|
|
1550
|
+
</dd>
|
|
1551
|
+
</dl>
|
|
1552
|
+
</dd>
|
|
1553
|
+
</dl>
|
|
1554
|
+
|
|
1555
|
+
|
|
1479
1556
|
</dd>
|
|
1480
1557
|
</dl>
|
|
1481
1558
|
</details>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @example
|
|
3
|
-
* {
|
|
4
|
-
* name: "CUSTOM_CODES",
|
|
5
|
-
* version: "1.0",
|
|
6
|
-
* format: "json",
|
|
7
|
-
* file: "file"
|
|
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
|
-
/** Format of the uploaded file */
|
|
22
|
-
format: UploadRequest.Format;
|
|
23
|
-
/** The file contents as a base64-encoded string */
|
|
24
|
-
file: string;
|
|
25
|
-
/** Column name containing codes (required for CSV format) */
|
|
26
|
-
code_col?: string;
|
|
27
|
-
/** Column name containing descriptions (required for CSV format) */
|
|
28
|
-
desc_col?: string;
|
|
29
|
-
/** Optional column name containing long definitions (for CSV format) */
|
|
30
|
-
defn_col?: string;
|
|
31
|
-
/**
|
|
32
|
-
* If true, replaces an existing code system with the same name and version.
|
|
33
|
-
* Builtin systems cannot be replaced; attempts to do so return HTTP 403 Forbidden.
|
|
34
|
-
* When false (default), uploading a duplicate returns 409 Conflict.
|
|
35
|
-
*/
|
|
36
|
-
replace?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare namespace UploadRequest {
|
|
39
|
-
/** Format of the uploaded file */
|
|
40
|
-
const Format: {
|
|
41
|
-
readonly Json: "json";
|
|
42
|
-
readonly Csv: "csv";
|
|
43
|
-
};
|
|
44
|
-
type Format = (typeof Format)[keyof typeof Format];
|
|
45
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
/** Format of the uploaded file */
|
|
8
|
-
UploadRequest.Format = {
|
|
9
|
-
Json: "json",
|
|
10
|
-
Csv: "csv",
|
|
11
|
-
};
|
|
12
|
-
})(UploadRequest || (exports.UploadRequest = UploadRequest = {}));
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @example
|
|
3
|
-
* {
|
|
4
|
-
* name: "CUSTOM_CODES",
|
|
5
|
-
* version: "1.0",
|
|
6
|
-
* format: "json",
|
|
7
|
-
* file: "file"
|
|
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
|
-
/** Format of the uploaded file */
|
|
22
|
-
format: UploadRequest.Format;
|
|
23
|
-
/** The file contents as a base64-encoded string */
|
|
24
|
-
file: string;
|
|
25
|
-
/** Column name containing codes (required for CSV format) */
|
|
26
|
-
code_col?: string;
|
|
27
|
-
/** Column name containing descriptions (required for CSV format) */
|
|
28
|
-
desc_col?: string;
|
|
29
|
-
/** Optional column name containing long definitions (for CSV format) */
|
|
30
|
-
defn_col?: string;
|
|
31
|
-
/**
|
|
32
|
-
* If true, replaces an existing code system with the same name and version.
|
|
33
|
-
* Builtin systems cannot be replaced; attempts to do so return HTTP 403 Forbidden.
|
|
34
|
-
* When false (default), uploading a duplicate returns 409 Conflict.
|
|
35
|
-
*/
|
|
36
|
-
replace?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare namespace UploadRequest {
|
|
39
|
-
/** Format of the uploaded file */
|
|
40
|
-
const Format: {
|
|
41
|
-
readonly Json: "json";
|
|
42
|
-
readonly Csv: "csv";
|
|
43
|
-
};
|
|
44
|
-
type Format = (typeof Format)[keyof typeof Format];
|
|
45
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var UploadRequest;
|
|
3
|
-
(function (UploadRequest) {
|
|
4
|
-
/** Format of the uploaded file */
|
|
5
|
-
UploadRequest.Format = {
|
|
6
|
-
Json: "json",
|
|
7
|
-
Csv: "csv",
|
|
8
|
-
};
|
|
9
|
-
})(UploadRequest || (UploadRequest = {}));
|