Skip to content

Commit be12509

Browse files
refactor: simplify upload code system API and remove user_id fields
Major refactoring of the upload code system API to simplify the interface and improve consistency. The upload request structure has been consolidated and user ID references have been removed from multiple templates to support a more streamlined architecture. Key changes: - Unified upload request structure with simplified parameter handling - Removed user_id fields from chat, workflow, FHIR provider, and other templates - Updated upload code system to return asynchronous processing status - Consolidated upload request types into a single interface - Improved documentation for asynchronous processing workflow 🌿 Generated with Fern
1 parent 669e17c commit be12509

28 files changed

+78
-239
lines changed

changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 6.0.0 - 2026-02-10
2+
* refactor: simplify upload code system API and remove user_id fields
3+
* Major refactoring of the upload code system API to simplify the interface and improve consistency. The upload request structure has been consolidated and user ID references have been removed from multiple templates to support a more streamlined architecture.
4+
* Key changes:
5+
* Unified upload request structure with simplified parameter handling
6+
* Removed user_id fields from chat, workflow, FHIR provider, and other templates
7+
* Updated upload code system to return asynchronous processing status
8+
* Consolidated upload request types into a single interface
9+
* Improved documentation for asynchronous processing workflow
10+
* 🌿 Generated with Fern
11+
112
## 5.3.0 - 2026-02-09
213
* feat: add custom code system export endpoint
314
* Add new exportCustomCodeSystem method to the construe client that allows exporting custom (non-builtin) code systems as JSON files. This feature enables users to backup and transfer code systems between instances.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phenoml",
3-
"version": "5.3.0",
3+
"version": "6.0.0",
44
"private": false,
55
"repository": "github:PhenoML/phenoml-ts-sdk",
66
"type": "commonjs",

