phenoml 0.0.8__py3-none-any.whl → 0.0.10__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/client.py +38 -2
- phenoml/agent/raw_client.py +24 -0
- phenoml/client.py +4 -4
- 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 +8 -10
- phenoml/fhir/client.py +116 -14
- phenoml/fhir/raw_client.py +84 -0
- phenoml/fhir_provider/__init__.py +2 -0
- phenoml/fhir_provider/client.py +21 -4
- phenoml/fhir_provider/raw_client.py +23 -6
- phenoml/fhir_provider/types/__init__.py +2 -0
- phenoml/fhir_provider/types/auth_method.py +1 -1
- phenoml/fhir_provider/types/role.py +27 -0
- phenoml/tools/client.py +112 -6
- phenoml/tools/raw_client.py +82 -2
- {phenoml-0.0.8.dist-info → phenoml-0.0.10.dist-info}/METADATA +1 -1
- {phenoml-0.0.8.dist-info → phenoml-0.0.10.dist-info}/RECORD +26 -32
- phenoml/construe/types/bad_request_error_body.py +0 -27
- 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/construe/types/construe_cohort_response_queries_item_code_extract_results_item_codes_item.py +0 -32
- phenoml/construe/types/internal_server_error_body.py +0 -27
- phenoml/construe/types/unauthorized_error_body.py +0 -27
- {phenoml-0.0.8.dist-info → phenoml-0.0.10.dist-info}/LICENSE +0 -0
- {phenoml-0.0.8.dist-info → phenoml-0.0.10.dist-info}/WHEEL +0 -0
phenoml/core/client_wrapper.py
CHANGED
|
@@ -10,7 +10,7 @@ class BaseClientWrapper:
|
|
|
10
10
|
def __init__(
|
|
11
11
|
self,
|
|
12
12
|
*,
|
|
13
|
-
token: typing.
|
|
13
|
+
token: typing.Union[str, typing.Callable[[], str]],
|
|
14
14
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
15
15
|
base_url: str,
|
|
16
16
|
timeout: typing.Optional[float] = None,
|
|
@@ -22,19 +22,17 @@ class BaseClientWrapper:
|
|
|
22
22
|
|
|
23
23
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
24
24
|
headers: typing.Dict[str, str] = {
|
|
25
|
-
"User-Agent": "phenoml/
|
|
25
|
+
"User-Agent": "phenoml/AUTO",
|
|
26
26
|
"X-Fern-Language": "Python",
|
|
27
27
|
"X-Fern-SDK-Name": "phenoml",
|
|
28
|
-
"X-Fern-SDK-Version": "v0.0.
|
|
28
|
+
"X-Fern-SDK-Version": "v0.0.10",
|
|
29
29
|
**(self.get_custom_headers() or {}),
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
if token is not None:
|
|
33
|
-
headers["Authorization"] = f"Bearer {token}"
|
|
31
|
+
headers["Authorization"] = f"Bearer {self._get_token()}"
|
|
34
32
|
return headers
|
|
35
33
|
|
|
36
|
-
def _get_token(self) ->
|
|
37
|
-
if isinstance(self._token, str)
|
|
34
|
+
def _get_token(self) -> str:
|
|
35
|
+
if isinstance(self._token, str):
|
|
38
36
|
return self._token
|
|
39
37
|
else:
|
|
40
38
|
return self._token()
|
|
@@ -53,7 +51,7 @@ class SyncClientWrapper(BaseClientWrapper):
|
|
|
53
51
|
def __init__(
|
|
54
52
|
self,
|
|
55
53
|
*,
|
|
56
|
-
token: typing.
|
|
54
|
+
token: typing.Union[str, typing.Callable[[], str]],
|
|
57
55
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
58
56
|
base_url: str,
|
|
59
57
|
timeout: typing.Optional[float] = None,
|
|
@@ -72,7 +70,7 @@ class AsyncClientWrapper(BaseClientWrapper):
|
|
|
72
70
|
def __init__(
|
|
73
71
|
self,
|
|
74
72
|
*,
|
|
75
|
-
token: typing.
|
|
73
|
+
token: typing.Union[str, typing.Callable[[], str]],
|
|
76
74
|
headers: typing.Optional[typing.Dict[str, str]] = None,
|
|
77
75
|
base_url: str,
|
|
78
76
|
timeout: typing.Optional[float] = None,
|
phenoml/fhir/client.py
CHANGED
|
@@ -38,6 +38,7 @@ class FhirClient:
|
|
|
38
38
|
*,
|
|
39
39
|
query_parameters: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None,
|
|
40
40
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
41
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
41
42
|
request_options: typing.Optional[RequestOptions] = None,
|
|
42
43
|
) -> FhirSearchResponse:
|
|
43
44
|
"""
|
|
@@ -68,6 +69,11 @@ class FhirClient:
|
|
|
68
69
|
|
|
69
70
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
70
71
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
72
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
73
|
+
|
|
74
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
75
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
76
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
71
77
|
|
|
72
78
|
request_options : typing.Optional[RequestOptions]
|
|
73
79
|
Request-specific configuration.
|
|
@@ -87,7 +93,8 @@ class FhirClient:
|
|
|
87
93
|
client.fhir.search(
|
|
88
94
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
89
95
|
fhir_path="Patient",
|
|
90
|
-
phenoml_on_behalf_of="
|
|
96
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
97
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
91
98
|
)
|
|
92
99
|
"""
|
|
93
100
|
_response = self._raw_client.search(
|
|
@@ -95,6 +102,7 @@ class FhirClient:
|
|
|
95
102
|
fhir_path,
|
|
96
103
|
query_parameters=query_parameters,
|
|
97
104
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
105
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
98
106
|
request_options=request_options,
|
|
99
107
|
)
|
|
100
108
|
return _response.data
|
|
@@ -106,6 +114,7 @@ class FhirClient:
|
|
|
106
114
|
*,
|
|
107
115
|
resource_type: str,
|
|
108
116
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
117
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
109
118
|
id: typing.Optional[str] = OMIT,
|
|
110
119
|
meta: typing.Optional[FhirResourceMeta] = OMIT,
|
|
111
120
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -134,6 +143,11 @@ class FhirClient:
|
|
|
134
143
|
|
|
135
144
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
136
145
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
146
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
147
|
+
|
|
148
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
149
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
150
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
137
151
|
|
|
138
152
|
id : typing.Optional[str]
|
|
139
153
|
Logical ID of the resource
|
|
@@ -159,7 +173,8 @@ class FhirClient:
|
|
|
159
173
|
client.fhir.create(
|
|
160
174
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
161
175
|
fhir_path="Patient",
|
|
162
|
-
phenoml_on_behalf_of="
|
|
176
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
177
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
163
178
|
resource_type="Patient",
|
|
164
179
|
)
|
|
165
180
|
"""
|
|
@@ -168,6 +183,7 @@ class FhirClient:
|
|
|
168
183
|
fhir_path,
|
|
169
184
|
resource_type=resource_type,
|
|
170
185
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
186
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
171
187
|
id=id,
|
|
172
188
|
meta=meta,
|
|
173
189
|
request_options=request_options,
|
|
@@ -181,6 +197,7 @@ class FhirClient:
|
|
|
181
197
|
*,
|
|
182
198
|
resource_type: str,
|
|
183
199
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
200
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
184
201
|
id: typing.Optional[str] = OMIT,
|
|
185
202
|
meta: typing.Optional[FhirResourceMeta] = OMIT,
|
|
186
203
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -209,6 +226,11 @@ class FhirClient:
|
|
|
209
226
|
|
|
210
227
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
211
228
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
229
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
230
|
+
|
|
231
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
232
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
233
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
212
234
|
|
|
213
235
|
id : typing.Optional[str]
|
|
214
236
|
Logical ID of the resource
|
|
@@ -234,7 +256,8 @@ class FhirClient:
|
|
|
234
256
|
client.fhir.upsert(
|
|
235
257
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
236
258
|
fhir_path="Patient",
|
|
237
|
-
phenoml_on_behalf_of="
|
|
259
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
260
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
238
261
|
resource_type="Patient",
|
|
239
262
|
id="123",
|
|
240
263
|
)
|
|
@@ -244,6 +267,7 @@ class FhirClient:
|
|
|
244
267
|
fhir_path,
|
|
245
268
|
resource_type=resource_type,
|
|
246
269
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
270
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
247
271
|
id=id,
|
|
248
272
|
meta=meta,
|
|
249
273
|
request_options=request_options,
|
|
@@ -256,6 +280,7 @@ class FhirClient:
|
|
|
256
280
|
fhir_path: str,
|
|
257
281
|
*,
|
|
258
282
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
283
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
259
284
|
request_options: typing.Optional[RequestOptions] = None,
|
|
260
285
|
) -> typing.Dict[str, typing.Optional[typing.Any]]:
|
|
261
286
|
"""
|
|
@@ -279,6 +304,11 @@ class FhirClient:
|
|
|
279
304
|
|
|
280
305
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
281
306
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
307
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
308
|
+
|
|
309
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
310
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
311
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
282
312
|
|
|
283
313
|
request_options : typing.Optional[RequestOptions]
|
|
284
314
|
Request-specific configuration.
|
|
@@ -298,11 +328,16 @@ class FhirClient:
|
|
|
298
328
|
client.fhir.delete(
|
|
299
329
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
300
330
|
fhir_path="Patient",
|
|
301
|
-
phenoml_on_behalf_of="
|
|
331
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
332
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
302
333
|
)
|
|
303
334
|
"""
|
|
304
335
|
_response = self._raw_client.delete(
|
|
305
|
-
fhir_provider_id,
|
|
336
|
+
fhir_provider_id,
|
|
337
|
+
fhir_path,
|
|
338
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
339
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
340
|
+
request_options=request_options,
|
|
306
341
|
)
|
|
307
342
|
return _response.data
|
|
308
343
|
|
|
@@ -313,6 +348,7 @@ class FhirClient:
|
|
|
313
348
|
*,
|
|
314
349
|
request: typing.Sequence[FhirPatchRequestBodyItem],
|
|
315
350
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
351
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
316
352
|
request_options: typing.Optional[RequestOptions] = None,
|
|
317
353
|
) -> FhirResource:
|
|
318
354
|
"""
|
|
@@ -343,6 +379,11 @@ class FhirClient:
|
|
|
343
379
|
|
|
344
380
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
345
381
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
382
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
383
|
+
|
|
384
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
385
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
386
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
346
387
|
|
|
347
388
|
request_options : typing.Optional[RequestOptions]
|
|
348
389
|
Request-specific configuration.
|
|
@@ -363,7 +404,8 @@ class FhirClient:
|
|
|
363
404
|
client.fhir.patch(
|
|
364
405
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
365
406
|
fhir_path="Patient",
|
|
366
|
-
phenoml_on_behalf_of="
|
|
407
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
408
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
367
409
|
request=[
|
|
368
410
|
FhirPatchRequestBodyItem(
|
|
369
411
|
op="replace",
|
|
@@ -378,6 +420,7 @@ class FhirClient:
|
|
|
378
420
|
fhir_path,
|
|
379
421
|
request=request,
|
|
380
422
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
423
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
381
424
|
request_options=request_options,
|
|
382
425
|
)
|
|
383
426
|
return _response.data
|
|
@@ -388,6 +431,7 @@ class FhirClient:
|
|
|
388
431
|
*,
|
|
389
432
|
entry: typing.Sequence[FhirBundleEntryItem],
|
|
390
433
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
434
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
391
435
|
total: typing.Optional[int] = OMIT,
|
|
392
436
|
request_options: typing.Optional[RequestOptions] = None,
|
|
393
437
|
) -> FhirBundle:
|
|
@@ -410,6 +454,11 @@ class FhirClient:
|
|
|
410
454
|
|
|
411
455
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
412
456
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
457
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
458
|
+
|
|
459
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
460
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
461
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
413
462
|
|
|
414
463
|
total : typing.Optional[int]
|
|
415
464
|
Total number of resources that match the search criteria.
|
|
@@ -433,7 +482,8 @@ class FhirClient:
|
|
|
433
482
|
)
|
|
434
483
|
client.fhir.execute_bundle(
|
|
435
484
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
436
|
-
phenoml_on_behalf_of="
|
|
485
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
486
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
437
487
|
entry=[
|
|
438
488
|
FhirBundleEntryItem(
|
|
439
489
|
resource={
|
|
@@ -463,6 +513,7 @@ class FhirClient:
|
|
|
463
513
|
fhir_provider_id,
|
|
464
514
|
entry=entry,
|
|
465
515
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
516
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
466
517
|
total=total,
|
|
467
518
|
request_options=request_options,
|
|
468
519
|
)
|
|
@@ -491,6 +542,7 @@ class AsyncFhirClient:
|
|
|
491
542
|
*,
|
|
492
543
|
query_parameters: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None,
|
|
493
544
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
545
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
494
546
|
request_options: typing.Optional[RequestOptions] = None,
|
|
495
547
|
) -> FhirSearchResponse:
|
|
496
548
|
"""
|
|
@@ -521,6 +573,11 @@ class AsyncFhirClient:
|
|
|
521
573
|
|
|
522
574
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
523
575
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
576
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
577
|
+
|
|
578
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
579
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
580
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
524
581
|
|
|
525
582
|
request_options : typing.Optional[RequestOptions]
|
|
526
583
|
Request-specific configuration.
|
|
@@ -545,7 +602,8 @@ class AsyncFhirClient:
|
|
|
545
602
|
await client.fhir.search(
|
|
546
603
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
547
604
|
fhir_path="Patient",
|
|
548
|
-
phenoml_on_behalf_of="
|
|
605
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
606
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
549
607
|
)
|
|
550
608
|
|
|
551
609
|
|
|
@@ -556,6 +614,7 @@ class AsyncFhirClient:
|
|
|
556
614
|
fhir_path,
|
|
557
615
|
query_parameters=query_parameters,
|
|
558
616
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
617
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
559
618
|
request_options=request_options,
|
|
560
619
|
)
|
|
561
620
|
return _response.data
|
|
@@ -567,6 +626,7 @@ class AsyncFhirClient:
|
|
|
567
626
|
*,
|
|
568
627
|
resource_type: str,
|
|
569
628
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
629
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
570
630
|
id: typing.Optional[str] = OMIT,
|
|
571
631
|
meta: typing.Optional[FhirResourceMeta] = OMIT,
|
|
572
632
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -595,6 +655,11 @@ class AsyncFhirClient:
|
|
|
595
655
|
|
|
596
656
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
597
657
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
658
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
659
|
+
|
|
660
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
661
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
662
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
598
663
|
|
|
599
664
|
id : typing.Optional[str]
|
|
600
665
|
Logical ID of the resource
|
|
@@ -625,7 +690,8 @@ class AsyncFhirClient:
|
|
|
625
690
|
await client.fhir.create(
|
|
626
691
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
627
692
|
fhir_path="Patient",
|
|
628
|
-
phenoml_on_behalf_of="
|
|
693
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
694
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
629
695
|
resource_type="Patient",
|
|
630
696
|
)
|
|
631
697
|
|
|
@@ -637,6 +703,7 @@ class AsyncFhirClient:
|
|
|
637
703
|
fhir_path,
|
|
638
704
|
resource_type=resource_type,
|
|
639
705
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
706
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
640
707
|
id=id,
|
|
641
708
|
meta=meta,
|
|
642
709
|
request_options=request_options,
|
|
@@ -650,6 +717,7 @@ class AsyncFhirClient:
|
|
|
650
717
|
*,
|
|
651
718
|
resource_type: str,
|
|
652
719
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
720
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
653
721
|
id: typing.Optional[str] = OMIT,
|
|
654
722
|
meta: typing.Optional[FhirResourceMeta] = OMIT,
|
|
655
723
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -678,6 +746,11 @@ class AsyncFhirClient:
|
|
|
678
746
|
|
|
679
747
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
680
748
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
749
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
750
|
+
|
|
751
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
752
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
753
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
681
754
|
|
|
682
755
|
id : typing.Optional[str]
|
|
683
756
|
Logical ID of the resource
|
|
@@ -708,7 +781,8 @@ class AsyncFhirClient:
|
|
|
708
781
|
await client.fhir.upsert(
|
|
709
782
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
710
783
|
fhir_path="Patient",
|
|
711
|
-
phenoml_on_behalf_of="
|
|
784
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
785
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
712
786
|
resource_type="Patient",
|
|
713
787
|
id="123",
|
|
714
788
|
)
|
|
@@ -721,6 +795,7 @@ class AsyncFhirClient:
|
|
|
721
795
|
fhir_path,
|
|
722
796
|
resource_type=resource_type,
|
|
723
797
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
798
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
724
799
|
id=id,
|
|
725
800
|
meta=meta,
|
|
726
801
|
request_options=request_options,
|
|
@@ -733,6 +808,7 @@ class AsyncFhirClient:
|
|
|
733
808
|
fhir_path: str,
|
|
734
809
|
*,
|
|
735
810
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
811
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
736
812
|
request_options: typing.Optional[RequestOptions] = None,
|
|
737
813
|
) -> typing.Dict[str, typing.Optional[typing.Any]]:
|
|
738
814
|
"""
|
|
@@ -756,6 +832,11 @@ class AsyncFhirClient:
|
|
|
756
832
|
|
|
757
833
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
758
834
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
835
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
836
|
+
|
|
837
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
838
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
839
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
759
840
|
|
|
760
841
|
request_options : typing.Optional[RequestOptions]
|
|
761
842
|
Request-specific configuration.
|
|
@@ -780,14 +861,19 @@ class AsyncFhirClient:
|
|
|
780
861
|
await client.fhir.delete(
|
|
781
862
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
782
863
|
fhir_path="Patient",
|
|
783
|
-
phenoml_on_behalf_of="
|
|
864
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
865
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
784
866
|
)
|
|
785
867
|
|
|
786
868
|
|
|
787
869
|
asyncio.run(main())
|
|
788
870
|
"""
|
|
789
871
|
_response = await self._raw_client.delete(
|
|
790
|
-
fhir_provider_id,
|
|
872
|
+
fhir_provider_id,
|
|
873
|
+
fhir_path,
|
|
874
|
+
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
875
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
876
|
+
request_options=request_options,
|
|
791
877
|
)
|
|
792
878
|
return _response.data
|
|
793
879
|
|
|
@@ -798,6 +884,7 @@ class AsyncFhirClient:
|
|
|
798
884
|
*,
|
|
799
885
|
request: typing.Sequence[FhirPatchRequestBodyItem],
|
|
800
886
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
887
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
801
888
|
request_options: typing.Optional[RequestOptions] = None,
|
|
802
889
|
) -> FhirResource:
|
|
803
890
|
"""
|
|
@@ -828,6 +915,11 @@ class AsyncFhirClient:
|
|
|
828
915
|
|
|
829
916
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
830
917
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
918
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
919
|
+
|
|
920
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
921
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
922
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
831
923
|
|
|
832
924
|
request_options : typing.Optional[RequestOptions]
|
|
833
925
|
Request-specific configuration.
|
|
@@ -853,7 +945,8 @@ class AsyncFhirClient:
|
|
|
853
945
|
await client.fhir.patch(
|
|
854
946
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
855
947
|
fhir_path="Patient",
|
|
856
|
-
phenoml_on_behalf_of="
|
|
948
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
949
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
857
950
|
request=[
|
|
858
951
|
FhirPatchRequestBodyItem(
|
|
859
952
|
op="replace",
|
|
@@ -871,6 +964,7 @@ class AsyncFhirClient:
|
|
|
871
964
|
fhir_path,
|
|
872
965
|
request=request,
|
|
873
966
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
967
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
874
968
|
request_options=request_options,
|
|
875
969
|
)
|
|
876
970
|
return _response.data
|
|
@@ -881,6 +975,7 @@ class AsyncFhirClient:
|
|
|
881
975
|
*,
|
|
882
976
|
entry: typing.Sequence[FhirBundleEntryItem],
|
|
883
977
|
phenoml_on_behalf_of: typing.Optional[str] = None,
|
|
978
|
+
phenoml_fhir_provider: typing.Optional[str] = None,
|
|
884
979
|
total: typing.Optional[int] = OMIT,
|
|
885
980
|
request_options: typing.Optional[RequestOptions] = None,
|
|
886
981
|
) -> FhirBundle:
|
|
@@ -903,6 +998,11 @@ class AsyncFhirClient:
|
|
|
903
998
|
|
|
904
999
|
phenoml_on_behalf_of : typing.Optional[str]
|
|
905
1000
|
Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
|
|
1001
|
+
Must be in the format: Patient/{uuid} or Practitioner/{uuid}
|
|
1002
|
+
|
|
1003
|
+
phenoml_fhir_provider : typing.Optional[str]
|
|
1004
|
+
Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
|
|
1005
|
+
Multiple FHIR provider integrations can be provided as comma-separated values.
|
|
906
1006
|
|
|
907
1007
|
total : typing.Optional[int]
|
|
908
1008
|
Total number of resources that match the search criteria.
|
|
@@ -931,7 +1031,8 @@ class AsyncFhirClient:
|
|
|
931
1031
|
async def main() -> None:
|
|
932
1032
|
await client.fhir.execute_bundle(
|
|
933
1033
|
fhir_provider_id="550e8400-e29b-41d4-a716-446655440000",
|
|
934
|
-
phenoml_on_behalf_of="
|
|
1034
|
+
phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
|
|
1035
|
+
phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
|
|
935
1036
|
entry=[
|
|
936
1037
|
FhirBundleEntryItem(
|
|
937
1038
|
resource={
|
|
@@ -964,6 +1065,7 @@ class AsyncFhirClient:
|
|
|
964
1065
|
fhir_provider_id,
|
|
965
1066
|
entry=entry,
|
|
966
1067
|
phenoml_on_behalf_of=phenoml_on_behalf_of,
|
|
1068
|
+
phenoml_fhir_provider=phenoml_fhir_provider,
|
|
967
1069
|
total=total,
|
|
968
1070
|
request_options=request_options,
|
|
969
1071
|
)
|