phenoml 0.0.2__py3-none-any.whl → 0.0.15__py3-none-any.whl
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.
- phenoml/agent/__init__.py +6 -8
- phenoml/agent/client.py +85 -67
- phenoml/agent/raw_client.py +61 -77
- phenoml/agent/types/__init__.py +6 -8
- phenoml/agent/types/agent_create_request.py +53 -0
- phenoml/agent/types/agent_create_request_provider.py +5 -0
- phenoml/agent/types/agent_template.py +3 -6
- phenoml/agent/types/agent_template_provider.py +5 -0
- phenoml/agent/types/json_patch_operation.py +5 -1
- phenoml/client.py +12 -0
- phenoml/construe/__init__.py +2 -16
- phenoml/construe/client.py +0 -90
- phenoml/construe/raw_client.py +0 -180
- phenoml/construe/types/__init__.py +2 -20
- phenoml/construe/types/extract_request_config.py +33 -4
- phenoml/construe/types/extract_request_config_chunking_method.py +3 -1
- phenoml/construe/types/extract_request_config_validation_method.py +5 -0
- phenoml/construe/types/extract_request_system.py +2 -0
- phenoml/core/client_wrapper.py +2 -2
- phenoml/fhir/__init__.py +36 -0
- phenoml/fhir/client.py +1072 -0
- phenoml/fhir/errors/__init__.py +10 -0
- phenoml/fhir/errors/bad_request_error.py +10 -0
- phenoml/fhir/errors/internal_server_error.py +10 -0
- phenoml/fhir/errors/not_found_error.py +10 -0
- phenoml/fhir/errors/unauthorized_error.py +10 -0
- phenoml/fhir/raw_client.py +1469 -0
- phenoml/fhir/types/__init__.py +29 -0
- phenoml/{agent/types/chat_fhir_client_config.py → fhir/types/error_response.py} +11 -6
- phenoml/fhir/types/fhir_bundle.py +43 -0
- phenoml/fhir/types/fhir_bundle_entry_item.py +34 -0
- phenoml/fhir/types/fhir_bundle_entry_item_request.py +25 -0
- phenoml/fhir/types/fhir_bundle_entry_item_request_method.py +5 -0
- phenoml/{construe/types/bad_request_error_body.py → fhir/types/fhir_bundle_entry_item_response.py} +4 -7
- phenoml/fhir/types/fhir_patch_request_body_item.py +40 -0
- phenoml/fhir/types/fhir_patch_request_body_item_op.py +7 -0
- phenoml/fhir/types/fhir_resource.py +40 -0
- phenoml/fhir/types/fhir_resource_meta.py +28 -0
- phenoml/fhir/types/fhir_search_response.py +8 -0
- phenoml/fhir_provider/__init__.py +45 -0
- phenoml/fhir_provider/client.py +748 -0
- phenoml/fhir_provider/errors/__init__.py +11 -0
- phenoml/fhir_provider/errors/bad_request_error.py +10 -0
- phenoml/fhir_provider/errors/forbidden_error.py +10 -0
- phenoml/fhir_provider/errors/internal_server_error.py +10 -0
- phenoml/fhir_provider/errors/not_found_error.py +10 -0
- phenoml/fhir_provider/errors/unauthorized_error.py +10 -0
- phenoml/fhir_provider/raw_client.py +1462 -0
- phenoml/fhir_provider/types/__init__.py +37 -0
- phenoml/fhir_provider/types/auth_method.py +7 -0
- phenoml/fhir_provider/types/fhir_provider_auth_config.py +53 -0
- phenoml/fhir_provider/types/fhir_provider_delete_response.py +20 -0
- phenoml/fhir_provider/types/fhir_provider_list_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_remove_auth_config_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +22 -0
- phenoml/fhir_provider/types/fhir_provider_template.py +66 -0
- phenoml/fhir_provider/types/fhir_query_response.py +27 -0
- phenoml/fhir_provider/types/fhir_query_response_data.py +5 -0
- phenoml/fhir_provider/types/json_web_key.py +51 -0
- phenoml/fhir_provider/types/provider.py +8 -0
- phenoml/fhir_provider/types/role.py +27 -0
- phenoml/fhir_provider/types/service_account_key.py +35 -0
- phenoml/fhir_provider/types/smart_configuration.py +46 -0
- phenoml/summary/__init__.py +39 -0
- phenoml/summary/client.py +656 -0
- phenoml/summary/errors/__init__.py +11 -0
- phenoml/summary/errors/bad_request_error.py +10 -0
- phenoml/summary/errors/forbidden_error.py +10 -0
- phenoml/summary/errors/internal_server_error.py +10 -0
- phenoml/summary/errors/not_found_error.py +10 -0
- phenoml/summary/errors/unauthorized_error.py +10 -0
- phenoml/summary/raw_client.py +1190 -0
- phenoml/summary/types/__init__.py +31 -0
- phenoml/summary/types/create_summary_request_fhir_resources.py +8 -0
- phenoml/summary/types/create_summary_request_mode.py +5 -0
- phenoml/{agent/types/agent_fhir_config.py → summary/types/create_summary_response.py} +7 -9
- phenoml/summary/types/create_summary_template_response.py +23 -0
- phenoml/summary/types/fhir_bundle.py +23 -0
- phenoml/summary/types/fhir_bundle_entry_item.py +20 -0
- phenoml/summary/types/fhir_resource.py +24 -0
- phenoml/summary/types/summary_delete_template_response.py +20 -0
- phenoml/summary/types/summary_get_template_response.py +21 -0
- phenoml/summary/types/summary_list_templates_response.py +21 -0
- phenoml/summary/types/summary_template.py +41 -0
- phenoml/summary/types/summary_update_template_response.py +22 -0
- phenoml/tools/__init__.py +0 -8
- phenoml/tools/client.py +114 -44
- phenoml/tools/raw_client.py +86 -55
- phenoml/tools/types/__init__.py +0 -8
- phenoml/workflows/__init__.py +61 -0
- phenoml/workflows/client.py +694 -0
- phenoml/workflows/errors/__init__.py +11 -0
- phenoml/workflows/errors/bad_request_error.py +10 -0
- phenoml/workflows/errors/forbidden_error.py +10 -0
- phenoml/workflows/errors/internal_server_error.py +10 -0
- phenoml/workflows/errors/not_found_error.py +10 -0
- phenoml/workflows/errors/unauthorized_error.py +10 -0
- phenoml/workflows/raw_client.py +1266 -0
- phenoml/workflows/types/__init__.py +53 -0
- phenoml/workflows/types/create_workflow_request_fhir_provider_id.py +5 -0
- phenoml/workflows/types/create_workflow_response.py +44 -0
- phenoml/{tools/types/fhir_client_config.py → workflows/types/decision_node_definition.py} +7 -6
- phenoml/workflows/types/execute_workflow_response.py +30 -0
- phenoml/{construe/types/unauthorized_error_body.py → workflows/types/execute_workflow_response_results.py} +3 -8
- phenoml/workflows/types/lang2fhir_create_definition.py +37 -0
- phenoml/workflows/types/lang2fhir_search_definition.py +42 -0
- phenoml/workflows/types/list_workflows_response.py +39 -0
- phenoml/workflows/types/step_operation.py +26 -0
- phenoml/{construe/types/construe_cohort_response_queries_item_code_extract_results_item_codes_item.py → workflows/types/sub_workflow_definition.py} +7 -7
- phenoml/workflows/types/update_workflow_request_fhir_provider_id.py +5 -0
- phenoml/workflows/types/workflow_config.py +27 -0
- phenoml/workflows/types/workflow_definition.py +57 -0
- phenoml/{construe/types/internal_server_error_body.py → workflows/types/workflow_graph.py} +4 -8
- phenoml/workflows/types/workflow_response.py +61 -0
- phenoml/workflows/types/workflow_response_graph.py +23 -0
- phenoml/workflows/types/workflow_step.py +55 -0
- phenoml/workflows/types/workflow_step_summary.py +47 -0
- phenoml/workflows/types/workflow_step_summary_type.py +5 -0
- phenoml/workflows/types/workflow_step_type.py +5 -0
- phenoml/workflows/types/workflows_delete_response.py +20 -0
- phenoml/workflows/types/workflows_get_response.py +26 -0
- phenoml/workflows/types/workflows_update_response.py +31 -0
- phenoml-0.0.15.dist-info/LICENSE +21 -0
- {phenoml-0.0.2.dist-info → phenoml-0.0.15.dist-info}/METADATA +1 -1
- phenoml-0.0.15.dist-info/RECORD +242 -0
- phenoml/agent/types/agent_provider.py +0 -7
- phenoml/agent/types/provider_type.py +0 -5
- phenoml/construe/types/construe_cohort_request_config.py +0 -37
- phenoml/construe/types/construe_cohort_response.py +0 -33
- phenoml/construe/types/construe_cohort_response_queries_item.py +0 -49
- phenoml/construe/types/construe_cohort_response_queries_item_code_extract_results_item.py +0 -31
- phenoml/tools/types/cohort_request_provider.py +0 -5
- phenoml/tools/types/lang2fhir_and_create_request_provider.py +0 -7
- phenoml/tools/types/lang2fhir_and_search_request_provider.py +0 -7
- phenoml-0.0.2.dist-info/RECORD +0 -153
- {phenoml-0.0.2.dist-info → phenoml-0.0.15.dist-info}/WHEEL +0 -0
phenoml/tools/client.py
CHANGED
|
@@ -6,13 +6,9 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
7
|
from .mcp_server.client import AsyncMcpServerClient, McpServerClient
|
|
8
8
|
from .raw_client import AsyncRawToolsClient, RawToolsClient
|
|
9
|
-
from .types.cohort_request_provider import CohortRequestProvider
|
|
10
9
|
from .types.cohort_response import CohortResponse
|
|
11
|
-
from .types.fhir_client_config import FhirClientConfig
|
|
12
|
-
from .types.lang2fhir_and_create_request_provider import Lang2FhirAndCreateRequestProvider
|
|
13
10
|
from .types.lang2fhir_and_create_request_resource import Lang2FhirAndCreateRequestResource
|
|
14
11
|
from .types.lang2fhir_and_create_response import Lang2FhirAndCreateResponse
|
|
15
|
-
from .types.lang2fhir_and_search_request_provider import Lang2FhirAndSearchRequestProvider
|
|
16
12
|
from .types.lang2fhir_and_search_response import Lang2FhirAndSearchResponse
|
|
17
13
|
|
|
18
14
|
# this is used as the default value for optional parameters
|
|
@@ -40,8 +36,9 @@ class ToolsClient:
|
|
|
40
36
|
*,
|
|
41
37
|
resource: Lang2FhirAndCreateRequestResource,
|
|
42
38
|
text: str,
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
40
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
41
|
+
provider: typing.Optional[str] = OMIT,
|
|
45
42
|
request_options: typing.Optional[RequestOptions] = None,
|
|
46
43
|
) -> Lang2FhirAndCreateResponse:
|
|
47
44
|
"""
|
|
@@ -55,10 +52,16 @@ class ToolsClient:
|
|
|
55
52
|
text : str
|
|
56
53
|
Natural language text to convert to FHIR resource
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
56
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
57
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
60
58
|
|
|
61
|
-
|
|
59
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
60
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
61
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
62
|
+
|
|
63
|
+
provider : typing.Optional[str]
|
|
64
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
62
65
|
|
|
63
66
|
request_options : typing.Optional[RequestOptions]
|
|
64
67
|
Request-specific configuration.
|
|
@@ -76,12 +79,19 @@ class ToolsClient:
|
|
|
76
79
|
token="YOUR_TOKEN",
|
|
77
80
|
)
|
|
78
81
|
client.tools.create_fhir_resource(
|
|
82
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
83
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
79
84
|
resource="auto",
|
|
80
85
|
text="Patient John Doe has severe asthma with acute exacerbation",
|
|
81
86
|
)
|
|
82
87
|
"""
|
|
83
88
|
_response = self._raw_client.create_fhir_resource(
|
|
84
|
-
resource=resource,
|
|
89
|
+
resource=resource,
|
|
90
|
+
text=text,
|
|
91
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
92
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
93
|
+
provider=provider,
|
|
94
|
+
request_options=request_options,
|
|
85
95
|
)
|
|
86
96
|
return _response.data
|
|
87
97
|
|
|
@@ -89,11 +99,12 @@ class ToolsClient:
|
|
|
89
99
|
self,
|
|
90
100
|
*,
|
|
91
101
|
text: str,
|
|
102
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
103
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
92
104
|
patient_id: typing.Optional[str] = OMIT,
|
|
93
105
|
practitioner_id: typing.Optional[str] = OMIT,
|
|
94
106
|
count: typing.Optional[int] = OMIT,
|
|
95
|
-
provider: typing.Optional[
|
|
96
|
-
meta: typing.Optional[FhirClientConfig] = OMIT,
|
|
107
|
+
provider: typing.Optional[str] = OMIT,
|
|
97
108
|
request_options: typing.Optional[RequestOptions] = None,
|
|
98
109
|
) -> Lang2FhirAndSearchResponse:
|
|
99
110
|
"""
|
|
@@ -104,6 +115,14 @@ class ToolsClient:
|
|
|
104
115
|
text : str
|
|
105
116
|
Natural language text to convert to FHIR search parameters
|
|
106
117
|
|
|
118
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
119
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
120
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
121
|
+
|
|
122
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
123
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
124
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
125
|
+
|
|
107
126
|
patient_id : typing.Optional[str]
|
|
108
127
|
Patient ID to filter results
|
|
109
128
|
|
|
@@ -113,10 +132,8 @@ class ToolsClient:
|
|
|
113
132
|
count : typing.Optional[int]
|
|
114
133
|
Maximum number of results to return
|
|
115
134
|
|
|
116
|
-
provider : typing.Optional[
|
|
117
|
-
FHIR provider
|
|
118
|
-
|
|
119
|
-
meta : typing.Optional[FhirClientConfig]
|
|
135
|
+
provider : typing.Optional[str]
|
|
136
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
120
137
|
|
|
121
138
|
request_options : typing.Optional[RequestOptions]
|
|
122
139
|
Request-specific configuration.
|
|
@@ -134,16 +151,19 @@ class ToolsClient:
|
|
|
134
151
|
token="YOUR_TOKEN",
|
|
135
152
|
)
|
|
136
153
|
client.tools.search_fhir_resources(
|
|
154
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
155
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
137
156
|
text="Find all appointments for patient John Doe next week",
|
|
138
157
|
)
|
|
139
158
|
"""
|
|
140
159
|
_response = self._raw_client.search_fhir_resources(
|
|
141
160
|
text=text,
|
|
161
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
162
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
142
163
|
patient_id=patient_id,
|
|
143
164
|
practitioner_id=practitioner_id,
|
|
144
165
|
count=count,
|
|
145
166
|
provider=provider,
|
|
146
|
-
meta=meta,
|
|
147
167
|
request_options=request_options,
|
|
148
168
|
)
|
|
149
169
|
return _response.data
|
|
@@ -152,8 +172,9 @@ class ToolsClient:
|
|
|
152
172
|
self,
|
|
153
173
|
*,
|
|
154
174
|
text: str,
|
|
155
|
-
provider:
|
|
156
|
-
|
|
175
|
+
provider: str,
|
|
176
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
177
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
157
178
|
request_options: typing.Optional[RequestOptions] = None,
|
|
158
179
|
) -> CohortResponse:
|
|
159
180
|
"""
|
|
@@ -164,10 +185,16 @@ class ToolsClient:
|
|
|
164
185
|
text : str
|
|
165
186
|
Natural language text describing the patient cohort criteria
|
|
166
187
|
|
|
167
|
-
provider :
|
|
168
|
-
FHIR provider
|
|
188
|
+
provider : str
|
|
189
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
190
|
+
|
|
191
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
192
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
193
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
169
194
|
|
|
170
|
-
|
|
195
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
196
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
197
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
171
198
|
|
|
172
199
|
request_options : typing.Optional[RequestOptions]
|
|
173
200
|
Request-specific configuration.
|
|
@@ -185,12 +212,18 @@ class ToolsClient:
|
|
|
185
212
|
token="YOUR_TOKEN",
|
|
186
213
|
)
|
|
187
214
|
client.tools.analyze_cohort(
|
|
215
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
216
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
188
217
|
text="female patients over 20 with diabetes but not hypertension",
|
|
189
|
-
provider="
|
|
218
|
+
provider="550e8400-e29b-41d4-a716-446655440000",
|
|
190
219
|
)
|
|
191
220
|
"""
|
|
192
221
|
_response = self._raw_client.analyze_cohort(
|
|
193
|
-
text=text,
|
|
222
|
+
text=text,
|
|
223
|
+
provider=provider,
|
|
224
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
225
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
226
|
+
request_options=request_options,
|
|
194
227
|
)
|
|
195
228
|
return _response.data
|
|
196
229
|
|
|
@@ -216,8 +249,9 @@ class AsyncToolsClient:
|
|
|
216
249
|
*,
|
|
217
250
|
resource: Lang2FhirAndCreateRequestResource,
|
|
218
251
|
text: str,
|
|
219
|
-
|
|
220
|
-
|
|
252
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
253
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
254
|
+
provider: typing.Optional[str] = OMIT,
|
|
221
255
|
request_options: typing.Optional[RequestOptions] = None,
|
|
222
256
|
) -> Lang2FhirAndCreateResponse:
|
|
223
257
|
"""
|
|
@@ -231,10 +265,16 @@ class AsyncToolsClient:
|
|
|
231
265
|
text : str
|
|
232
266
|
Natural language text to convert to FHIR resource
|
|
233
267
|
|
|
234
|
-
|
|
235
|
-
|
|
268
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
269
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
270
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
236
271
|
|
|
237
|
-
|
|
272
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
273
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
274
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
275
|
+
|
|
276
|
+
provider : typing.Optional[str]
|
|
277
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
238
278
|
|
|
239
279
|
request_options : typing.Optional[RequestOptions]
|
|
240
280
|
Request-specific configuration.
|
|
@@ -257,6 +297,8 @@ class AsyncToolsClient:
|
|
|
257
297
|
|
|
258
298
|
async def main() -> None:
|
|
259
299
|
await client.tools.create_fhir_resource(
|
|
300
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
301
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
260
302
|
resource="auto",
|
|
261
303
|
text="Patient John Doe has severe asthma with acute exacerbation",
|
|
262
304
|
)
|
|
@@ -265,7 +307,12 @@ class AsyncToolsClient:
|
|
|
265
307
|
asyncio.run(main())
|
|
266
308
|
"""
|
|
267
309
|
_response = await self._raw_client.create_fhir_resource(
|
|
268
|
-
resource=resource,
|
|
310
|
+
resource=resource,
|
|
311
|
+
text=text,
|
|
312
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
313
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
314
|
+
provider=provider,
|
|
315
|
+
request_options=request_options,
|
|
269
316
|
)
|
|
270
317
|
return _response.data
|
|
271
318
|
|
|
@@ -273,11 +320,12 @@ class AsyncToolsClient:
|
|
|
273
320
|
self,
|
|
274
321
|
*,
|
|
275
322
|
text: str,
|
|
323
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
324
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
276
325
|
patient_id: typing.Optional[str] = OMIT,
|
|
277
326
|
practitioner_id: typing.Optional[str] = OMIT,
|
|
278
327
|
count: typing.Optional[int] = OMIT,
|
|
279
|
-
provider: typing.Optional[
|
|
280
|
-
meta: typing.Optional[FhirClientConfig] = OMIT,
|
|
328
|
+
provider: typing.Optional[str] = OMIT,
|
|
281
329
|
request_options: typing.Optional[RequestOptions] = None,
|
|
282
330
|
) -> Lang2FhirAndSearchResponse:
|
|
283
331
|
"""
|
|
@@ -288,6 +336,14 @@ class AsyncToolsClient:
|
|
|
288
336
|
text : str
|
|
289
337
|
Natural language text to convert to FHIR search parameters
|
|
290
338
|
|
|
339
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
340
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
341
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
342
|
+
|
|
343
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
344
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
345
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
346
|
+
|
|
291
347
|
patient_id : typing.Optional[str]
|
|
292
348
|
Patient ID to filter results
|
|
293
349
|
|
|
@@ -297,10 +353,8 @@ class AsyncToolsClient:
|
|
|
297
353
|
count : typing.Optional[int]
|
|
298
354
|
Maximum number of results to return
|
|
299
355
|
|
|
300
|
-
provider : typing.Optional[
|
|
301
|
-
FHIR provider
|
|
302
|
-
|
|
303
|
-
meta : typing.Optional[FhirClientConfig]
|
|
356
|
+
provider : typing.Optional[str]
|
|
357
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
304
358
|
|
|
305
359
|
request_options : typing.Optional[RequestOptions]
|
|
306
360
|
Request-specific configuration.
|
|
@@ -323,6 +377,8 @@ class AsyncToolsClient:
|
|
|
323
377
|
|
|
324
378
|
async def main() -> None:
|
|
325
379
|
await client.tools.search_fhir_resources(
|
|
380
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
381
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
326
382
|
text="Find all appointments for patient John Doe next week",
|
|
327
383
|
)
|
|
328
384
|
|
|
@@ -331,11 +387,12 @@ class AsyncToolsClient:
|
|
|
331
387
|
"""
|
|
332
388
|
_response = await self._raw_client.search_fhir_resources(
|
|
333
389
|
text=text,
|
|
390
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
391
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
334
392
|
patient_id=patient_id,
|
|
335
393
|
practitioner_id=practitioner_id,
|
|
336
394
|
count=count,
|
|
337
395
|
provider=provider,
|
|
338
|
-
meta=meta,
|
|
339
396
|
request_options=request_options,
|
|
340
397
|
)
|
|
341
398
|
return _response.data
|
|
@@ -344,8 +401,9 @@ class AsyncToolsClient:
|
|
|
344
401
|
self,
|
|
345
402
|
*,
|
|
346
403
|
text: str,
|
|
347
|
-
provider:
|
|
348
|
-
|
|
404
|
+
provider: str,
|
|
405
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
406
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
349
407
|
request_options: typing.Optional[RequestOptions] = None,
|
|
350
408
|
) -> CohortResponse:
|
|
351
409
|
"""
|
|
@@ -356,10 +414,16 @@ class AsyncToolsClient:
|
|
|
356
414
|
text : str
|
|
357
415
|
Natural language text describing the patient cohort criteria
|
|
358
416
|
|
|
359
|
-
provider :
|
|
360
|
-
FHIR provider
|
|
417
|
+
provider : str
|
|
418
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
419
|
+
|
|
420
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
421
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
422
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
361
423
|
|
|
362
|
-
|
|
424
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
425
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
426
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
363
427
|
|
|
364
428
|
request_options : typing.Optional[RequestOptions]
|
|
365
429
|
Request-specific configuration.
|
|
@@ -382,14 +446,20 @@ class AsyncToolsClient:
|
|
|
382
446
|
|
|
383
447
|
async def main() -> None:
|
|
384
448
|
await client.tools.analyze_cohort(
|
|
449
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
450
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
385
451
|
text="female patients over 20 with diabetes but not hypertension",
|
|
386
|
-
provider="
|
|
452
|
+
provider="550e8400-e29b-41d4-a716-446655440000",
|
|
387
453
|
)
|
|
388
454
|
|
|
389
455
|
|
|
390
456
|
asyncio.run(main())
|
|
391
457
|
"""
|
|
392
458
|
_response = await self._raw_client.analyze_cohort(
|
|
393
|
-
text=text,
|
|
459
|
+
text=text,
|
|
460
|
+
provider=provider,
|
|
461
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
462
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
463
|
+
request_options=request_options,
|
|
394
464
|
)
|
|
395
465
|
return _response.data
|
phenoml/tools/raw_client.py
CHANGED
|
@@ -8,19 +8,14 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
8
8
|
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
9
|
from ..core.pydantic_utilities import parse_obj_as
|
|
10
10
|
from ..core.request_options import RequestOptions
|
|
11
|
-
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
12
11
|
from .errors.bad_request_error import BadRequestError
|
|
13
12
|
from .errors.failed_dependency_error import FailedDependencyError
|
|
14
13
|
from .errors.forbidden_error import ForbiddenError
|
|
15
14
|
from .errors.internal_server_error import InternalServerError
|
|
16
15
|
from .errors.unauthorized_error import UnauthorizedError
|
|
17
|
-
from .types.cohort_request_provider import CohortRequestProvider
|
|
18
16
|
from .types.cohort_response import CohortResponse
|
|
19
|
-
from .types.fhir_client_config import FhirClientConfig
|
|
20
|
-
from .types.lang2fhir_and_create_request_provider import Lang2FhirAndCreateRequestProvider
|
|
21
17
|
from .types.lang2fhir_and_create_request_resource import Lang2FhirAndCreateRequestResource
|
|
22
18
|
from .types.lang2fhir_and_create_response import Lang2FhirAndCreateResponse
|
|
23
|
-
from .types.lang2fhir_and_search_request_provider import Lang2FhirAndSearchRequestProvider
|
|
24
19
|
from .types.lang2fhir_and_search_response import Lang2FhirAndSearchResponse
|
|
25
20
|
|
|
26
21
|
# this is used as the default value for optional parameters
|
|
@@ -36,8 +31,9 @@ class RawToolsClient:
|
|
|
36
31
|
*,
|
|
37
32
|
resource: Lang2FhirAndCreateRequestResource,
|
|
38
33
|
text: str,
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
35
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
36
|
+
provider: typing.Optional[str] = OMIT,
|
|
41
37
|
request_options: typing.Optional[RequestOptions] = None,
|
|
42
38
|
) -> HttpResponse[Lang2FhirAndCreateResponse]:
|
|
43
39
|
"""
|
|
@@ -51,10 +47,16 @@ class RawToolsClient:
|
|
|
51
47
|
text : str
|
|
52
48
|
Natural language text to convert to FHIR resource
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
51
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
52
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
55
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
56
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
57
|
+
|
|
58
|
+
provider : typing.Optional[str]
|
|
59
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
58
60
|
|
|
59
61
|
request_options : typing.Optional[RequestOptions]
|
|
60
62
|
Request-specific configuration.
|
|
@@ -71,12 +73,11 @@ class RawToolsClient:
|
|
|
71
73
|
"resource": resource,
|
|
72
74
|
"text": text,
|
|
73
75
|
"provider": provider,
|
|
74
|
-
"meta": convert_and_respect_annotation_metadata(
|
|
75
|
-
object_=meta, annotation=FhirClientConfig, direction="write"
|
|
76
|
-
),
|
|
77
76
|
},
|
|
78
77
|
headers={
|
|
79
78
|
"content-type": "application/json",
|
|
79
|
+
"X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
|
|
80
|
+
"X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
|
|
80
81
|
},
|
|
81
82
|
request_options=request_options,
|
|
82
83
|
omit=OMIT,
|
|
@@ -155,11 +156,12 @@ class RawToolsClient:
|
|
|
155
156
|
self,
|
|
156
157
|
*,
|
|
157
158
|
text: str,
|
|
159
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
160
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
158
161
|
patient_id: typing.Optional[str] = OMIT,
|
|
159
162
|
practitioner_id: typing.Optional[str] = OMIT,
|
|
160
163
|
count: typing.Optional[int] = OMIT,
|
|
161
|
-
provider: typing.Optional[
|
|
162
|
-
meta: typing.Optional[FhirClientConfig] = OMIT,
|
|
164
|
+
provider: typing.Optional[str] = OMIT,
|
|
163
165
|
request_options: typing.Optional[RequestOptions] = None,
|
|
164
166
|
) -> HttpResponse[Lang2FhirAndSearchResponse]:
|
|
165
167
|
"""
|
|
@@ -170,6 +172,14 @@ class RawToolsClient:
|
|
|
170
172
|
text : str
|
|
171
173
|
Natural language text to convert to FHIR search parameters
|
|
172
174
|
|
|
175
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
176
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
177
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
178
|
+
|
|
179
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
180
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
181
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
182
|
+
|
|
173
183
|
patient_id : typing.Optional[str]
|
|
174
184
|
Patient ID to filter results
|
|
175
185
|
|
|
@@ -179,10 +189,8 @@ class RawToolsClient:
|
|
|
179
189
|
count : typing.Optional[int]
|
|
180
190
|
Maximum number of results to return
|
|
181
191
|
|
|
182
|
-
provider : typing.Optional[
|
|
183
|
-
FHIR provider
|
|
184
|
-
|
|
185
|
-
meta : typing.Optional[FhirClientConfig]
|
|
192
|
+
provider : typing.Optional[str]
|
|
193
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
186
194
|
|
|
187
195
|
request_options : typing.Optional[RequestOptions]
|
|
188
196
|
Request-specific configuration.
|
|
@@ -201,12 +209,11 @@ class RawToolsClient:
|
|
|
201
209
|
"practitioner_id": practitioner_id,
|
|
202
210
|
"count": count,
|
|
203
211
|
"provider": provider,
|
|
204
|
-
"meta": convert_and_respect_annotation_metadata(
|
|
205
|
-
object_=meta, annotation=FhirClientConfig, direction="write"
|
|
206
|
-
),
|
|
207
212
|
},
|
|
208
213
|
headers={
|
|
209
214
|
"content-type": "application/json",
|
|
215
|
+
"X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
|
|
216
|
+
"X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
|
|
210
217
|
},
|
|
211
218
|
request_options=request_options,
|
|
212
219
|
omit=OMIT,
|
|
@@ -285,8 +292,9 @@ class RawToolsClient:
|
|
|
285
292
|
self,
|
|
286
293
|
*,
|
|
287
294
|
text: str,
|
|
288
|
-
provider:
|
|
289
|
-
|
|
295
|
+
provider: str,
|
|
296
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
297
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
290
298
|
request_options: typing.Optional[RequestOptions] = None,
|
|
291
299
|
) -> HttpResponse[CohortResponse]:
|
|
292
300
|
"""
|
|
@@ -297,10 +305,16 @@ class RawToolsClient:
|
|
|
297
305
|
text : str
|
|
298
306
|
Natural language text describing the patient cohort criteria
|
|
299
307
|
|
|
300
|
-
provider :
|
|
301
|
-
FHIR provider
|
|
308
|
+
provider : str
|
|
309
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
310
|
+
|
|
311
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
312
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
313
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
302
314
|
|
|
303
|
-
|
|
315
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
316
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
317
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
304
318
|
|
|
305
319
|
request_options : typing.Optional[RequestOptions]
|
|
306
320
|
Request-specific configuration.
|
|
@@ -316,12 +330,11 @@ class RawToolsClient:
|
|
|
316
330
|
json={
|
|
317
331
|
"text": text,
|
|
318
332
|
"provider": provider,
|
|
319
|
-
"meta": convert_and_respect_annotation_metadata(
|
|
320
|
-
object_=meta, annotation=FhirClientConfig, direction="write"
|
|
321
|
-
),
|
|
322
333
|
},
|
|
323
334
|
headers={
|
|
324
335
|
"content-type": "application/json",
|
|
336
|
+
"X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
|
|
337
|
+
"X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
|
|
325
338
|
},
|
|
326
339
|
request_options=request_options,
|
|
327
340
|
omit=OMIT,
|
|
@@ -395,8 +408,9 @@ class AsyncRawToolsClient:
|
|
|
395
408
|
*,
|
|
396
409
|
resource: Lang2FhirAndCreateRequestResource,
|
|
397
410
|
text: str,
|
|
398
|
-
|
|
399
|
-
|
|
411
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
412
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
413
|
+
provider: typing.Optional[str] = OMIT,
|
|
400
414
|
request_options: typing.Optional[RequestOptions] = None,
|
|
401
415
|
) -> AsyncHttpResponse[Lang2FhirAndCreateResponse]:
|
|
402
416
|
"""
|
|
@@ -410,10 +424,16 @@ class AsyncRawToolsClient:
|
|
|
410
424
|
text : str
|
|
411
425
|
Natural language text to convert to FHIR resource
|
|
412
426
|
|
|
413
|
-
|
|
414
|
-
|
|
427
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
428
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
429
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
415
430
|
|
|
416
|
-
|
|
431
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
432
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
433
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
434
|
+
|
|
435
|
+
provider : typing.Optional[str]
|
|
436
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
417
437
|
|
|
418
438
|
request_options : typing.Optional[RequestOptions]
|
|
419
439
|
Request-specific configuration.
|
|
@@ -430,12 +450,11 @@ class AsyncRawToolsClient:
|
|
|
430
450
|
"resource": resource,
|
|
431
451
|
"text": text,
|
|
432
452
|
"provider": provider,
|
|
433
|
-
"meta": convert_and_respect_annotation_metadata(
|
|
434
|
-
object_=meta, annotation=FhirClientConfig, direction="write"
|
|
435
|
-
),
|
|
436
453
|
},
|
|
437
454
|
headers={
|
|
438
455
|
"content-type": "application/json",
|
|
456
|
+
"X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
|
|
457
|
+
"X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
|
|
439
458
|
},
|
|
440
459
|
request_options=request_options,
|
|
441
460
|
omit=OMIT,
|
|
@@ -514,11 +533,12 @@ class AsyncRawToolsClient:
|
|
|
514
533
|
self,
|
|
515
534
|
*,
|
|
516
535
|
text: str,
|
|
536
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
537
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
517
538
|
patient_id: typing.Optional[str] = OMIT,
|
|
518
539
|
practitioner_id: typing.Optional[str] = OMIT,
|
|
519
540
|
count: typing.Optional[int] = OMIT,
|
|
520
|
-
provider: typing.Optional[
|
|
521
|
-
meta: typing.Optional[FhirClientConfig] = OMIT,
|
|
541
|
+
provider: typing.Optional[str] = OMIT,
|
|
522
542
|
request_options: typing.Optional[RequestOptions] = None,
|
|
523
543
|
) -> AsyncHttpResponse[Lang2FhirAndSearchResponse]:
|
|
524
544
|
"""
|
|
@@ -529,6 +549,14 @@ class AsyncRawToolsClient:
|
|
|
529
549
|
text : str
|
|
530
550
|
Natural language text to convert to FHIR search parameters
|
|
531
551
|
|
|
552
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
553
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
554
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
555
|
+
|
|
556
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
557
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
558
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
559
|
+
|
|
532
560
|
patient_id : typing.Optional[str]
|
|
533
561
|
Patient ID to filter results
|
|
534
562
|
|
|
@@ -538,10 +566,8 @@ class AsyncRawToolsClient:
|
|
|
538
566
|
count : typing.Optional[int]
|
|
539
567
|
Maximum number of results to return
|
|
540
568
|
|
|
541
|
-
provider : typing.Optional[
|
|
542
|
-
FHIR provider
|
|
543
|
-
|
|
544
|
-
meta : typing.Optional[FhirClientConfig]
|
|
569
|
+
provider : typing.Optional[str]
|
|
570
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
545
571
|
|
|
546
572
|
request_options : typing.Optional[RequestOptions]
|
|
547
573
|
Request-specific configuration.
|
|
@@ -560,12 +586,11 @@ class AsyncRawToolsClient:
|
|
|
560
586
|
"practitioner_id": practitioner_id,
|
|
561
587
|
"count": count,
|
|
562
588
|
"provider": provider,
|
|
563
|
-
"meta": convert_and_respect_annotation_metadata(
|
|
564
|
-
object_=meta, annotation=FhirClientConfig, direction="write"
|
|
565
|
-
),
|
|
566
589
|
},
|
|
567
590
|
headers={
|
|
568
591
|
"content-type": "application/json",
|
|
592
|
+
"X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
|
|
593
|
+
"X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
|
|
569
594
|
},
|
|
570
595
|
request_options=request_options,
|
|
571
596
|
omit=OMIT,
|
|
@@ -644,8 +669,9 @@ class AsyncRawToolsClient:
|
|
|
644
669
|
self,
|
|
645
670
|
*,
|
|
646
671
|
text: str,
|
|
647
|
-
provider:
|
|
648
|
-
|
|
672
|
+
provider: str,
|
|
673
|
+
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
674
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
649
675
|
request_options: typing.Optional[RequestOptions] = None,
|
|
650
676
|
) -> AsyncHttpResponse[CohortResponse]:
|
|
651
677
|
"""
|
|
@@ -656,10 +682,16 @@ class AsyncRawToolsClient:
|
|
|
656
682
|
text : str
|
|
657
683
|
Natural language text describing the patient cohort criteria
|
|
658
684
|
|
|
659
|
-
provider :
|
|
660
|
-
FHIR provider
|
|
685
|
+
provider : str
|
|
686
|
+
FHIR provider ID - must be a valid UUID from existing FHIR providers. also supports provider by name (e.g. medplum)
|
|
687
|
+
|
|
688
|
+
phenoml_on_behalf_of : typing.Optional[str]
|
|
689
|
+
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
690
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
661
691
|
|
|
662
|
-
|
|
692
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
693
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
694
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
663
695
|
|
|
664
696
|
request_options : typing.Optional[RequestOptions]
|
|
665
697
|
Request-specific configuration.
|
|
@@ -675,12 +707,11 @@ class AsyncRawToolsClient:
|
|
|
675
707
|
json={
|
|
676
708
|
"text": text,
|
|
677
709
|
"provider": provider,
|
|
678
|
-
"meta": convert_and_respect_annotation_metadata(
|
|
679
|
-
object_=meta, annotation=FhirClientConfig, direction="write"
|
|
680
|
-
),
|
|
681
710
|
},
|
|
682
711
|
headers={
|
|
683
712
|
"content-type": "application/json",
|
|
713
|
+
"X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
|
|
714
|
+
"X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
|
|
684
715
|
},
|
|
685
716
|
request_options=request_options,
|
|
686
717
|
omit=OMIT,
|