phenoml 13.1.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.
Files changed (124) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agent/client/Client.d.ts +24 -12
  3. package/dist/cjs/api/resources/agent/client/Client.js +24 -12
  4. package/dist/cjs/api/resources/agent/client/requests/AgentChatRequest.d.ts +11 -0
  5. package/dist/cjs/api/resources/agent/client/requests/AgentStreamChatRequest.d.ts +1 -0
  6. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.d.ts +13 -25
  7. package/dist/cjs/api/resources/agent/resources/prompts/client/Client.js +13 -64
  8. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.ts +4 -1
  9. package/dist/cjs/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.ts +7 -1
  10. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.d.ts +4 -1
  11. package/dist/cjs/api/resources/authtoken/resources/auth/client/Client.js +4 -1
  12. package/dist/cjs/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.ts +4 -1
  13. package/dist/cjs/api/resources/construe/client/Client.d.ts +95 -11
  14. package/dist/cjs/api/resources/construe/client/Client.js +95 -11
  15. package/dist/cjs/api/resources/construe/client/requests/ExtractRequest.d.ts +60 -1
  16. package/dist/cjs/api/resources/construe/client/requests/FeedbackRequest.d.ts +14 -7
  17. package/dist/cjs/api/resources/construe/client/requests/UploadRequest.d.ts +18 -1
  18. package/dist/cjs/api/resources/fhirProvider/client/Client.d.ts +10 -7
  19. package/dist/cjs/api/resources/fhirProvider/client/Client.js +10 -7
  20. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.ts +5 -3
  21. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.ts +1 -1
  22. package/dist/cjs/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.ts +1 -1
  23. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.ts +6 -4
  24. package/dist/cjs/api/resources/fhirProvider/types/FhirProviderTemplate.d.ts +10 -5
  25. package/dist/cjs/api/resources/lang2Fhir/client/Client.d.ts +17 -6
  26. package/dist/cjs/api/resources/lang2Fhir/client/Client.js +17 -6
  27. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.ts +2 -1
  28. package/dist/cjs/api/resources/lang2Fhir/client/requests/CreateRequest.d.ts +9 -2
  29. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.ts +2 -1
  30. package/dist/cjs/api/resources/lang2Fhir/client/requests/DocumentRequest.d.ts +1 -1
  31. package/dist/cjs/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.ts +3 -1
  32. package/dist/cjs/api/resources/lang2Fhir/types/SearchResponse.d.ts +2 -2
  33. package/dist/cjs/api/resources/summary/client/Client.d.ts +74 -9
  34. package/dist/cjs/api/resources/summary/client/Client.js +74 -9
  35. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryRequest.d.ts +67 -11
  36. package/dist/cjs/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.ts +4 -4
  37. package/dist/cjs/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.ts +4 -4
  38. package/dist/cjs/api/resources/summary/types/index.d.ts +0 -2
  39. package/dist/cjs/api/resources/summary/types/index.js +0 -2
  40. package/dist/cjs/api/resources/tools/client/Client.d.ts +7 -3
  41. package/dist/cjs/api/resources/tools/client/Client.js +7 -3
  42. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.ts +1 -0
  43. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.ts +3 -2
  44. package/dist/cjs/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.ts +3 -1
  45. package/dist/cjs/api/resources/tools/types/McpServer.d.ts +10 -0
  46. package/dist/cjs/api/resources/tools/types/McpServerResponse.d.ts +12 -16
  47. package/dist/cjs/api/resources/tools/types/McpServerTool.d.ts +14 -0
  48. package/dist/cjs/api/resources/tools/types/McpServerToolResponse.d.ts +7 -20
  49. package/dist/cjs/api/resources/tools/types/index.d.ts +2 -0
  50. package/dist/cjs/api/resources/tools/types/index.js +2 -0
  51. package/dist/cjs/api/resources/workflows/client/Client.d.ts +21 -9
  52. package/dist/cjs/api/resources/workflows/client/Client.js +21 -9
  53. package/dist/cjs/api/resources/workflows/client/requests/CreateWorkflowRequest.d.ts +3 -2
  54. package/dist/cjs/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.ts +11 -1
  55. package/dist/cjs/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.ts +6 -5
  56. package/dist/cjs/version.d.ts +1 -1
  57. package/dist/cjs/version.js +1 -1
  58. package/dist/esm/BaseClient.mjs +2 -2
  59. package/dist/esm/api/resources/agent/client/Client.d.mts +24 -12
  60. package/dist/esm/api/resources/agent/client/Client.mjs +24 -12
  61. package/dist/esm/api/resources/agent/client/requests/AgentChatRequest.d.mts +11 -0
  62. package/dist/esm/api/resources/agent/client/requests/AgentStreamChatRequest.d.mts +1 -0
  63. package/dist/esm/api/resources/agent/resources/prompts/client/Client.d.mts +13 -25
  64. package/dist/esm/api/resources/agent/resources/prompts/client/Client.mjs +13 -64
  65. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsCreateRequest.d.mts +4 -1
  66. package/dist/esm/api/resources/agent/resources/prompts/client/requests/AgentPromptsUpdateRequest.d.mts +7 -1
  67. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.d.mts +4 -1
  68. package/dist/esm/api/resources/authtoken/resources/auth/client/Client.mjs +4 -1
  69. package/dist/esm/api/resources/authtoken/resources/auth/client/requests/ClientCredentialsRequest.d.mts +4 -1
  70. package/dist/esm/api/resources/construe/client/Client.d.mts +95 -11
  71. package/dist/esm/api/resources/construe/client/Client.mjs +95 -11
  72. package/dist/esm/api/resources/construe/client/requests/ExtractRequest.d.mts +60 -1
  73. package/dist/esm/api/resources/construe/client/requests/FeedbackRequest.d.mts +14 -7
  74. package/dist/esm/api/resources/construe/client/requests/UploadRequest.d.mts +18 -1
  75. package/dist/esm/api/resources/fhirProvider/client/Client.d.mts +10 -7
  76. package/dist/esm/api/resources/fhirProvider/client/Client.mjs +10 -7
  77. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderCreateRequest.d.mts +5 -3
  78. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderRemoveAuthConfigRequest.d.mts +1 -1
  79. package/dist/esm/api/resources/fhirProvider/client/requests/FhirProviderSetActiveAuthConfigRequest.d.mts +1 -1
  80. package/dist/esm/api/resources/fhirProvider/types/FhirProviderSandboxInfo.d.mts +6 -4
  81. package/dist/esm/api/resources/fhirProvider/types/FhirProviderTemplate.d.mts +10 -5
  82. package/dist/esm/api/resources/lang2Fhir/client/Client.d.mts +17 -6
  83. package/dist/esm/api/resources/lang2Fhir/client/Client.mjs +17 -6
  84. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateMultiRequest.d.mts +2 -1
  85. package/dist/esm/api/resources/lang2Fhir/client/requests/CreateRequest.d.mts +9 -2
  86. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentMultiRequest.d.mts +2 -1
  87. package/dist/esm/api/resources/lang2Fhir/client/requests/DocumentRequest.d.mts +1 -1
  88. package/dist/esm/api/resources/lang2Fhir/client/requests/ProfileUploadRequest.d.mts +3 -1
  89. package/dist/esm/api/resources/lang2Fhir/types/SearchResponse.d.mts +2 -2
  90. package/dist/esm/api/resources/summary/client/Client.d.mts +74 -9
  91. package/dist/esm/api/resources/summary/client/Client.mjs +74 -9
  92. package/dist/esm/api/resources/summary/client/requests/CreateSummaryRequest.d.mts +67 -11
  93. package/dist/esm/api/resources/summary/client/requests/CreateSummaryTemplateRequest.d.mts +4 -4
  94. package/dist/esm/api/resources/summary/client/requests/UpdateSummaryTemplateRequest.d.mts +4 -4
  95. package/dist/esm/api/resources/summary/types/index.d.mts +0 -2
  96. package/dist/esm/api/resources/summary/types/index.mjs +0 -2
  97. package/dist/esm/api/resources/tools/client/Client.d.mts +7 -3
  98. package/dist/esm/api/resources/tools/client/Client.mjs +7 -3
  99. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateMultiRequest.d.mts +1 -0
  100. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndCreateRequest.d.mts +3 -2
  101. package/dist/esm/api/resources/tools/client/requests/Lang2FhirAndSearchRequest.d.mts +3 -1
  102. package/dist/esm/api/resources/tools/types/McpServer.d.mts +10 -0
  103. package/dist/esm/api/resources/tools/types/McpServerResponse.d.mts +12 -16
  104. package/dist/esm/api/resources/tools/types/McpServerTool.d.mts +14 -0
  105. package/dist/esm/api/resources/tools/types/McpServerToolResponse.d.mts +7 -20
  106. package/dist/esm/api/resources/tools/types/index.d.mts +2 -0
  107. package/dist/esm/api/resources/tools/types/index.mjs +2 -0
  108. package/dist/esm/api/resources/workflows/client/Client.d.mts +21 -9
  109. package/dist/esm/api/resources/workflows/client/Client.mjs +21 -9
  110. package/dist/esm/api/resources/workflows/client/requests/CreateWorkflowRequest.d.mts +3 -2
  111. package/dist/esm/api/resources/workflows/client/requests/ExecuteWorkflowRequest.d.mts +11 -1
  112. package/dist/esm/api/resources/workflows/client/requests/UpdateWorkflowRequest.d.mts +6 -5
  113. package/dist/esm/version.d.mts +1 -1
  114. package/dist/esm/version.mjs +1 -1
  115. package/package.json +1 -1
  116. package/reference.md +140 -124
  117. package/dist/cjs/api/resources/summary/types/FhirBundle.d.ts +0 -13
  118. package/dist/cjs/api/resources/summary/types/FhirResource.d.ts +0 -6
  119. package/dist/esm/api/resources/summary/types/FhirBundle.d.mts +0 -13
  120. package/dist/esm/api/resources/summary/types/FhirResource.d.mts +0 -6
  121. /package/dist/cjs/api/resources/{summary/types/FhirBundle.js → tools/types/McpServer.js} +0 -0
  122. /package/dist/cjs/api/resources/{summary/types/FhirResource.js → tools/types/McpServerTool.js} +0 -0
  123. /package/dist/esm/api/resources/{summary/types/FhirBundle.mjs → tools/types/McpServer.mjs} +0 -0
  124. /package/dist/esm/api/resources/{summary/types/FhirResource.mjs → tools/types/McpServerTool.mjs} +0 -0