reference.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,9 @@ await client.cohort.analyze({
11541154
<dd>
11551155

11561156
Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
1157-
Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
1158-
subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
1157+
Returns 202 immediately; embedding generation runs asynchronously. Poll
1158+
GET /construe/codes/systems/{codesystem}?version={version} to check when status
1159+
transitions from "processing" to "ready" or "failed".
11591160
</dd>
11601161
</dl>
11611162
</dd>
@@ -1171,12 +1172,9 @@ subsequently use the code system for construe/extract and lang2fhir/create (comi
11711172

11721173
```typescript
11731174
await client.construe.uploadCodeSystem({
1174-
format: "csv",
11751175
name: "CUSTOM_CODES",
11761176
version: "1.0",
1177-
file: "file",
1178-
code_col: "code",
1179-
desc_col: "description"
1177+
format: "csv"
11801178
});
11811179

11821180
```
@@ -1193,7 +1191,7 @@ await client.construe.uploadCodeSystem({
11931191
<dl>
11941192
<dd>
11951193

1196-
**request:** `phenoml.UploadRequest`
1194+
**request:** `phenoml.construe.UploadRequest`
11971195

11981196
</dd>
11991197
</dl>

src/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export class phenomlClient {
4040
{
4141
"X-Fern-Language": "JavaScript",
4242
"X-Fern-SDK-Name": "phenoml",
43-
"X-Fern-SDK-Version": "5.3.0",
44-
"User-Agent": "phenoml/5.3.0",
43+
"X-Fern-SDK-Version": "6.0.0",
44+
"User-Agent": "phenoml/6.0.0",
4545
"X-Fern-Runtime": core.RUNTIME.type,
4646
"X-Fern-Runtime-Version": core.RUNTIME.version,
4747
},

src/api/resources/agent/types/ChatMessageTemplate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export interface ChatMessageTemplate {
1919
created?: string;
2020
/** Message updated time */
2121
updated?: string;
22-
/** User ID */
23-
user_id?: string;
2422
/** Function name */
2523
function_name?: string;
2624
/** Function arguments */

src/api/resources/agent/types/ChatSessionTemplate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
export interface ChatSessionTemplate {
44
/** Chat session ID */
55
id?: string;
6-
/** User ID */
7-
user_id?: string;
86
/** Chat session ID */
97
session_id?: string;
108
/** Chat session status */

src/api/resources/construe/client/Client.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ export class Construe {
2222

2323
/**
2424
* Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
25-
* Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
26-
* subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
25+
* Returns 202 immediately; embedding generation runs asynchronously. Poll
26+
* GET /construe/codes/systems/{codesystem}?version={version} to check when status
27+
* transitions from "processing" to "ready" or "failed".
2728
*
2829
* @param {phenoml.construe.UploadRequest} request
2930
* @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
@@ -37,12 +38,9 @@ export class Construe {
3738
*
3839
* @example
3940
* await client.construe.uploadCodeSystem({
40-
* format: "csv",
4141
* name: "CUSTOM_CODES",
4242
* version: "1.0",
43-
* file: "file",
44-
* code_col: "code",
45-
* desc_col: "description"
43+
* format: "csv"
4644
* })
4745
*/
4846
public uploadCodeSystem(

src/api/resources/construe/types/UploadRequestJson.ts renamed to src/api/resources/construe/client/requests/UploadRequest.ts

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
// This file was auto-generated by Fern from our API Definition.
22

3-
import type * as phenoml from "../../../index.js";
3+
import type * as phenoml from "../../../../index.js";
44

55
/**
6-
* Upload codes in JSON format. Either 'file' or 'codes' must be provided.
7-
* If both are provided, 'codes' takes precedence.
6+
* @example
7+
* {
8+
* name: "CUSTOM_CODES",
9+
* version: "1.0",
10+
* format: "csv"
11+
* }
812
*/
9-
export interface UploadRequestJson {
13+
export interface UploadRequest {
1014
/**
1115
* Name of the code system. Names are case-insensitive and stored uppercase.
1216
* Builtin system names (e.g. ICD-10-CM, SNOMED_CT_US_LITE, LOINC, CPT, etc.) are
@@ -17,13 +21,22 @@ export interface UploadRequestJson {
1721
version: string;
1822
/** Optional revision number */
1923
revision?: number;
24+
/** Upload format */
25+
format: UploadRequest.Format;
2026
/**
21-
* The file contents as a base64-encoded JSON array string.
22-
* Prefer using 'codes' instead to pass the array directly without base64 encoding.
27+
* The file contents as a base64-encoded string.
28+
* For CSV format, this is the CSV file contents.
29+
* For JSON format, this is a base64-encoded JSON array; prefer using 'codes' instead.
2330
*/
2431
file?: string;
32+
/** Column name containing codes (required for CSV format) */
33+
code_col?: string;
34+
/** Column name containing descriptions (required for CSV format) */
35+
desc_col?: string;
36+
/** Optional column name containing long definitions (for CSV format) */
37+
defn_col?: string;
2538
/**
26-
* The codes to upload as a JSON array.
39+
* The codes to upload as a JSON array (JSON format only).
2740
* This is the preferred way to upload JSON codes, as it avoids unnecessary base64 encoding.
2841
* If both 'codes' and 'file' are provided, 'codes' takes precedence.
2942
*/
@@ -34,10 +47,13 @@ export interface UploadRequestJson {
3447
* When false (default), uploading a duplicate returns 409 Conflict.
3548
*/
3649
replace?: boolean;
37-
/**
38-
* If true, returns 202 Accepted immediately after validation and starts processing
39-
* in the background. Poll GET /construe/codes/systems/{name}?version={version} to
40-
* check when status transitions from "processing" to "ready" or "failed".
41-
*/
42-
async?: boolean;
50+
}
51+
52+
export namespace UploadRequest {
53+
/** Upload format */
54+
export const Format = {
55+
Csv: "csv",
56+
Json: "json",
57+
} as const;
58+
export type Format = (typeof Format)[keyof typeof Format];
4359
}

src/api/resources/construe/client/requests/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export type { GetConstrueCodesCodesystemSearchSemanticRequest } from "./GetConst
66
export type { GetConstrueCodesCodesystemSearchTextRequest } from "./GetConstrueCodesCodesystemSearchTextRequest.js";
77
export type { GetConstrueCodesSystemsCodesystemExportRequest } from "./GetConstrueCodesSystemsCodesystemExportRequest.js";
88
export type { GetConstrueCodesSystemsCodesystemRequest } from "./GetConstrueCodesSystemsCodesystemRequest.js";
9+
export type { UploadRequest } from "./UploadRequest.js";

src/api/resources/construe/types/ConstrueUploadCodeSystemResponse.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
export interface ConstrueUploadCodeSystemResponse {
44
status?: string;
5+
name?: string;
6+
version?: string;
57
}

0 commit comments

Comments
 (0)