phenoml 13.0.0 → 14.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.
- package/dist/cjs/BaseClient.d.ts +3 -0
- package/dist/cjs/BaseClient.js +17 -2
- package/dist/cjs/api/resources/agent/client/Client.d.ts +24 -12
- package/dist/cjs/api/resources/agent/client/Client.js +41 -21
- package/dist/cjs/api/resources/agent/client/requests/AgentChatRequest.d.ts +11 -0
- package/dist/cjs/api/resources/agent/client/requests/AgentStreamChatRequest.d.ts +1 -0
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +13 -25
- package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +19 -70
- package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.ts +4 -1
- package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.ts +7 -1
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +4 -1
- package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +5 -2
- package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +4 -1
- package/dist/cjs/api/resources/cohort/client/Client.js +1 -1
- package/dist/cjs/api/resources/construe/client/Client.d.ts +95 -11
- package/dist/cjs/api/resources/construe/client/Client.js +134 -22
- package/dist/cjs/api/resources/construe/client/requests/ExtractRequest.d.ts +60 -1
- package/dist/cjs/api/resources/construe/client/requests/FeedbackRequest.d.ts +14 -7
- package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +18 -1
- package/dist/cjs/api/resources/fhir/client/Client.js +10 -6
- package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +10 -7
- package/dist/cjs/api/resources/fhirProvider/client/Client.js +17 -14
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.ts +5 -3
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.ts +1 -1
- package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.ts +1 -1
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.ts +6 -4
- package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +10 -5
- package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +17 -6
- package/dist/cjs/api/resources/lang2Fhir/client/Client.js +23 -12
- package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.ts +2 -1
- package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateRequest.d.ts +9 -2
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +2 -1
- package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +1 -1
- package/dist/cjs/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.ts +3 -1
- package/dist/cjs/api/resources/lang2Fhir/types/SearchResponse.d.ts +2 -2
- package/dist/cjs/api/resources/summary/client/Client.d.ts +74 -9
- package/dist/cjs/api/resources/summary/client/Client.js +80 -15
- package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.d.ts +67 -11
- package/dist/cjs/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.ts +4 -4
- package/dist/cjs/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.ts +4 -4
- package/dist/cjs/api/resources/summary/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/summary/types/index.js +0 -2
- package/dist/cjs/api/resources/tools/client/Client.d.ts +7 -3
- package/dist/cjs/api/resources/tools/client/Client.js +11 -7
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.ts +1 -0
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.ts +3 -2
- package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +3 -1
- package/dist/cjs/api/resources/tools/resources/mcpServer/client/Client.js +4 -4
- package/dist/cjs/api/resources/tools/resources/mcpServer/resources/tools/client/Client.js +4 -4
- package/dist/cjs/api/resources/tools/types/McpServer.d.ts +10 -0
- package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +12 -16
- package/dist/cjs/api/resources/tools/types/McpServerTool.d.ts +14 -0
- package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +7 -20
- package/dist/cjs/api/resources/tools/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/tools/types/index.js +2 -0
- package/dist/cjs/api/resources/workflows/client/Client.d.ts +21 -9
- package/dist/cjs/api/resources/workflows/client/Client.js +43 -15
- package/dist/cjs/api/resources/workflows/client/requests/CreateWorkflowRequest.d.ts +3 -2
- package/dist/cjs/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.ts +11 -1
- package/dist/cjs/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.ts +6 -5
- package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
- package/dist/cjs/core/auth/AuthProvider.js +7 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
- package/dist/cjs/core/auth/BasicAuth.js +7 -1
- package/dist/cjs/core/auth/index.d.ts +1 -1
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/fetcher/Fetcher.d.ts +8 -0
- package/dist/cjs/core/fetcher/Fetcher.js +13 -8
- package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
- package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
- package/dist/cjs/core/url/index.d.ts +1 -0
- package/dist/cjs/core/url/index.js +3 -1
- package/dist/cjs/core/url/qs.d.ts +2 -1
- package/dist/cjs/core/url/qs.js +24 -12
- package/dist/cjs/errors/handleNonStatusCodeError.js +4 -1
- package/dist/cjs/errors/phenomlError.d.ts +3 -1
- package/dist/cjs/errors/phenomlError.js +4 -1
- package/dist/cjs/errors/phenomlTimeoutError.d.ts +4 -1
- package/dist/cjs/errors/phenomlTimeoutError.js +4 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +3 -0
- package/dist/esm/BaseClient.mjs +17 -2
- package/dist/esm/api/resources/agent/client/Client.d.mts +24 -12
- package/dist/esm/api/resources/agent/client/Client.mjs +41 -21
- package/dist/esm/api/resources/agent/client/requests/AgentChatRequest.d.mts +11 -0
- package/dist/esm/api/resources/agent/client/requests/AgentStreamChatRequest.d.mts +1 -0
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +13 -25
- package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +19 -70
- package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.mts +4 -1
- package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.mts +7 -1
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +4 -1
- package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +5 -2
- package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +4 -1
- package/dist/esm/api/resources/cohort/client/Client.mjs +1 -1
- package/dist/esm/api/resources/construe/client/Client.d.mts +95 -11
- package/dist/esm/api/resources/construe/client/Client.mjs +134 -22
- package/dist/esm/api/resources/construe/client/requests/ExtractRequest.d.mts +60 -1
- package/dist/esm/api/resources/construe/client/requests/FeedbackRequest.d.mts +14 -7
- package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +18 -1
- package/dist/esm/api/resources/fhir/client/Client.mjs +10 -6
- package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +10 -7
- package/dist/esm/api/resources/fhirProvider/client/Client.mjs +17 -14
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.mts +5 -3
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.mts +1 -1
- package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.mts +1 -1
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.mts +6 -4
- package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +10 -5
- package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +17 -6
- package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +23 -12
- package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.mts +2 -1
- package/dist/esm/api/resources/lang2Fhir/client/requests/CreateRequest.d.mts +9 -2
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +2 -1
- package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +1 -1
- package/dist/esm/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.mts +3 -1
- package/dist/esm/api/resources/lang2Fhir/types/SearchResponse.d.mts +2 -2
- package/dist/esm/api/resources/summary/client/Client.d.mts +74 -9
- package/dist/esm/api/resources/summary/client/Client.mjs +80 -15
- package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.d.mts +67 -11
- package/dist/esm/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.mts +4 -4
- package/dist/esm/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.mts +4 -4
- package/dist/esm/api/resources/summary/types/index.d.mts +0 -2
- package/dist/esm/api/resources/summary/types/index.mjs +0 -2
- package/dist/esm/api/resources/tools/client/Client.d.mts +7 -3
- package/dist/esm/api/resources/tools/client/Client.mjs +11 -7
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.mts +1 -0
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.mts +3 -2
- package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +3 -1
- package/dist/esm/api/resources/tools/resources/mcpServer/client/Client.mjs +4 -4
- package/dist/esm/api/resources/tools/resources/mcpServer/resources/tools/client/Client.mjs +4 -4
- package/dist/esm/api/resources/tools/types/McpServer.d.mts +10 -0
- package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +12 -16
- package/dist/esm/api/resources/tools/types/McpServerTool.d.mts +14 -0
- package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +7 -20
- package/dist/esm/api/resources/tools/types/index.d.mts +2 -0
- package/dist/esm/api/resources/tools/types/index.mjs +2 -0
- package/dist/esm/api/resources/workflows/client/Client.d.mts +21 -9
- package/dist/esm/api/resources/workflows/client/Client.mjs +43 -15
- package/dist/esm/api/resources/workflows/client/requests/CreateWorkflowRequest.d.mts +3 -2
- package/dist/esm/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.mts +11 -1
- package/dist/esm/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.mts +6 -5
- package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
- package/dist/esm/core/auth/AuthProvider.mjs +6 -1
- package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
- package/dist/esm/core/auth/BasicAuth.mjs +7 -1
- package/dist/esm/core/auth/index.d.mts +1 -1
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +8 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +13 -8
- package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
- package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
- package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
- package/dist/esm/core/url/index.d.mts +1 -0
- package/dist/esm/core/url/index.mjs +1 -0
- package/dist/esm/core/url/qs.d.mts +2 -1
- package/dist/esm/core/url/qs.mjs +24 -12
- package/dist/esm/errors/handleNonStatusCodeError.mjs +4 -1
- package/dist/esm/errors/phenomlError.d.mts +3 -1
- package/dist/esm/errors/phenomlError.mjs +4 -1
- package/dist/esm/errors/phenomlTimeoutError.d.mts +4 -1
- package/dist/esm/errors/phenomlTimeoutError.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +140 -124
- package/dist/cjs/api/resources/summary/types/FhirBundle.d.ts +0 -13
- package/dist/cjs/api/resources/summary/types/FhirResource.d.ts +0 -6
- package/dist/esm/api/resources/summary/types/FhirBundle.d.mts +0 -13
- package/dist/esm/api/resources/summary/types/FhirResource.d.mts +0 -6
- /package/dist/cjs/api/resources/{summary/types/FhirBundle.js → tools/types/McpServer.js} +0 -0
- /package/dist/cjs/api/resources/{summary/types/FhirResource.js → tools/types/McpServerTool.js} +0 -0
- /package/dist/esm/api/resources/{summary/types/FhirBundle.mjs → tools/types/McpServer.mjs} +0 -0
- /package/dist/esm/api/resources/{summary/types/FhirResource.mjs → tools/types/McpServerTool.mjs} +0 -0
|
@@ -30,7 +30,24 @@ export declare class ConstrueClient {
|
|
|
30
30
|
* await client.construe.uploadCodeSystem({
|
|
31
31
|
* name: "CUSTOM_CODES",
|
|
32
32
|
* version: "1.0",
|
|
33
|
-
* format: "
|
|
33
|
+
* format: "json",
|
|
34
|
+
* codes: [{
|
|
35
|
+
* code: "X001",
|
|
36
|
+
* description: "Example custom code 1"
|
|
37
|
+
* }, {
|
|
38
|
+
* code: "X002",
|
|
39
|
+
* description: "Example custom code 2"
|
|
40
|
+
* }]
|
|
41
|
+
* })
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* await client.construe.uploadCodeSystem({
|
|
45
|
+
* name: "CUSTOM_CODES",
|
|
46
|
+
* version: "1.0",
|
|
47
|
+
* format: "csv",
|
|
48
|
+
* file: "Y29kZSxkZXNjcmlwdGlvbgpYMDAxLEV4YW1wbGUgY3VzdG9tIGNvZGUgMQo=",
|
|
49
|
+
* code_col: "code",
|
|
50
|
+
* desc_col: "description"
|
|
34
51
|
* })
|
|
35
52
|
*/
|
|
36
53
|
uploadCodeSystem(request: phenoml.construe.UploadRequest, requestOptions?: ConstrueClient.RequestOptions): core.HttpResponsePromise<phenoml.construe.ConstrueUploadCodeSystemResponse>;
|
|
@@ -52,7 +69,66 @@ export declare class ConstrueClient {
|
|
|
52
69
|
*
|
|
53
70
|
* @example
|
|
54
71
|
* await client.construe.extractCodes({
|
|
55
|
-
* text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney"
|
|
72
|
+
* text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney.",
|
|
73
|
+
* system: {
|
|
74
|
+
* name: "ICD-10-CM",
|
|
75
|
+
* version: "2025"
|
|
76
|
+
* }
|
|
77
|
+
* })
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.construe.extractCodes({
|
|
81
|
+
* text: "45-year-old male presents with chest pain radiating to left arm, shortness of breath, and diaphoresis. ECG shows ST elevation in leads II, III, and aVF.",
|
|
82
|
+
* system: {
|
|
83
|
+
* name: "SNOMED_CT_US_LITE",
|
|
84
|
+
* version: "20240901"
|
|
85
|
+
* },
|
|
86
|
+
* config: {
|
|
87
|
+
* chunking_method: "sentences",
|
|
88
|
+
* validation_method: "simple",
|
|
89
|
+
* include_rationale: true,
|
|
90
|
+
* include_citations: true
|
|
91
|
+
* }
|
|
92
|
+
* })
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* await client.construe.extractCodes({
|
|
96
|
+
* text: "Start Metformin 500mg twice daily for type 2 diabetes. Continue Lisinopril 10mg daily for hypertension. Add Atorvastatin 20mg at bedtime.",
|
|
97
|
+
* system: {
|
|
98
|
+
* name: "RXNORM",
|
|
99
|
+
* version: "11042024"
|
|
100
|
+
* },
|
|
101
|
+
* config: {
|
|
102
|
+
* validation_method: "medication_search",
|
|
103
|
+
* include_rationale: true
|
|
104
|
+
* }
|
|
105
|
+
* })
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* await client.construe.extractCodes({
|
|
109
|
+
* text: "Patient diagnosed with Type 2 diabetes mellitus with diabetic chronic kidney disease, stage 3.",
|
|
110
|
+
* system: {
|
|
111
|
+
* name: "ICD-10-CM",
|
|
112
|
+
* version: "2025"
|
|
113
|
+
* },
|
|
114
|
+
* config: {
|
|
115
|
+
* validation_method: "simple",
|
|
116
|
+
* include_ancestors: true
|
|
117
|
+
* }
|
|
118
|
+
* })
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* await client.construe.extractCodes({
|
|
122
|
+
* text: "5-year-old male with seizures, severe intellectual disability, microcephaly, and hypotonia.",
|
|
123
|
+
* system: {
|
|
124
|
+
* name: "HPO",
|
|
125
|
+
* version: "2025"
|
|
126
|
+
* },
|
|
127
|
+
* config: {
|
|
128
|
+
* chunking_method: "fasthpocr",
|
|
129
|
+
* validation_method: "none",
|
|
130
|
+
* include_rationale: false
|
|
131
|
+
* }
|
|
56
132
|
* })
|
|
57
133
|
*/
|
|
58
134
|
extractCodes(request: phenoml.construe.ExtractRequest, requestOptions?: ConstrueClient.RequestOptions): core.HttpResponsePromise<phenoml.construe.ExtractCodesResult>;
|
|
@@ -163,7 +239,8 @@ export declare class ConstrueClient {
|
|
|
163
239
|
* Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
164
240
|
*
|
|
165
241
|
* @param {string} codesystem - Code system name
|
|
166
|
-
* @param {string} codeID - The code identifier
|
|
242
|
+
* @param {string} codeID - The code identifier. ICD-10-CM codes are stored without their
|
|
243
|
+
* cosmetic dot (use "E1165", not "E11.65").
|
|
167
244
|
* @param {phenoml.construe.GetConstrueCodesCodesystemCodeIdRequest} request
|
|
168
245
|
* @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
169
246
|
*
|
|
@@ -173,7 +250,7 @@ export declare class ConstrueClient {
|
|
|
173
250
|
* @throws {@link phenoml.construe.InternalServerError}
|
|
174
251
|
*
|
|
175
252
|
* @example
|
|
176
|
-
* await client.construe.getASpecificCode("ICD-10-CM", "
|
|
253
|
+
* await client.construe.getASpecificCode("ICD-10-CM", "E1165", {
|
|
177
254
|
* version: "version"
|
|
178
255
|
* })
|
|
179
256
|
*/
|
|
@@ -234,21 +311,28 @@ export declare class ConstrueClient {
|
|
|
234
311
|
* await client.construe.submitFeedbackOnExtractionResults({
|
|
235
312
|
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
236
313
|
* received_result: {
|
|
237
|
-
* system: {
|
|
314
|
+
* system: {
|
|
315
|
+
* name: "ICD-10-CM",
|
|
316
|
+
* version: "2025"
|
|
317
|
+
* },
|
|
238
318
|
* codes: [{
|
|
239
|
-
* code: "
|
|
240
|
-
* description: "
|
|
319
|
+
* code: "E11.9",
|
|
320
|
+
* description: "Type 2 diabetes mellitus without complications",
|
|
241
321
|
* valid: true
|
|
242
322
|
* }]
|
|
243
323
|
* },
|
|
244
324
|
* expected_result: {
|
|
245
|
-
* system: {
|
|
325
|
+
* system: {
|
|
326
|
+
* name: "ICD-10-CM",
|
|
327
|
+
* version: "2025"
|
|
328
|
+
* },
|
|
246
329
|
* codes: [{
|
|
247
|
-
* code: "
|
|
248
|
-
* description: "
|
|
330
|
+
* code: "E11.65",
|
|
331
|
+
* description: "Type 2 diabetes mellitus with hyperglycemia",
|
|
249
332
|
* valid: true
|
|
250
333
|
* }]
|
|
251
|
-
* }
|
|
334
|
+
* },
|
|
335
|
+
* detail: "Expected code E11.65 because the text mentions hyperglycemia"
|
|
252
336
|
* })
|
|
253
337
|
*/
|
|
254
338
|
submitFeedbackOnExtractionResults(request: phenoml.construe.FeedbackRequest, requestOptions?: ConstrueClient.RequestOptions): core.HttpResponsePromise<phenoml.construe.FeedbackResponse>;
|
|
@@ -75,7 +75,24 @@ class ConstrueClient {
|
|
|
75
75
|
* await client.construe.uploadCodeSystem({
|
|
76
76
|
* name: "CUSTOM_CODES",
|
|
77
77
|
* version: "1.0",
|
|
78
|
-
* format: "
|
|
78
|
+
* format: "json",
|
|
79
|
+
* codes: [{
|
|
80
|
+
* code: "X001",
|
|
81
|
+
* description: "Example custom code 1"
|
|
82
|
+
* }, {
|
|
83
|
+
* code: "X002",
|
|
84
|
+
* description: "Example custom code 2"
|
|
85
|
+
* }]
|
|
86
|
+
* })
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* await client.construe.uploadCodeSystem({
|
|
90
|
+
* name: "CUSTOM_CODES",
|
|
91
|
+
* version: "1.0",
|
|
92
|
+
* format: "csv",
|
|
93
|
+
* file: "Y29kZSxkZXNjcmlwdGlvbgpYMDAxLEV4YW1wbGUgY3VzdG9tIGNvZGUgMQo=",
|
|
94
|
+
* code_col: "code",
|
|
95
|
+
* desc_col: "description"
|
|
79
96
|
* })
|
|
80
97
|
*/
|
|
81
98
|
uploadCodeSystem(request, requestOptions) {
|
|
@@ -91,7 +108,7 @@ class ConstrueClient {
|
|
|
91
108
|
method: "POST",
|
|
92
109
|
headers: _headers,
|
|
93
110
|
contentType: "application/json",
|
|
94
|
-
|
|
111
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
95
112
|
requestType: "json",
|
|
96
113
|
body: request,
|
|
97
114
|
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,
|
|
@@ -148,7 +165,66 @@ class ConstrueClient {
|
|
|
148
165
|
*
|
|
149
166
|
* @example
|
|
150
167
|
* await client.construe.extractCodes({
|
|
151
|
-
* text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney"
|
|
168
|
+
* text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney.",
|
|
169
|
+
* system: {
|
|
170
|
+
* name: "ICD-10-CM",
|
|
171
|
+
* version: "2025"
|
|
172
|
+
* }
|
|
173
|
+
* })
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* await client.construe.extractCodes({
|
|
177
|
+
* text: "45-year-old male presents with chest pain radiating to left arm, shortness of breath, and diaphoresis. ECG shows ST elevation in leads II, III, and aVF.",
|
|
178
|
+
* system: {
|
|
179
|
+
* name: "SNOMED_CT_US_LITE",
|
|
180
|
+
* version: "20240901"
|
|
181
|
+
* },
|
|
182
|
+
* config: {
|
|
183
|
+
* chunking_method: "sentences",
|
|
184
|
+
* validation_method: "simple",
|
|
185
|
+
* include_rationale: true,
|
|
186
|
+
* include_citations: true
|
|
187
|
+
* }
|
|
188
|
+
* })
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* await client.construe.extractCodes({
|
|
192
|
+
* text: "Start Metformin 500mg twice daily for type 2 diabetes. Continue Lisinopril 10mg daily for hypertension. Add Atorvastatin 20mg at bedtime.",
|
|
193
|
+
* system: {
|
|
194
|
+
* name: "RXNORM",
|
|
195
|
+
* version: "11042024"
|
|
196
|
+
* },
|
|
197
|
+
* config: {
|
|
198
|
+
* validation_method: "medication_search",
|
|
199
|
+
* include_rationale: true
|
|
200
|
+
* }
|
|
201
|
+
* })
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* await client.construe.extractCodes({
|
|
205
|
+
* text: "Patient diagnosed with Type 2 diabetes mellitus with diabetic chronic kidney disease, stage 3.",
|
|
206
|
+
* system: {
|
|
207
|
+
* name: "ICD-10-CM",
|
|
208
|
+
* version: "2025"
|
|
209
|
+
* },
|
|
210
|
+
* config: {
|
|
211
|
+
* validation_method: "simple",
|
|
212
|
+
* include_ancestors: true
|
|
213
|
+
* }
|
|
214
|
+
* })
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* await client.construe.extractCodes({
|
|
218
|
+
* text: "5-year-old male with seizures, severe intellectual disability, microcephaly, and hypotonia.",
|
|
219
|
+
* system: {
|
|
220
|
+
* name: "HPO",
|
|
221
|
+
* version: "2025"
|
|
222
|
+
* },
|
|
223
|
+
* config: {
|
|
224
|
+
* chunking_method: "fasthpocr",
|
|
225
|
+
* validation_method: "none",
|
|
226
|
+
* include_rationale: false
|
|
227
|
+
* }
|
|
152
228
|
* })
|
|
153
229
|
*/
|
|
154
230
|
extractCodes(request, requestOptions) {
|
|
@@ -164,7 +240,7 @@ class ConstrueClient {
|
|
|
164
240
|
method: "POST",
|
|
165
241
|
headers: _headers,
|
|
166
242
|
contentType: "application/json",
|
|
167
|
-
|
|
243
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
168
244
|
requestType: "json",
|
|
169
245
|
body: request,
|
|
170
246
|
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,
|
|
@@ -224,7 +300,7 @@ class ConstrueClient {
|
|
|
224
300
|
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"),
|
|
225
301
|
method: "GET",
|
|
226
302
|
headers: _headers,
|
|
227
|
-
|
|
303
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
228
304
|
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,
|
|
229
305
|
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,
|
|
230
306
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -287,7 +363,11 @@ class ConstrueClient {
|
|
|
287
363
|
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)}`),
|
|
288
364
|
method: "GET",
|
|
289
365
|
headers: _headers,
|
|
290
|
-
|
|
366
|
+
queryString: core.url
|
|
367
|
+
.queryBuilder()
|
|
368
|
+
.addMany(_queryParams)
|
|
369
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
370
|
+
.build(),
|
|
291
371
|
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,
|
|
292
372
|
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,
|
|
293
373
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -356,7 +436,11 @@ class ConstrueClient {
|
|
|
356
436
|
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)}`),
|
|
357
437
|
method: "DELETE",
|
|
358
438
|
headers: _headers,
|
|
359
|
-
|
|
439
|
+
queryString: core.url
|
|
440
|
+
.queryBuilder()
|
|
441
|
+
.addMany(_queryParams)
|
|
442
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
443
|
+
.build(),
|
|
360
444
|
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,
|
|
361
445
|
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,
|
|
362
446
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -430,7 +514,11 @@ class ConstrueClient {
|
|
|
430
514
|
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`),
|
|
431
515
|
method: "GET",
|
|
432
516
|
headers: _headers,
|
|
433
|
-
|
|
517
|
+
queryString: core.url
|
|
518
|
+
.queryBuilder()
|
|
519
|
+
.addMany(_queryParams)
|
|
520
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
521
|
+
.build(),
|
|
434
522
|
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,
|
|
435
523
|
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,
|
|
436
524
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -509,7 +597,11 @@ class ConstrueClient {
|
|
|
509
597
|
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/${core.url.encodePathParam(codesystem)}`),
|
|
510
598
|
method: "GET",
|
|
511
599
|
headers: _headers,
|
|
512
|
-
|
|
600
|
+
queryString: core.url
|
|
601
|
+
.queryBuilder()
|
|
602
|
+
.addMany(_queryParams)
|
|
603
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
604
|
+
.build(),
|
|
513
605
|
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,
|
|
514
606
|
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,
|
|
515
607
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -546,7 +638,8 @@ class ConstrueClient {
|
|
|
546
638
|
* Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
547
639
|
*
|
|
548
640
|
* @param {string} codesystem - Code system name
|
|
549
|
-
* @param {string} codeID - The code identifier
|
|
641
|
+
* @param {string} codeID - The code identifier. ICD-10-CM codes are stored without their
|
|
642
|
+
* cosmetic dot (use "E1165", not "E11.65").
|
|
550
643
|
* @param {phenoml.construe.GetConstrueCodesCodesystemCodeIdRequest} request
|
|
551
644
|
* @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
552
645
|
*
|
|
@@ -556,7 +649,7 @@ class ConstrueClient {
|
|
|
556
649
|
* @throws {@link phenoml.construe.InternalServerError}
|
|
557
650
|
*
|
|
558
651
|
* @example
|
|
559
|
-
* await client.construe.getASpecificCode("ICD-10-CM", "
|
|
652
|
+
* await client.construe.getASpecificCode("ICD-10-CM", "E1165", {
|
|
560
653
|
* version: "version"
|
|
561
654
|
* })
|
|
562
655
|
*/
|
|
@@ -576,7 +669,11 @@ class ConstrueClient {
|
|
|
576
669
|
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/${core.url.encodePathParam(codesystem)}/${core.url.encodePathParam(codeID)}`),
|
|
577
670
|
method: "GET",
|
|
578
671
|
headers: _headers,
|
|
579
|
-
|
|
672
|
+
queryString: core.url
|
|
673
|
+
.queryBuilder()
|
|
674
|
+
.addMany(_queryParams)
|
|
675
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
676
|
+
.build(),
|
|
580
677
|
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,
|
|
581
678
|
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,
|
|
582
679
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -662,7 +759,11 @@ class ConstrueClient {
|
|
|
662
759
|
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/${core.url.encodePathParam(codesystem)}/search/semantic`),
|
|
663
760
|
method: "GET",
|
|
664
761
|
headers: _headers,
|
|
665
|
-
|
|
762
|
+
queryString: core.url
|
|
763
|
+
.queryBuilder()
|
|
764
|
+
.addMany(_queryParams)
|
|
765
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
766
|
+
.build(),
|
|
666
767
|
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,
|
|
667
768
|
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,
|
|
668
769
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -712,21 +813,28 @@ class ConstrueClient {
|
|
|
712
813
|
* await client.construe.submitFeedbackOnExtractionResults({
|
|
713
814
|
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
714
815
|
* received_result: {
|
|
715
|
-
* system: {
|
|
816
|
+
* system: {
|
|
817
|
+
* name: "ICD-10-CM",
|
|
818
|
+
* version: "2025"
|
|
819
|
+
* },
|
|
716
820
|
* codes: [{
|
|
717
|
-
* code: "
|
|
718
|
-
* description: "
|
|
821
|
+
* code: "E11.9",
|
|
822
|
+
* description: "Type 2 diabetes mellitus without complications",
|
|
719
823
|
* valid: true
|
|
720
824
|
* }]
|
|
721
825
|
* },
|
|
722
826
|
* expected_result: {
|
|
723
|
-
* system: {
|
|
827
|
+
* system: {
|
|
828
|
+
* name: "ICD-10-CM",
|
|
829
|
+
* version: "2025"
|
|
830
|
+
* },
|
|
724
831
|
* codes: [{
|
|
725
|
-
* code: "
|
|
726
|
-
* description: "
|
|
832
|
+
* code: "E11.65",
|
|
833
|
+
* description: "Type 2 diabetes mellitus with hyperglycemia",
|
|
727
834
|
* valid: true
|
|
728
835
|
* }]
|
|
729
|
-
* }
|
|
836
|
+
* },
|
|
837
|
+
* detail: "Expected code E11.65 because the text mentions hyperglycemia"
|
|
730
838
|
* })
|
|
731
839
|
*/
|
|
732
840
|
submitFeedbackOnExtractionResults(request, requestOptions) {
|
|
@@ -742,7 +850,7 @@ class ConstrueClient {
|
|
|
742
850
|
method: "POST",
|
|
743
851
|
headers: _headers,
|
|
744
852
|
contentType: "application/json",
|
|
745
|
-
|
|
853
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
746
854
|
requestType: "json",
|
|
747
855
|
body: request,
|
|
748
856
|
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,
|
|
@@ -836,7 +944,11 @@ class ConstrueClient {
|
|
|
836
944
|
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/${core.url.encodePathParam(codesystem)}/search/text`),
|
|
837
945
|
method: "GET",
|
|
838
946
|
headers: _headers,
|
|
839
|
-
|
|
947
|
+
queryString: core.url
|
|
948
|
+
.queryBuilder()
|
|
949
|
+
.addMany(_queryParams)
|
|
950
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
951
|
+
.build(),
|
|
840
952
|
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,
|
|
841
953
|
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,
|
|
842
954
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -2,7 +2,66 @@ import type * as phenoml from "../../../../index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
|
-
* text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney"
|
|
5
|
+
* text: "Patient is a 14-year-old female, previously healthy, who is here for evaluation of abnormal renal ultrasound with atrophic right kidney.",
|
|
6
|
+
* system: {
|
|
7
|
+
* name: "ICD-10-CM",
|
|
8
|
+
* version: "2025"
|
|
9
|
+
* }
|
|
10
|
+
* }
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* {
|
|
14
|
+
* text: "45-year-old male presents with chest pain radiating to left arm, shortness of breath, and diaphoresis. ECG shows ST elevation in leads II, III, and aVF.",
|
|
15
|
+
* system: {
|
|
16
|
+
* name: "SNOMED_CT_US_LITE",
|
|
17
|
+
* version: "20240901"
|
|
18
|
+
* },
|
|
19
|
+
* config: {
|
|
20
|
+
* chunking_method: "sentences",
|
|
21
|
+
* validation_method: "simple",
|
|
22
|
+
* include_rationale: true,
|
|
23
|
+
* include_citations: true
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* {
|
|
29
|
+
* text: "Start Metformin 500mg twice daily for type 2 diabetes. Continue Lisinopril 10mg daily for hypertension. Add Atorvastatin 20mg at bedtime.",
|
|
30
|
+
* system: {
|
|
31
|
+
* name: "RXNORM",
|
|
32
|
+
* version: "11042024"
|
|
33
|
+
* },
|
|
34
|
+
* config: {
|
|
35
|
+
* validation_method: "medication_search",
|
|
36
|
+
* include_rationale: true
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* {
|
|
42
|
+
* text: "Patient diagnosed with Type 2 diabetes mellitus with diabetic chronic kidney disease, stage 3.",
|
|
43
|
+
* system: {
|
|
44
|
+
* name: "ICD-10-CM",
|
|
45
|
+
* version: "2025"
|
|
46
|
+
* },
|
|
47
|
+
* config: {
|
|
48
|
+
* validation_method: "simple",
|
|
49
|
+
* include_ancestors: true
|
|
50
|
+
* }
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* {
|
|
55
|
+
* text: "5-year-old male with seizures, severe intellectual disability, microcephaly, and hypotonia.",
|
|
56
|
+
* system: {
|
|
57
|
+
* name: "HPO",
|
|
58
|
+
* version: "2025"
|
|
59
|
+
* },
|
|
60
|
+
* config: {
|
|
61
|
+
* chunking_method: "fasthpocr",
|
|
62
|
+
* validation_method: "none",
|
|
63
|
+
* include_rationale: false
|
|
64
|
+
* }
|
|
6
65
|
* }
|
|
7
66
|
*/
|
|
8
67
|
export interface ExtractRequest {
|
|
@@ -4,21 +4,28 @@ import type * as phenoml from "../../../../index.js";
|
|
|
4
4
|
* {
|
|
5
5
|
* text: "Patient has type 2 diabetes with hyperglycemia",
|
|
6
6
|
* received_result: {
|
|
7
|
-
* system: {
|
|
7
|
+
* system: {
|
|
8
|
+
* name: "ICD-10-CM",
|
|
9
|
+
* version: "2025"
|
|
10
|
+
* },
|
|
8
11
|
* codes: [{
|
|
9
|
-
* code: "
|
|
10
|
-
* description: "
|
|
12
|
+
* code: "E11.9",
|
|
13
|
+
* description: "Type 2 diabetes mellitus without complications",
|
|
11
14
|
* valid: true
|
|
12
15
|
* }]
|
|
13
16
|
* },
|
|
14
17
|
* expected_result: {
|
|
15
|
-
* system: {
|
|
18
|
+
* system: {
|
|
19
|
+
* name: "ICD-10-CM",
|
|
20
|
+
* version: "2025"
|
|
21
|
+
* },
|
|
16
22
|
* codes: [{
|
|
17
|
-
* code: "
|
|
18
|
-
* description: "
|
|
23
|
+
* code: "E11.65",
|
|
24
|
+
* description: "Type 2 diabetes mellitus with hyperglycemia",
|
|
19
25
|
* valid: true
|
|
20
26
|
* }]
|
|
21
|
-
* }
|
|
27
|
+
* },
|
|
28
|
+
* detail: "Expected code E11.65 because the text mentions hyperglycemia"
|
|
22
29
|
* }
|
|
23
30
|
*/
|
|
24
31
|
export interface FeedbackRequest {
|
|
@@ -4,7 +4,24 @@ import type * as phenoml from "../../../../index.js";
|
|
|
4
4
|
* {
|
|
5
5
|
* name: "CUSTOM_CODES",
|
|
6
6
|
* version: "1.0",
|
|
7
|
-
* format: "
|
|
7
|
+
* format: "json",
|
|
8
|
+
* codes: [{
|
|
9
|
+
* code: "X001",
|
|
10
|
+
* description: "Example custom code 1"
|
|
11
|
+
* }, {
|
|
12
|
+
* code: "X002",
|
|
13
|
+
* description: "Example custom code 2"
|
|
14
|
+
* }]
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* {
|
|
19
|
+
* name: "CUSTOM_CODES",
|
|
20
|
+
* version: "1.0",
|
|
21
|
+
* format: "csv",
|
|
22
|
+
* file: "Y29kZSxkZXNjcmlwdGlvbgpYMDAxLEV4YW1wbGUgY3VzdG9tIGNvZGUgMQo=",
|
|
23
|
+
* code_col: "code",
|
|
24
|
+
* desc_col: "description"
|
|
8
25
|
* }
|
|
9
26
|
*/
|
|
10
27
|
export interface UploadRequest {
|
|
@@ -105,7 +105,11 @@ class FhirClient {
|
|
|
105
105
|
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, `fhir-provider/${core.url.encodePathParam(fhir_provider_id)}/fhir/${core.url.encodePathParam(fhir_path)}`),
|
|
106
106
|
method: "GET",
|
|
107
107
|
headers: _headers,
|
|
108
|
-
|
|
108
|
+
queryString: core.url
|
|
109
|
+
.queryBuilder()
|
|
110
|
+
.addMany(_queryParams)
|
|
111
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
112
|
+
.build(),
|
|
109
113
|
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,
|
|
110
114
|
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,
|
|
111
115
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -191,7 +195,7 @@ class FhirClient {
|
|
|
191
195
|
method: "POST",
|
|
192
196
|
headers: _headers,
|
|
193
197
|
contentType: "application/fhir+json",
|
|
194
|
-
|
|
198
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
195
199
|
requestType: "json",
|
|
196
200
|
body: _body,
|
|
197
201
|
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,
|
|
@@ -278,7 +282,7 @@ class FhirClient {
|
|
|
278
282
|
method: "PUT",
|
|
279
283
|
headers: _headers,
|
|
280
284
|
contentType: "application/fhir+json",
|
|
281
|
-
|
|
285
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
282
286
|
requestType: "json",
|
|
283
287
|
body: _body,
|
|
284
288
|
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,
|
|
@@ -361,7 +365,7 @@ class FhirClient {
|
|
|
361
365
|
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, `fhir-provider/${core.url.encodePathParam(fhir_provider_id)}/fhir/${core.url.encodePathParam(fhir_path)}`),
|
|
362
366
|
method: "DELETE",
|
|
363
367
|
headers: _headers,
|
|
364
|
-
|
|
368
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
365
369
|
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,
|
|
366
370
|
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,
|
|
367
371
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -506,7 +510,7 @@ class FhirClient {
|
|
|
506
510
|
method: "PATCH",
|
|
507
511
|
headers: _headers,
|
|
508
512
|
contentType: "application/json-patch+json",
|
|
509
|
-
|
|
513
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
510
514
|
requestType: "json",
|
|
511
515
|
body: _body,
|
|
512
516
|
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,
|
|
@@ -620,7 +624,7 @@ class FhirClient {
|
|
|
620
624
|
method: "POST",
|
|
621
625
|
headers: _headers,
|
|
622
626
|
contentType: "application/fhir+json",
|
|
623
|
-
|
|
627
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
624
628
|
requestType: "json",
|
|
625
629
|
body: _body,
|
|
626
630
|
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,
|