phenoml 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +2 -3
  3. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +2 -3
  4. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.ts +1 -4
  5. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.ts +0 -2
  6. package/dist/cjs/api/resources/agent/types/AgentTemplate.d.ts +0 -2
  7. package/dist/cjs/api/resources/agent/types/PromptTemplate.d.ts +0 -2
  8. package/dist/cjs/api/resources/construe/client/Client.d.ts +129 -0
  9. package/dist/cjs/api/resources/construe/client/Client.js +429 -0
  10. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemCodeIdRequest.d.ts +10 -0
  11. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemCodeIdRequest.js +3 -0
  12. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemRequest.d.ts +16 -0
  13. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemRequest.js +3 -0
  14. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchSemanticRequest.d.ts +16 -0
  15. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchSemanticRequest.js +3 -0
  16. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchTextRequest.d.ts +16 -0
  17. package/dist/cjs/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchTextRequest.js +3 -0
  18. package/dist/cjs/api/resources/construe/client/requests/index.d.ts +4 -0
  19. package/dist/cjs/api/resources/construe/errors/NotFoundError.d.ts +5 -0
  20. package/dist/cjs/api/resources/construe/errors/NotFoundError.js +50 -0
  21. package/dist/cjs/api/resources/construe/errors/NotImplementedError.d.ts +5 -0
  22. package/dist/cjs/api/resources/construe/errors/NotImplementedError.js +50 -0
  23. package/dist/cjs/api/resources/construe/errors/ServiceUnavailableError.d.ts +5 -0
  24. package/dist/cjs/api/resources/construe/errors/ServiceUnavailableError.js +50 -0
  25. package/dist/cjs/api/resources/construe/errors/index.d.ts +3 -0
  26. package/dist/cjs/api/resources/construe/errors/index.js +3 -0
  27. package/dist/cjs/api/resources/construe/types/CodeResponse.d.ts +8 -0
  28. package/dist/cjs/api/resources/construe/types/CodeResponse.js +3 -0
  29. package/dist/cjs/api/resources/construe/types/CodeSystemDetails.d.ts +10 -0
  30. package/dist/cjs/api/resources/construe/types/CodeSystemDetails.js +3 -0
  31. package/dist/cjs/api/resources/construe/types/CodeSystemInfo.d.ts +6 -0
  32. package/dist/cjs/api/resources/construe/types/CodeSystemInfo.js +3 -0
  33. package/dist/cjs/api/resources/construe/types/GetCodeResponse.d.ts +10 -0
  34. package/dist/cjs/api/resources/construe/types/GetCodeResponse.js +3 -0
  35. package/dist/cjs/api/resources/construe/types/ListCodeSystemsResponse.d.ts +4 -0
  36. package/dist/cjs/api/resources/construe/types/ListCodeSystemsResponse.js +3 -0
  37. package/dist/cjs/api/resources/construe/types/ListCodesResponse.d.ts +9 -0
  38. package/dist/cjs/api/resources/construe/types/ListCodesResponse.js +3 -0
  39. package/dist/cjs/api/resources/construe/types/SemanticSearchResponse.d.ts +6 -0
  40. package/dist/cjs/api/resources/construe/types/SemanticSearchResponse.js +3 -0
  41. package/dist/cjs/api/resources/construe/types/SemanticSearchResult.d.ts +4 -0
  42. package/dist/cjs/api/resources/construe/types/SemanticSearchResult.js +3 -0
  43. package/dist/cjs/api/resources/construe/types/TextSearchResponse.d.ts +8 -0
  44. package/dist/cjs/api/resources/construe/types/TextSearchResponse.js +3 -0
  45. package/dist/cjs/api/resources/construe/types/TextSearchResult.d.ts +4 -0
  46. package/dist/cjs/api/resources/construe/types/TextSearchResult.js +3 -0
  47. package/dist/cjs/api/resources/construe/types/index.d.ts +10 -0
  48. package/dist/cjs/api/resources/construe/types/index.js +10 -0
  49. package/dist/cjs/version.d.ts +1 -1
  50. package/dist/cjs/version.js +1 -1
  51. package/dist/esm/Client.mjs +2 -2
  52. package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +2 -3
  53. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +2 -3
  54. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.mts +1 -4
  55. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.mts +0 -2
  56. package/dist/esm/api/resources/agent/types/AgentTemplate.d.mts +0 -2
  57. package/dist/esm/api/resources/agent/types/PromptTemplate.d.mts +0 -2
  58. package/dist/esm/api/resources/construe/client/Client.d.mts +129 -0
  59. package/dist/esm/api/resources/construe/client/Client.mjs +429 -0
  60. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemCodeIdRequest.d.mts +10 -0
  61. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemCodeIdRequest.mjs +2 -0
  62. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemRequest.d.mts +16 -0
  63. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemRequest.mjs +2 -0
  64. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchSemanticRequest.d.mts +16 -0
  65. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchSemanticRequest.mjs +2 -0
  66. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchTextRequest.d.mts +16 -0
  67. package/dist/esm/api/resources/construe/client/requests/GetConstrueCodesCodesystemSearchTextRequest.mjs +2 -0
  68. package/dist/esm/api/resources/construe/client/requests/index.d.mts +4 -0
  69. package/dist/esm/api/resources/construe/errors/NotFoundError.d.mts +5 -0
  70. package/dist/esm/api/resources/construe/errors/NotFoundError.mjs +13 -0
  71. package/dist/esm/api/resources/construe/errors/NotImplementedError.d.mts +5 -0
  72. package/dist/esm/api/resources/construe/errors/NotImplementedError.mjs +13 -0
  73. package/dist/esm/api/resources/construe/errors/ServiceUnavailableError.d.mts +5 -0
  74. package/dist/esm/api/resources/construe/errors/ServiceUnavailableError.mjs +13 -0
  75. package/dist/esm/api/resources/construe/errors/index.d.mts +3 -0
  76. package/dist/esm/api/resources/construe/errors/index.mjs +3 -0
  77. package/dist/esm/api/resources/construe/types/CodeResponse.d.mts +8 -0
  78. package/dist/esm/api/resources/construe/types/CodeResponse.mjs +2 -0
  79. package/dist/esm/api/resources/construe/types/CodeSystemDetails.d.mts +10 -0
  80. package/dist/esm/api/resources/construe/types/CodeSystemDetails.mjs +2 -0
  81. package/dist/esm/api/resources/construe/types/CodeSystemInfo.d.mts +6 -0
  82. package/dist/esm/api/resources/construe/types/CodeSystemInfo.mjs +2 -0
  83. package/dist/esm/api/resources/construe/types/GetCodeResponse.d.mts +10 -0
  84. package/dist/esm/api/resources/construe/types/GetCodeResponse.mjs +2 -0
  85. package/dist/esm/api/resources/construe/types/ListCodeSystemsResponse.d.mts +4 -0
  86. package/dist/esm/api/resources/construe/types/ListCodeSystemsResponse.mjs +2 -0
  87. package/dist/esm/api/resources/construe/types/ListCodesResponse.d.mts +9 -0
  88. package/dist/esm/api/resources/construe/types/ListCodesResponse.mjs +2 -0
  89. package/dist/esm/api/resources/construe/types/SemanticSearchResponse.d.mts +6 -0
  90. package/dist/esm/api/resources/construe/types/SemanticSearchResponse.mjs +2 -0
  91. package/dist/esm/api/resources/construe/types/SemanticSearchResult.d.mts +4 -0
  92. package/dist/esm/api/resources/construe/types/SemanticSearchResult.mjs +2 -0
  93. package/dist/esm/api/resources/construe/types/TextSearchResponse.d.mts +8 -0
  94. package/dist/esm/api/resources/construe/types/TextSearchResponse.mjs +2 -0
  95. package/dist/esm/api/resources/construe/types/TextSearchResult.d.mts +4 -0
  96. package/dist/esm/api/resources/construe/types/TextSearchResult.mjs +2 -0
  97. package/dist/esm/api/resources/construe/types/index.d.mts +10 -0
  98. package/dist/esm/api/resources/construe/types/index.mjs +10 -0
  99. package/dist/esm/version.d.mts +1 -1
  100. package/dist/esm/version.mjs +1 -1
  101. package/package.json +1 -1
  102. package/reference.md +394 -3