@@ -75,7 +75,24 @@ class ConstrueClient {
75
75
  * await client.construe.uploadCodeSystem({
76
76
  * name: "CUSTOM_CODES",
77
77
  * version: "1.0",
78
- * format: "csv"
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) {
@@ -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) {
@@ -562,7 +638,8 @@ class ConstrueClient {
562
638
  * Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
563
639
  *
564
640
  * @param {string} codesystem - Code system name
565
- * @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").
566
643
  * @param {phenoml.construe.GetConstrueCodesCodesystemCodeIdRequest} request
567
644
  * @param {ConstrueClient.RequestOptions} requestOptions - Request-specific configuration.
568
645
  *
@@ -572,7 +649,7 @@ class ConstrueClient {
572
649
  * @throws {@link phenoml.construe.InternalServerError}
573
650
  *
574
651
  * @example
575
- * await client.construe.getASpecificCode("ICD-10-CM", "E11.65", {
652
+ * await client.construe.getASpecificCode("ICD-10-CM", "E1165", {
576
653
  * version: "version"
577
654
  * })
578
655
  */
@@ -736,21 +813,28 @@ class ConstrueClient {
736
813
  * await client.construe.submitFeedbackOnExtractionResults({
737
814
  * text: "Patient has type 2 diabetes with hyperglycemia",
738
815
  * received_result: {
739
- * system: {},
816
+ * system: {
817
+ * name: "ICD-10-CM",
818
+ * version: "2025"
819
+ * },
740
820
  * codes: [{
741
- * code: "195967001",
742
- * description: "Asthma",
821
+ * code: "E11.9",
822
+ * description: "Type 2 diabetes mellitus without complications",
743
823
  * valid: true
744
824
  * }]
745
825
  * },
746
826
  * expected_result: {
747
- * system: {},
827
+ * system: {
828
+ * name: "ICD-10-CM",
829
+ * version: "2025"
830
+ * },
748
831
  * codes: [{
749
- * code: "195967001",
750
- * description: "Asthma",
832
+ * code: "E11.65",
833
+ * description: "Type 2 diabetes mellitus with hyperglycemia",
751
834
  * valid: true
752
835
  * }]
753
- * }
836
+ * },
837
+ * detail: "Expected code E11.65 because the text mentions hyperglycemia"
754
838
  * })
755
839
  */
756
840
  submitFeedbackOnExtractionResults(request, requestOptions) {
@@ -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: "195967001",
10
- * description: "Asthma",
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: "195967001",
18
- * description: "Asthma",
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: "csv"
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 {
@@ -26,11 +26,13 @@ export declare class FhirProviderClient {
26
26
  * @example
27
27
  * await client.fhirProvider.create({
28
28
  * name: "Epic Sandbox",
29
- * provider: "athenahealth",
29
+ * description: "Epic sandbox environment for testing",
30
+ * provider: "epic",
30
31
  * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
31
32
  * auth: {
32
- * auth_method: "jwt",
33
- * client_id: "your-client-id"
33
+ * auth_method: "client_secret",
34
+ * client_id: "your-client-id",
35
+ * client_secret: "your-client-secret"
34
36
  * }
35
37
  * })
36
38
  */
@@ -106,8 +108,9 @@ export declare class FhirProviderClient {
106
108
  *
107
109
  * @example
108
110
  * await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
109
- * auth_method: "jwt",
110
- * client_id: "your-client-id"
111
+ * auth_method: "client_secret",
112
+ * client_id: "your-client-id",
113
+ * client_secret: "your-client-secret"
111
114
  * })
112
115
  */
113
116
  addAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderAddAuthConfigRequest, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
@@ -133,7 +136,7 @@ export declare class FhirProviderClient {
133
136
  *
134
137
  * @example
135
138
  * await client.fhirProvider.setActiveAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
136
- * auth_config_id: "auth-config-123"
139
+ * auth_config_id: "auth-config-456"
137
140
  * })
138
141
  */
139
142
  setActiveAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderSetActiveAuthConfigRequest, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderResponse>;
@@ -156,7 +159,7 @@ export declare class FhirProviderClient {
156
159
  *
157
160
  * @example
158
161
  * await client.fhirProvider.removeAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
159
- * auth_config_id: "auth-config-123"
162
+ * auth_config_id: "auth-config-456"
160
163
  * })
161
164
  */
162
165
  removeAuthConfig(fhir_provider_id: string, request: phenoml.fhirProvider.FhirProviderRemoveAuthConfigRequest, requestOptions?: FhirProviderClient.RequestOptions): core.HttpResponsePromise<phenoml.fhirProvider.FhirProviderRemoveAuthConfigResponse>;
@@ -71,11 +71,13 @@ class FhirProviderClient {
71
71
  * @example
72
72
  * await client.fhirProvider.create({
73
73
  * name: "Epic Sandbox",
74
- * provider: "athenahealth",
74
+ * description: "Epic sandbox environment for testing",
75
+ * provider: "epic",
75
76
  * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
76
77
  * auth: {
77
- * auth_method: "jwt",
78
- * client_id: "your-client-id"
78
+ * auth_method: "client_secret",
79
+ * client_id: "your-client-id",
80
+ * client_secret: "your-client-secret"
79
81
  * }
80
82
  * })
81
83
  */
@@ -324,8 +326,9 @@ class FhirProviderClient {
324
326
  *
325
327
  * @example
326
328
  * await client.fhirProvider.addAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
327
- * auth_method: "jwt",
328
- * client_id: "your-client-id"
329
+ * auth_method: "client_secret",
330
+ * client_id: "your-client-id",
331
+ * client_secret: "your-client-secret"
329
332
  * })
330
333
  */
331
334
  addAuthConfig(fhir_provider_id, request, requestOptions) {
@@ -400,7 +403,7 @@ class FhirProviderClient {
400
403
  *
401
404
  * @example
402
405
  * await client.fhirProvider.setActiveAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
403
- * auth_config_id: "auth-config-123"
406
+ * auth_config_id: "auth-config-456"
404
407
  * })
405
408
  */
406
409
  setActiveAuthConfig(fhir_provider_id, request, requestOptions) {
@@ -472,7 +475,7 @@ class FhirProviderClient {
472
475
  *
473
476
  * @example
474
477
  * await client.fhirProvider.removeAuthConfig("1716d214-de93-43a4-aa6b-a878d864e2ad", {
475
- * auth_config_id: "auth-config-123"
478
+ * auth_config_id: "auth-config-456"
476
479
  * })
477
480
  */
478
481
  removeAuthConfig(fhir_provider_id, request, requestOptions) {
@@ -3,11 +3,13 @@ import type * as phenoml from "../../../../index.js";
3
3
  * @example
4
4
  * {
5
5
  * name: "Epic Sandbox",
6
- * provider: "athenahealth",
6
+ * description: "Epic sandbox environment for testing",
7
+ * provider: "epic",
7
8
  * base_url: "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
8
9
  * auth: {
9
- * auth_method: "jwt",
10
- * client_id: "your-client-id"
10
+ * auth_method: "client_secret",
11
+ * client_id: "your-client-id",
12
+ * client_secret: "your-client-secret"
11
13
  * }
12
14
  * }
13
15
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * auth_config_id: "auth-config-123"
4
+ * auth_config_id: "auth-config-456"
5
5
  * }
6
6
  */
7
7
  export interface FhirProviderRemoveAuthConfigRequest {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * auth_config_id: "auth-config-123"
4
+ * auth_config_id: "auth-config-456"
5
5
  * }
6
6
  */
7
7
  export interface FhirProviderSetActiveAuthConfigRequest {
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Information returned for sandbox FHIR providers.
2
+ * Limited information returned for sandbox FHIR providers. Sandbox
3
+ * responses omit `auth_configs` and `last_updated`, which is what
4
+ * distinguishes this shape from `FhirProviderTemplate` in `oneOf`.
3
5
  */
4
6
  export interface FhirProviderSandboxInfo {
5
7
  /** Unique identifier for the FHIR provider */
6
- id?: string | undefined;
8
+ id: string;
7
9
  /** Display name for the FHIR provider */
8
- name?: string | undefined;
10
+ name: string;
9
11
  /** Optional description of the FHIR provider */
10
12
  description?: string | undefined;
11
13
  /** Provider type (always "sandbox" for this schema) */
12
- provider?: "sandbox" | undefined;
14
+ provider: "sandbox";
13
15
  }
@@ -1,18 +1,23 @@
1
1
  import type * as phenoml from "../../../index.js";
2
+ /**
3
+ * Full FHIR provider configuration returned for non-sandbox providers.
4
+ * `auth_configs` and `last_updated` are always populated, which is how
5
+ * list responses distinguish this shape from `FhirProviderSandboxInfo`.
6
+ */
2
7
  export interface FhirProviderTemplate {
3
8
  /** Unique identifier for the FHIR provider */
4
- id?: string | undefined;
9
+ id: string;
5
10
  /** Display name for the FHIR provider */
6
- name?: string | undefined;
11
+ name: string;
7
12
  /** Optional description of the FHIR provider */
8
13
  description?: string | undefined;
9
- provider?: phenoml.fhirProvider.Provider | undefined;
14
+ provider: phenoml.fhirProvider.Provider;
10
15
  /** Base URL of the FHIR server */
11
16
  base_url?: string | undefined;
12
17
  /** OAuth client ID. Deprecated: use client_id on FhirProviderAuthConfig instead. Retained for backward compatibility with existing providers. */
13
18
  client_id?: string | undefined;
14
19
  /** Map of authentication configurations (key is auth_config_id) */
15
- auth_configs?: Record<string, phenoml.fhirProvider.FhirProviderAuthConfig> | undefined;
20
+ auth_configs: Record<string, phenoml.fhirProvider.FhirProviderAuthConfig>;
16
21
  /** Timestamp when the provider was last updated */
17
- last_updated?: string | undefined;
22
+ last_updated: string;
18
23
  }
@@ -25,8 +25,15 @@ export declare class Lang2FhirClient {
25
25
  * @example
26
26
  * await client.lang2Fhir.create({
27
27
  * version: "R4",
28
- * resource: "auto",
29
- * text: "Patient has severe asthma with acute exacerbation"
28
+ * resource: "condition-encounter-diagnosis",
29
+ * text: "Patient has severe persistent asthma with acute exacerbation"
30
+ * })
31
+ *
32
+ * @example
33
+ * await client.lang2Fhir.create({
34
+ * version: "R4",
35
+ * resource: "medicationrequest",
36
+ * text: "Prescribe Amoxicillin 500mg capsules, take one capsule three times daily for 10 days"
30
37
  * })
31
38
  */
32
39
  create(request: phenoml.lang2Fhir.CreateRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.FhirResource>;
@@ -47,7 +54,8 @@ export declare class Lang2FhirClient {
47
54
  *
48
55
  * @example
49
56
  * await client.lang2Fhir.createMulti({
50
- * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
57
+ * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily. Blood pressure 140/90.",
58
+ * version: "R4"
51
59
  * })
52
60
  */
53
61
  createMulti(request: phenoml.lang2Fhir.CreateMultiRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.CreateMultiResponse>;
@@ -99,7 +107,9 @@ export declare class Lang2FhirClient {
99
107
  *
100
108
  * @example
101
109
  * await client.lang2Fhir.uploadProfile({
102
- * profile: "(base64 encoded FHIR StructureDefinition JSON)"
110
+ * profile: "eyJyZXNvdXJjZVR5cGUiOiJTdHJ1Y3R1cmVEZWZpbml0aW9uIiwiaWQiOiJjdXN0b20tcGF0aWVudCIsInVybCI6Imh0dHA6Ly9waGVub21sLmNvbS9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vY3VzdG9tLXBhdGllbnQiLCJuYW1lIjoiQ3VzdG9tUGF0aWVudCIsInN0YXR1cyI6ImFjdGl2ZSIsImZoaXJWZXJzaW9uIjoiNC4wLjEiLCJraW5kIjoicmVzb3VyY2UiLCJhYnN0cmFjdCI6ZmFsc2UsInR5cGUiOiJQYXRpZW50IiwiYmFzZURlZmluaXRpb24iOiJodHRwOi8vaGw3Lm9yZy9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vUGF0aWVudCIsImRlcml2YXRpb24iOiJjb25zdHJhaW50Iiwic25hcHNob3QiOnsiZWxlbWVudCI6W3siaWQiOiJQYXRpZW50IiwicGF0aCI6IlBhdGllbnQiLCJtaW4iOjAsIm1heCI6IioifSx7ImlkIjoiUGF0aWVudC5uYW1lIiwicGF0aCI6IlBhdGllbnQubmFtZSIsIm1pbiI6MSwibWF4IjoiKiJ9XX19Cg==",
111
+ * implementation_guide: "acme-cardiology",
112
+ * profile_context: "When clinical text describes cardiology-specific findings, prefer this profile over the generic US Core Condition."
103
113
  * })
104
114
  */
105
115
  uploadProfile(request: phenoml.lang2Fhir.ProfileUploadRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.Lang2FhirUploadProfileResponse>;
@@ -120,7 +130,7 @@ export declare class Lang2FhirClient {
120
130
  * await client.lang2Fhir.document({
121
131
  * version: "R4",
122
132
  * resource: "questionnaire",
123
- * content: "content"
133
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)"
124
134
  * })
125
135
  */
126
136
  document(request: phenoml.lang2Fhir.DocumentRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.FhirResource>;
@@ -144,7 +154,8 @@ export declare class Lang2FhirClient {
144
154
  * @example
145
155
  * await client.lang2Fhir.extractMultipleFhirResourcesFromADocument({
146
156
  * version: "R4",
147
- * content: "content"
157
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)",
158
+ * provider: "medplum"
148
159
  * })
149
160
  */
150
161
  extractMultipleFhirResourcesFromADocument(request: phenoml.lang2Fhir.DocumentMultiRequest, requestOptions?: Lang2FhirClient.RequestOptions): core.HttpResponsePromise<phenoml.lang2Fhir.DocumentMultiResponse>;
@@ -70,8 +70,15 @@ class Lang2FhirClient {
70
70
  * @example
71
71
  * await client.lang2Fhir.create({
72
72
  * version: "R4",
73
- * resource: "auto",
74
- * text: "Patient has severe asthma with acute exacerbation"
73
+ * resource: "condition-encounter-diagnosis",
74
+ * text: "Patient has severe persistent asthma with acute exacerbation"
75
+ * })
76
+ *
77
+ * @example
78
+ * await client.lang2Fhir.create({
79
+ * version: "R4",
80
+ * resource: "medicationrequest",
81
+ * text: "Prescribe Amoxicillin 500mg capsules, take one capsule three times daily for 10 days"
75
82
  * })
76
83
  */
77
84
  create(request, requestOptions) {
@@ -134,7 +141,8 @@ class Lang2FhirClient {
134
141
  *
135
142
  * @example
136
143
  * await client.lang2Fhir.createMulti({
137
- * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
144
+ * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily. Blood pressure 140/90.",
145
+ * version: "R4"
138
146
  * })
139
147
  */
140
148
  createMulti(request, requestOptions) {
@@ -275,7 +283,9 @@ class Lang2FhirClient {
275
283
  *
276
284
  * @example
277
285
  * await client.lang2Fhir.uploadProfile({
278
- * profile: "(base64 encoded FHIR StructureDefinition JSON)"
286
+ * profile: "eyJyZXNvdXJjZVR5cGUiOiJTdHJ1Y3R1cmVEZWZpbml0aW9uIiwiaWQiOiJjdXN0b20tcGF0aWVudCIsInVybCI6Imh0dHA6Ly9waGVub21sLmNvbS9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vY3VzdG9tLXBhdGllbnQiLCJuYW1lIjoiQ3VzdG9tUGF0aWVudCIsInN0YXR1cyI6ImFjdGl2ZSIsImZoaXJWZXJzaW9uIjoiNC4wLjEiLCJraW5kIjoicmVzb3VyY2UiLCJhYnN0cmFjdCI6ZmFsc2UsInR5cGUiOiJQYXRpZW50IiwiYmFzZURlZmluaXRpb24iOiJodHRwOi8vaGw3Lm9yZy9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vUGF0aWVudCIsImRlcml2YXRpb24iOiJjb25zdHJhaW50Iiwic25hcHNob3QiOnsiZWxlbWVudCI6W3siaWQiOiJQYXRpZW50IiwicGF0aCI6IlBhdGllbnQiLCJtaW4iOjAsIm1heCI6IioifSx7ImlkIjoiUGF0aWVudC5uYW1lIiwicGF0aCI6IlBhdGllbnQubmFtZSIsIm1pbiI6MSwibWF4IjoiKiJ9XX19Cg==",
287
+ * implementation_guide: "acme-cardiology",
288
+ * profile_context: "When clinical text describes cardiology-specific findings, prefer this profile over the generic US Core Condition."
279
289
  * })
280
290
  */
281
291
  uploadProfile(request, requestOptions) {
@@ -343,7 +353,7 @@ class Lang2FhirClient {
343
353
  * await client.lang2Fhir.document({
344
354
  * version: "R4",
345
355
  * resource: "questionnaire",
346
- * content: "content"
356
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)"
347
357
  * })
348
358
  */
349
359
  document(request, requestOptions) {
@@ -409,7 +419,8 @@ class Lang2FhirClient {
409
419
  * @example
410
420
  * await client.lang2Fhir.extractMultipleFhirResourcesFromADocument({
411
421
  * version: "R4",
412
- * content: "content"
422
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)",
423
+ * provider: "medplum"
413
424
  * })
414
425
  */
415
426
  extractMultipleFhirResourcesFromADocument(request, requestOptions) {
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * text: "John Smith, male born on 1980-03-12, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily."
4
+ * text: "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily. Blood pressure 140/90.",
5
+ * version: "R4"
5
6
  * }
6
7
  */
7
8
  export interface CreateMultiRequest {
@@ -2,8 +2,15 @@
2
2
  * @example
3
3
  * {
4
4
  * version: "R4",
5
- * resource: "auto",
6
- * text: "Patient has severe asthma with acute exacerbation"
5
+ * resource: "condition-encounter-diagnosis",
6
+ * text: "Patient has severe persistent asthma with acute exacerbation"
7
+ * }
8
+ *
9
+ * @example
10
+ * {
11
+ * version: "R4",
12
+ * resource: "medicationrequest",
13
+ * text: "Prescribe Amoxicillin 500mg capsules, take one capsule three times daily for 10 days"
7
14
  * }
8
15
  */
9
16
  export interface CreateRequest {
@@ -3,7 +3,8 @@ import type * as phenoml from "../../../../index.js";
3
3
  * @example
4
4
  * {
5
5
  * version: "R4",
6
- * content: "content"
6
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)",
7
+ * provider: "medplum"
7
8
  * }
8
9
  */
9
10
  export interface DocumentMultiRequest {
@@ -4,7 +4,7 @@ import type * as phenoml from "../../../../index.js";
4
4
  * {
5
5
  * version: "R4",
6
6
  * resource: "questionnaire",
7
- * content: "content"
7
+ * content: "JVBERi0xLjQKJeLjz9MK...(base64-encoded PDF or image bytes)"
8
8
  * }
9
9
  */
10
10
  export interface DocumentRequest {
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * profile: "(base64 encoded FHIR StructureDefinition JSON)"
4
+ * profile: "eyJyZXNvdXJjZVR5cGUiOiJTdHJ1Y3R1cmVEZWZpbml0aW9uIiwiaWQiOiJjdXN0b20tcGF0aWVudCIsInVybCI6Imh0dHA6Ly9waGVub21sLmNvbS9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vY3VzdG9tLXBhdGllbnQiLCJuYW1lIjoiQ3VzdG9tUGF0aWVudCIsInN0YXR1cyI6ImFjdGl2ZSIsImZoaXJWZXJzaW9uIjoiNC4wLjEiLCJraW5kIjoicmVzb3VyY2UiLCJhYnN0cmFjdCI6ZmFsc2UsInR5cGUiOiJQYXRpZW50IiwiYmFzZURlZmluaXRpb24iOiJodHRwOi8vaGw3Lm9yZy9maGlyL1N0cnVjdHVyZURlZmluaXRpb24vUGF0aWVudCIsImRlcml2YXRpb24iOiJjb25zdHJhaW50Iiwic25hcHNob3QiOnsiZWxlbWVudCI6W3siaWQiOiJQYXRpZW50IiwicGF0aCI6IlBhdGllbnQiLCJtaW4iOjAsIm1heCI6IioifSx7ImlkIjoiUGF0aWVudC5uYW1lIiwicGF0aCI6IlBhdGllbnQubmFtZSIsIm1pbiI6MSwibWF4IjoiKiJ9XX19Cg==",
5
+ * implementation_guide: "acme-cardiology",
6
+ * profile_context: "When clinical text describes cardiology-specific findings, prefer this profile over the generic US Core Condition."
5
7
  * }
6
8
  */
7
9
  export interface ProfileUploadRequest {
@@ -1,12 +1,12 @@
1
1
  export interface SearchResponse {
2
2
  /** The FHIR resource type identified for the search */
3
- resourceType?: SearchResponse.ResourceType | undefined;
3
+ resource_type?: SearchResponse.ResourceType | undefined;
4
4
  /**
5
5
  * FHIR search parameters in standard query string format.
6
6
  * Parameters are formatted according to the FHIR specification with appropriate operators.
7
7
  * Code parameters are resolved to standard terminology codes (SNOMED CT, LOINC, RxNorm, ICD-10-CM).
8
8
  */
9
- searchParams?: string | undefined;
9
+ search_params?: string | undefined;
10
10
  }
11
11
  export declare namespace SearchResponse {
12
12
  /** The FHIR resource type identified for the search */