@@ -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": "1.0.1",
56
- "User-Agent": "phenoml/1.0.1",
55
+ "X-Fern-SDK-Version": "2.0.0",
56
+ "User-Agent": "phenoml/2.0.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) });
@@ -24,8 +24,7 @@ export declare class Prompts {
24
24
  * @example
25
25
  * await client.agent.prompts.create({
26
26
  * name: "Medical Assistant System Prompt",
27
- * content: "You are a helpful medical assistant specialized in FHIR data processing...",
28
- * is_active: true
27
+ * content: "You are a helpful medical assistant specialized in FHIR data processing..."
29
28
  * })
30
29
  */
31
30
  create(request: phenoml.agent.AgentPromptsCreateRequest, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentPromptsResponse>;
@@ -79,7 +78,7 @@ export declare class Prompts {
79
78
  update(id: string, request?: phenoml.agent.AgentPromptsUpdateRequest, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<phenoml.agent.AgentPromptsResponse>;
80
79
  private __update;
81
80
  /**
82
- * Soft deletes a prompt by setting is_active to false
81
+ * Deletes a prompt
83
82
  *
84
83
  * @param {string} id - Prompt ID
85
84
  * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
@@ -67,8 +67,7 @@ class Prompts {
67
67
  * @example
68
68
  * await client.agent.prompts.create({
69
69
  * name: "Medical Assistant System Prompt",
70
- * content: "You are a helpful medical assistant specialized in FHIR data processing...",
71
- * is_active: true
70
+ * content: "You are a helpful medical assistant specialized in FHIR data processing..."
72
71
  * })
73
72
  */
74
73
  create(request, requestOptions) {
@@ -336,7 +335,7 @@ class Prompts {
336
335
  });
337
336
  }
338
337
  /**
339
- * Soft deletes a prompt by setting is_active to false
338
+ * Deletes a prompt
340
339
  *
341
340
  * @param {string} id - Prompt ID
342
341
  * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
@@ -2,8 +2,7 @@
2
2
  * @example
3
3
  * {
4
4
  * name: "Medical Assistant System Prompt",
5
- * content: "You are a helpful medical assistant specialized in FHIR data processing...",
6
- * is_active: true
5
+ * content: "You are a helpful medical assistant specialized in FHIR data processing..."
7
6
  * }
8
7
  */
9
8
  export interface AgentPromptsCreateRequest {
@@ -15,8 +14,6 @@ export interface AgentPromptsCreateRequest {
15
14
  content: string;
16
15
  /** Whether this is a default prompt */
17
16
  is_default?: boolean;
18
- /** Whether the prompt is active */
19
- is_active: boolean;
20
17
  /** Tags for categorizing the prompt */
21
18
  tags?: string[];
22
19
  }
@@ -11,8 +11,6 @@ export interface AgentPromptsUpdateRequest {
11
11
  content?: string;
12
12
  /** Whether this is a default prompt */
13
13
  is_default?: boolean;
14
- /** Whether the prompt is active */
15
- is_active?: boolean;
16
14
  /** Tags for categorizing the prompt */
17
15
  tags?: string[];
18
16
  }
@@ -9,8 +9,6 @@ export interface AgentTemplate {
9
9
  prompts?: string[];
10
10
  /** Array of MCP server tool IDs used by this agent */
11
11
  tools?: string[];
12
- /** Whether the agent is active */
13
- is_active?: boolean;
14
12
  /** Tags for categorizing the agent */
15
13
  tags?: string[];
16
14
  /** FHIR provider ID(s) - must be valid UUIDs from existing FHIR providers */
@@ -9,8 +9,6 @@ export interface PromptTemplate {
9
9
  content?: string;
10
10
  /** Whether this is a default prompt */
11
11
  is_default?: boolean;
12
- /** Whether the prompt is active */
13
- is_active?: boolean;
14
12
  /** Tags for categorizing the prompt */
15
13
  tags?: string[];
16
14
  }
@@ -52,5 +52,134 @@ export declare class Construe {
52
52
  */
53
53
  extractCodes(request: phenoml.construe.ExtractRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ExtractCodesResult>;
54
54
  private __extractCodes;
55
+ /**
56
+ * Returns metadata about all available code systems including built-in and custom systems.
57
+ *
58
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
59
+ *
60
+ * @throws {@link phenoml.construe.UnauthorizedError}
61
+ * @throws {@link phenoml.construe.InternalServerError}
62
+ *
63
+ * @example
64
+ * await client.construe.listAvailableCodeSystems()
65
+ */
66
+ listAvailableCodeSystems(requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ListCodeSystemsResponse>;
67
+ private __listAvailableCodeSystems;
68
+ /**
69
+ * Returns a paginated list of all codes in the specified code system.
70
+ *
71
+ * @param {string} codesystem - Code system name (e.g., "ICD-10-CM", "SNOMED_CT_US_LITE")
72
+ * @param {phenoml.construe.GetConstrueCodesCodesystemRequest} request
73
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link phenoml.construe.BadRequestError}
76
+ * @throws {@link phenoml.construe.UnauthorizedError}
77
+ * @throws {@link phenoml.construe.NotFoundError}
78
+ * @throws {@link phenoml.construe.InternalServerError}
79
+ *
80
+ * @example
81
+ * await client.construe.listCodesInACodeSystem("ICD-10-CM", {
82
+ * version: "2025",
83
+ * cursor: "cursor",
84
+ * limit: 1
85
+ * })
86
+ */
87
+ listCodesInACodeSystem(codesystem: string, request?: phenoml.construe.GetConstrueCodesCodesystemRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.ListCodesResponse>;
88
+ private __listCodesInACodeSystem;
89
+ /**
90
+ * Returns details for a specific code within a code system.
91
+ *
92
+ * @param {string} codesystem - Code system name
93
+ * @param {string} codeId - The code identifier
94
+ * @param {phenoml.construe.GetConstrueCodesCodesystemCodeIdRequest} request
95
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
96
+ *
97
+ * @throws {@link phenoml.construe.BadRequestError}
98
+ * @throws {@link phenoml.construe.UnauthorizedError}
99
+ * @throws {@link phenoml.construe.NotFoundError}
100
+ * @throws {@link phenoml.construe.InternalServerError}
101
+ *
102
+ * @example
103
+ * await client.construe.getASpecificCode("ICD-10-CM", "E11.65", {
104
+ * version: "version"
105
+ * })
106
+ */
107
+ getASpecificCode(codesystem: string, codeId: string, request?: phenoml.construe.GetConstrueCodesCodesystemCodeIdRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.GetCodeResponse>;
108
+ private __getASpecificCode;
109
+ /**
110
+ * Performs semantic similarity search using vector embeddings.
111
+ *
112
+ * **When to use**: Best for natural language queries where you want to find conceptually
113
+ * related codes, even when different terminology is used. The search understands meaning,
114
+ * not just keywords.
115
+ *
116
+ * **Examples**:
117
+ * - Query "trouble breathing at night" finds codes like "Sleep apnea", "Orthopnea",
118
+ * "Nocturnal dyspnea" — semantically related but no exact keyword matches
119
+ * - Query "heart problems" finds "Myocardial infarction", "Cardiac arrest", "Arrhythmia"
120
+ *
121
+ * **Trade-offs**: Slower than text search (requires embedding generation), but finds
122
+ * conceptually similar results that keyword search would miss.
123
+ *
124
+ * See also: `/search/text` for faster keyword-based lookup with typo tolerance.
125
+ *
126
+ * @param {string} codesystem - Code system name
127
+ * @param {phenoml.construe.GetConstrueCodesCodesystemSearchSemanticRequest} request
128
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
129
+ *
130
+ * @throws {@link phenoml.construe.BadRequestError}
131
+ * @throws {@link phenoml.construe.UnauthorizedError}
132
+ * @throws {@link phenoml.construe.NotFoundError}
133
+ * @throws {@link phenoml.construe.InternalServerError}
134
+ *
135
+ * @example
136
+ * await client.construe.semanticSearchEmbeddingBased("ICD-10-CM", {
137
+ * text: "patient has trouble breathing at night and wakes up gasping",
138
+ * version: "version",
139
+ * limit: 1
140
+ * })
141
+ */
142
+ semanticSearchEmbeddingBased(codesystem: string, request: phenoml.construe.GetConstrueCodesCodesystemSearchSemanticRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.SemanticSearchResponse>;
143
+ private __semanticSearchEmbeddingBased;
144
+ /**
145
+ * Performs fast full-text search over code IDs and descriptions.
146
+ *
147
+ * **When to use**: Best for autocomplete UIs, code lookup, or when users know part of
148
+ * the code ID or specific keywords. Fast response times suitable for typeahead interfaces.
149
+ *
150
+ * **Features**:
151
+ * - Substring matching on code IDs (e.g., "11.65" finds "E11.65")
152
+ * - Typo tolerance on descriptions (not on code IDs)
153
+ * - Fast response times (~10-50ms)
154
+ *
155
+ * **Examples**:
156
+ * - Query "E11" finds all codes starting with E11 (diabetes codes)
157
+ * - Query "diabtes" (typo) still finds "diabetes" codes
158
+ *
159
+ * **Trade-offs**: Faster than semantic search, but only matches keywords/substrings.
160
+ * Won't find conceptually related codes with different terminology.
161
+ *
162
+ * See also: `/search/semantic` for finding conceptually similar codes.
163
+ *
164
+ * @param {string} codesystem - Code system name
165
+ * @param {phenoml.construe.GetConstrueCodesCodesystemSearchTextRequest} request
166
+ * @param {Construe.RequestOptions} requestOptions - Request-specific configuration.
167
+ *
168
+ * @throws {@link phenoml.construe.BadRequestError}
169
+ * @throws {@link phenoml.construe.UnauthorizedError}
170
+ * @throws {@link phenoml.construe.NotFoundError}
171
+ * @throws {@link phenoml.construe.InternalServerError}
172
+ * @throws {@link phenoml.construe.NotImplementedError}
173
+ * @throws {@link phenoml.construe.ServiceUnavailableError}
174
+ *
175
+ * @example
176
+ * await client.construe.textSearchKeywordBased("ICD-10-CM", {
177
+ * q: "E11.65",
178
+ * version: "version",
179
+ * limit: 1
180
+ * })
181
+ */
182
+ textSearchKeywordBased(codesystem: string, request: phenoml.construe.GetConstrueCodesCodesystemSearchTextRequest, requestOptions?: Construe.RequestOptions): core.HttpResponsePromise<phenoml.construe.TextSearchResponse>;
183
+ private __textSearchKeywordBased;
55
184
  protected _getAuthorizationHeader(): Promise<string>;
56
185
  }