phenoml 2.0.0__py3-none-any.whl → 3.0.0__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/construe/__init__.py +2 -0
- phenoml/construe/client.py +36 -16
- phenoml/construe/raw_client.py +32 -12
- phenoml/construe/types/__init__.py +2 -0
- phenoml/construe/types/citation.py +36 -0
- phenoml/construe/types/extract_request_config.py +9 -0
- phenoml/construe/types/extract_request_system.py +3 -1
- phenoml/construe/types/extracted_code_result.py +14 -0
- phenoml/core/client_wrapper.py +2 -2
- phenoml/fhir/__init__.py +2 -1
- phenoml/fhir/errors/__init__.py +2 -1
- phenoml/fhir/errors/bad_gateway_error.py +11 -0
- phenoml/fhir/raw_client.py +134 -0
- phenoml/lang2fhir/__init__.py +0 -2
- phenoml/lang2fhir/client.py +8 -15
- phenoml/lang2fhir/raw_client.py +6 -13
- phenoml/lang2fhir/types/__init__.py +0 -2
- {phenoml-2.0.0.dist-info → phenoml-3.0.0.dist-info}/METADATA +1 -1
- {phenoml-2.0.0.dist-info → phenoml-3.0.0.dist-info}/RECORD +21 -20
- phenoml/lang2fhir/types/document_request_file_type.py +0 -7
- {phenoml-2.0.0.dist-info → phenoml-3.0.0.dist-info}/LICENSE +0 -0
- {phenoml-2.0.0.dist-info → phenoml-3.0.0.dist-info}/WHEEL +0 -0
phenoml/construe/__init__.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
5
|
from .types import (
|
|
6
|
+
Citation,
|
|
6
7
|
CodeResponse,
|
|
7
8
|
CodeSystemDetails,
|
|
8
9
|
CodeSystemInfo,
|
|
@@ -35,6 +36,7 @@ from .errors import (
|
|
|
35
36
|
|
|
36
37
|
__all__ = [
|
|
37
38
|
"BadRequestError",
|
|
39
|
+
"Citation",
|
|
38
40
|
"CodeResponse",
|
|
39
41
|
"CodeSystemDetails",
|
|
40
42
|
"CodeSystemInfo",
|
phenoml/construe/client.py
CHANGED
|
@@ -49,7 +49,7 @@ class ConstrueClient:
|
|
|
49
49
|
request_options: typing.Optional[RequestOptions] = None,
|
|
50
50
|
) -> ConstrueUploadCodeSystemResponse:
|
|
51
51
|
"""
|
|
52
|
-
Upload a custom medical code system with codes and descriptions for use in code extraction.
|
|
52
|
+
Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
|
|
53
53
|
Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
|
|
54
54
|
subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
|
|
55
55
|
|
|
@@ -123,7 +123,9 @@ class ConstrueClient:
|
|
|
123
123
|
request_options: typing.Optional[RequestOptions] = None,
|
|
124
124
|
) -> ExtractCodesResult:
|
|
125
125
|
"""
|
|
126
|
-
Converts natural language text into structured medical codes
|
|
126
|
+
Converts natural language text into structured medical codes.
|
|
127
|
+
|
|
128
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
127
129
|
|
|
128
130
|
Parameters
|
|
129
131
|
----------
|
|
@@ -162,7 +164,7 @@ class ConstrueClient:
|
|
|
162
164
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
163
165
|
) -> ListCodeSystemsResponse:
|
|
164
166
|
"""
|
|
165
|
-
Returns
|
|
167
|
+
Returns the terminology server's catalog of available code systems, including both built-in standard terminologies and custom uploaded systems.
|
|
166
168
|
|
|
167
169
|
Parameters
|
|
168
170
|
----------
|
|
@@ -196,7 +198,9 @@ class ConstrueClient:
|
|
|
196
198
|
request_options: typing.Optional[RequestOptions] = None,
|
|
197
199
|
) -> ListCodesResponse:
|
|
198
200
|
"""
|
|
199
|
-
Returns a paginated list of all codes in the specified code system.
|
|
201
|
+
Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
202
|
+
|
|
203
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
200
204
|
|
|
201
205
|
Parameters
|
|
202
206
|
----------
|
|
@@ -248,7 +252,9 @@ class ConstrueClient:
|
|
|
248
252
|
request_options: typing.Optional[RequestOptions] = None,
|
|
249
253
|
) -> GetCodeResponse:
|
|
250
254
|
"""
|
|
251
|
-
|
|
255
|
+
Looks up a specific code in the terminology server and returns its details.
|
|
256
|
+
|
|
257
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
252
258
|
|
|
253
259
|
Parameters
|
|
254
260
|
----------
|
|
@@ -313,6 +319,8 @@ class ConstrueClient:
|
|
|
313
319
|
|
|
314
320
|
See also: `/search/text` for faster keyword-based lookup with typo tolerance.
|
|
315
321
|
|
|
322
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
323
|
+
|
|
316
324
|
Parameters
|
|
317
325
|
----------
|
|
318
326
|
codesystem : str
|
|
@@ -354,7 +362,7 @@ class ConstrueClient:
|
|
|
354
362
|
)
|
|
355
363
|
return _response.data
|
|
356
364
|
|
|
357
|
-
def
|
|
365
|
+
def terminology_server_text_search(
|
|
358
366
|
self,
|
|
359
367
|
codesystem: str,
|
|
360
368
|
*,
|
|
@@ -383,6 +391,8 @@ class ConstrueClient:
|
|
|
383
391
|
|
|
384
392
|
See also: `/search/semantic` for finding conceptually similar codes.
|
|
385
393
|
|
|
394
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
395
|
+
|
|
386
396
|
Parameters
|
|
387
397
|
----------
|
|
388
398
|
codesystem : str
|
|
@@ -412,14 +422,14 @@ class ConstrueClient:
|
|
|
412
422
|
client = phenoml(
|
|
413
423
|
token="YOUR_TOKEN",
|
|
414
424
|
)
|
|
415
|
-
client.construe.
|
|
425
|
+
client.construe.terminology_server_text_search(
|
|
416
426
|
codesystem="ICD-10-CM",
|
|
417
427
|
q="E11.65",
|
|
418
428
|
version="version",
|
|
419
429
|
limit=1,
|
|
420
430
|
)
|
|
421
431
|
"""
|
|
422
|
-
_response = self._raw_client.
|
|
432
|
+
_response = self._raw_client.terminology_server_text_search(
|
|
423
433
|
codesystem, q=q, version=version, limit=limit, request_options=request_options
|
|
424
434
|
)
|
|
425
435
|
return _response.data
|
|
@@ -454,7 +464,7 @@ class AsyncConstrueClient:
|
|
|
454
464
|
request_options: typing.Optional[RequestOptions] = None,
|
|
455
465
|
) -> ConstrueUploadCodeSystemResponse:
|
|
456
466
|
"""
|
|
457
|
-
Upload a custom medical code system with codes and descriptions for use in code extraction.
|
|
467
|
+
Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
|
|
458
468
|
Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
|
|
459
469
|
subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
|
|
460
470
|
|
|
@@ -536,7 +546,9 @@ class AsyncConstrueClient:
|
|
|
536
546
|
request_options: typing.Optional[RequestOptions] = None,
|
|
537
547
|
) -> ExtractCodesResult:
|
|
538
548
|
"""
|
|
539
|
-
Converts natural language text into structured medical codes
|
|
549
|
+
Converts natural language text into structured medical codes.
|
|
550
|
+
|
|
551
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
540
552
|
|
|
541
553
|
Parameters
|
|
542
554
|
----------
|
|
@@ -583,7 +595,7 @@ class AsyncConstrueClient:
|
|
|
583
595
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
584
596
|
) -> ListCodeSystemsResponse:
|
|
585
597
|
"""
|
|
586
|
-
Returns
|
|
598
|
+
Returns the terminology server's catalog of available code systems, including both built-in standard terminologies and custom uploaded systems.
|
|
587
599
|
|
|
588
600
|
Parameters
|
|
589
601
|
----------
|
|
@@ -625,7 +637,9 @@ class AsyncConstrueClient:
|
|
|
625
637
|
request_options: typing.Optional[RequestOptions] = None,
|
|
626
638
|
) -> ListCodesResponse:
|
|
627
639
|
"""
|
|
628
|
-
Returns a paginated list of all codes in the specified code system.
|
|
640
|
+
Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
641
|
+
|
|
642
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
629
643
|
|
|
630
644
|
Parameters
|
|
631
645
|
----------
|
|
@@ -685,7 +699,9 @@ class AsyncConstrueClient:
|
|
|
685
699
|
request_options: typing.Optional[RequestOptions] = None,
|
|
686
700
|
) -> GetCodeResponse:
|
|
687
701
|
"""
|
|
688
|
-
|
|
702
|
+
Looks up a specific code in the terminology server and returns its details.
|
|
703
|
+
|
|
704
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
689
705
|
|
|
690
706
|
Parameters
|
|
691
707
|
----------
|
|
@@ -758,6 +774,8 @@ class AsyncConstrueClient:
|
|
|
758
774
|
|
|
759
775
|
See also: `/search/text` for faster keyword-based lookup with typo tolerance.
|
|
760
776
|
|
|
777
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
778
|
+
|
|
761
779
|
Parameters
|
|
762
780
|
----------
|
|
763
781
|
codesystem : str
|
|
@@ -807,7 +825,7 @@ class AsyncConstrueClient:
|
|
|
807
825
|
)
|
|
808
826
|
return _response.data
|
|
809
827
|
|
|
810
|
-
async def
|
|
828
|
+
async def terminology_server_text_search(
|
|
811
829
|
self,
|
|
812
830
|
codesystem: str,
|
|
813
831
|
*,
|
|
@@ -836,6 +854,8 @@ class AsyncConstrueClient:
|
|
|
836
854
|
|
|
837
855
|
See also: `/search/semantic` for finding conceptually similar codes.
|
|
838
856
|
|
|
857
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
858
|
+
|
|
839
859
|
Parameters
|
|
840
860
|
----------
|
|
841
861
|
codesystem : str
|
|
@@ -870,7 +890,7 @@ class AsyncConstrueClient:
|
|
|
870
890
|
|
|
871
891
|
|
|
872
892
|
async def main() -> None:
|
|
873
|
-
await client.construe.
|
|
893
|
+
await client.construe.terminology_server_text_search(
|
|
874
894
|
codesystem="ICD-10-CM",
|
|
875
895
|
q="E11.65",
|
|
876
896
|
version="version",
|
|
@@ -880,7 +900,7 @@ class AsyncConstrueClient:
|
|
|
880
900
|
|
|
881
901
|
asyncio.run(main())
|
|
882
902
|
"""
|
|
883
|
-
_response = await self._raw_client.
|
|
903
|
+
_response = await self._raw_client.terminology_server_text_search(
|
|
884
904
|
codesystem, q=q, version=version, limit=limit, request_options=request_options
|
|
885
905
|
)
|
|
886
906
|
return _response.data
|
phenoml/construe/raw_client.py
CHANGED
|
@@ -51,7 +51,7 @@ class RawConstrueClient:
|
|
|
51
51
|
request_options: typing.Optional[RequestOptions] = None,
|
|
52
52
|
) -> HttpResponse[ConstrueUploadCodeSystemResponse]:
|
|
53
53
|
"""
|
|
54
|
-
Upload a custom medical code system with codes and descriptions for use in code extraction.
|
|
54
|
+
Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
|
|
55
55
|
Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
|
|
56
56
|
subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
|
|
57
57
|
|
|
@@ -187,7 +187,9 @@ class RawConstrueClient:
|
|
|
187
187
|
request_options: typing.Optional[RequestOptions] = None,
|
|
188
188
|
) -> HttpResponse[ExtractCodesResult]:
|
|
189
189
|
"""
|
|
190
|
-
Converts natural language text into structured medical codes
|
|
190
|
+
Converts natural language text into structured medical codes.
|
|
191
|
+
|
|
192
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
191
193
|
|
|
192
194
|
Parameters
|
|
193
195
|
----------
|
|
@@ -287,7 +289,7 @@ class RawConstrueClient:
|
|
|
287
289
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
288
290
|
) -> HttpResponse[ListCodeSystemsResponse]:
|
|
289
291
|
"""
|
|
290
|
-
Returns
|
|
292
|
+
Returns the terminology server's catalog of available code systems, including both built-in standard terminologies and custom uploaded systems.
|
|
291
293
|
|
|
292
294
|
Parameters
|
|
293
295
|
----------
|
|
@@ -351,7 +353,9 @@ class RawConstrueClient:
|
|
|
351
353
|
request_options: typing.Optional[RequestOptions] = None,
|
|
352
354
|
) -> HttpResponse[ListCodesResponse]:
|
|
353
355
|
"""
|
|
354
|
-
Returns a paginated list of all codes in the specified code system.
|
|
356
|
+
Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
357
|
+
|
|
358
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
355
359
|
|
|
356
360
|
Parameters
|
|
357
361
|
----------
|
|
@@ -453,7 +457,9 @@ class RawConstrueClient:
|
|
|
453
457
|
request_options: typing.Optional[RequestOptions] = None,
|
|
454
458
|
) -> HttpResponse[GetCodeResponse]:
|
|
455
459
|
"""
|
|
456
|
-
|
|
460
|
+
Looks up a specific code in the terminology server and returns its details.
|
|
461
|
+
|
|
462
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
457
463
|
|
|
458
464
|
Parameters
|
|
459
465
|
----------
|
|
@@ -567,6 +573,8 @@ class RawConstrueClient:
|
|
|
567
573
|
|
|
568
574
|
See also: `/search/text` for faster keyword-based lookup with typo tolerance.
|
|
569
575
|
|
|
576
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
577
|
+
|
|
570
578
|
Parameters
|
|
571
579
|
----------
|
|
572
580
|
codesystem : str
|
|
@@ -658,7 +666,7 @@ class RawConstrueClient:
|
|
|
658
666
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
659
667
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
660
668
|
|
|
661
|
-
def
|
|
669
|
+
def terminology_server_text_search(
|
|
662
670
|
self,
|
|
663
671
|
codesystem: str,
|
|
664
672
|
*,
|
|
@@ -687,6 +695,8 @@ class RawConstrueClient:
|
|
|
687
695
|
|
|
688
696
|
See also: `/search/semantic` for finding conceptually similar codes.
|
|
689
697
|
|
|
698
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
699
|
+
|
|
690
700
|
Parameters
|
|
691
701
|
----------
|
|
692
702
|
codesystem : str
|
|
@@ -819,7 +829,7 @@ class AsyncRawConstrueClient:
|
|
|
819
829
|
request_options: typing.Optional[RequestOptions] = None,
|
|
820
830
|
) -> AsyncHttpResponse[ConstrueUploadCodeSystemResponse]:
|
|
821
831
|
"""
|
|
822
|
-
Upload a custom medical code system with codes and descriptions for use in code extraction.
|
|
832
|
+
Upload a custom medical code system with codes and descriptions for use in code extraction. Requires a paid plan.
|
|
823
833
|
Upon upload, construe generates embeddings for all of the codes in the code system and stores them in the vector database so you can
|
|
824
834
|
subsequently use the code system for construe/extract and lang2fhir/create (coming soon!)
|
|
825
835
|
|
|
@@ -955,7 +965,9 @@ class AsyncRawConstrueClient:
|
|
|
955
965
|
request_options: typing.Optional[RequestOptions] = None,
|
|
956
966
|
) -> AsyncHttpResponse[ExtractCodesResult]:
|
|
957
967
|
"""
|
|
958
|
-
Converts natural language text into structured medical codes
|
|
968
|
+
Converts natural language text into structured medical codes.
|
|
969
|
+
|
|
970
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
959
971
|
|
|
960
972
|
Parameters
|
|
961
973
|
----------
|
|
@@ -1055,7 +1067,7 @@ class AsyncRawConstrueClient:
|
|
|
1055
1067
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
1056
1068
|
) -> AsyncHttpResponse[ListCodeSystemsResponse]:
|
|
1057
1069
|
"""
|
|
1058
|
-
Returns
|
|
1070
|
+
Returns the terminology server's catalog of available code systems, including both built-in standard terminologies and custom uploaded systems.
|
|
1059
1071
|
|
|
1060
1072
|
Parameters
|
|
1061
1073
|
----------
|
|
@@ -1119,7 +1131,9 @@ class AsyncRawConstrueClient:
|
|
|
1119
1131
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1120
1132
|
) -> AsyncHttpResponse[ListCodesResponse]:
|
|
1121
1133
|
"""
|
|
1122
|
-
Returns a paginated list of all codes in the specified code system.
|
|
1134
|
+
Returns a paginated list of all codes in the specified code system from the terminology server.
|
|
1135
|
+
|
|
1136
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
1123
1137
|
|
|
1124
1138
|
Parameters
|
|
1125
1139
|
----------
|
|
@@ -1221,7 +1235,9 @@ class AsyncRawConstrueClient:
|
|
|
1221
1235
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1222
1236
|
) -> AsyncHttpResponse[GetCodeResponse]:
|
|
1223
1237
|
"""
|
|
1224
|
-
|
|
1238
|
+
Looks up a specific code in the terminology server and returns its details.
|
|
1239
|
+
|
|
1240
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
1225
1241
|
|
|
1226
1242
|
Parameters
|
|
1227
1243
|
----------
|
|
@@ -1335,6 +1351,8 @@ class AsyncRawConstrueClient:
|
|
|
1335
1351
|
|
|
1336
1352
|
See also: `/search/text` for faster keyword-based lookup with typo tolerance.
|
|
1337
1353
|
|
|
1354
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
1355
|
+
|
|
1338
1356
|
Parameters
|
|
1339
1357
|
----------
|
|
1340
1358
|
codesystem : str
|
|
@@ -1426,7 +1444,7 @@ class AsyncRawConstrueClient:
|
|
|
1426
1444
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1427
1445
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1428
1446
|
|
|
1429
|
-
async def
|
|
1447
|
+
async def terminology_server_text_search(
|
|
1430
1448
|
self,
|
|
1431
1449
|
codesystem: str,
|
|
1432
1450
|
*,
|
|
@@ -1455,6 +1473,8 @@ class AsyncRawConstrueClient:
|
|
|
1455
1473
|
|
|
1456
1474
|
See also: `/search/semantic` for finding conceptually similar codes.
|
|
1457
1475
|
|
|
1476
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
1477
|
+
|
|
1458
1478
|
Parameters
|
|
1459
1479
|
----------
|
|
1460
1480
|
codesystem : str
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
+
from .citation import Citation
|
|
5
6
|
from .code_response import CodeResponse
|
|
6
7
|
from .code_system_details import CodeSystemDetails
|
|
7
8
|
from .code_system_info import CodeSystemInfo
|
|
@@ -22,6 +23,7 @@ from .text_search_result import TextSearchResult
|
|
|
22
23
|
from .upload_request_format import UploadRequestFormat
|
|
23
24
|
|
|
24
25
|
__all__ = [
|
|
26
|
+
"Citation",
|
|
25
27
|
"CodeResponse",
|
|
26
28
|
"CodeSystemDetails",
|
|
27
29
|
"CodeSystemInfo",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Citation(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
A reference to source text that led to a code extraction
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
text: str = pydantic.Field()
|
|
15
|
+
"""
|
|
16
|
+
The exact text span containing evidence for the code
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
begin_offset: int = pydantic.Field()
|
|
20
|
+
"""
|
|
21
|
+
Starting byte offset in the original input text (0-indexed)
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
end_offset: int = pydantic.Field()
|
|
25
|
+
"""
|
|
26
|
+
Ending byte offset (exclusive), such that input[begin_offset:end_offset] == text
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
if IS_PYDANTIC_V2:
|
|
30
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
31
|
+
else:
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
frozen = True
|
|
35
|
+
smart_union = True
|
|
36
|
+
extra = pydantic.Extra.allow
|
|
@@ -50,6 +50,15 @@ class ExtractRequestConfig(UniversalBaseModel):
|
|
|
50
50
|
Whether to include codes that failed validation in the results
|
|
51
51
|
"""
|
|
52
52
|
|
|
53
|
+
include_citations: typing.Optional[bool] = pydantic.Field(default=None)
|
|
54
|
+
"""
|
|
55
|
+
Whether to include source text citations for each extracted code.
|
|
56
|
+
Citations show the exact text spans (with character offsets) that led to each code.
|
|
57
|
+
Only available when using chunking_method: "sentences".
|
|
58
|
+
The "none" method returns full text as one chunk (not useful for citations).
|
|
59
|
+
LLM-based chunking (paragraphs, topics) does not support citations.
|
|
60
|
+
"""
|
|
61
|
+
|
|
53
62
|
if IS_PYDANTIC_V2:
|
|
54
63
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
55
64
|
else:
|
|
@@ -21,7 +21,9 @@ class ExtractRequestSystem(UniversalBaseModel):
|
|
|
21
21
|
* CPT - version 2025
|
|
22
22
|
|
|
23
23
|
Custom systems:
|
|
24
|
-
* Any valid system name
|
|
24
|
+
* Any valid system name uploaded via /construe/upload. Requires a paid plan.
|
|
25
|
+
|
|
26
|
+
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
|
|
25
27
|
"""
|
|
26
28
|
|
|
27
29
|
version: typing.Optional[str] = pydantic.Field(default=None)
|
|
@@ -6,6 +6,7 @@ import pydantic
|
|
|
6
6
|
import typing_extensions
|
|
7
7
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
8
|
from ...core.serialization import FieldMetadata
|
|
9
|
+
from .citation import Citation
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class ExtractedCodeResult(UniversalBaseModel):
|
|
@@ -36,6 +37,19 @@ class ExtractedCodeResult(UniversalBaseModel):
|
|
|
36
37
|
Explanation for why this code was extracted (if include_rationale is true)
|
|
37
38
|
"""
|
|
38
39
|
|
|
40
|
+
is_ancestor: typing.Optional[bool] = pydantic.Field(default=None)
|
|
41
|
+
"""
|
|
42
|
+
Whether this code is an ancestor (parent) of an extracted code rather than directly extracted.
|
|
43
|
+
Only present when include_ancestors is true.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
citations: typing.Optional[typing.List[Citation]] = pydantic.Field(default=None)
|
|
47
|
+
"""
|
|
48
|
+
Source text references showing where this code was found in the input.
|
|
49
|
+
Only present when include_citations is true and chunking method supports it.
|
|
50
|
+
Ancestor codes do not receive citations.
|
|
51
|
+
"""
|
|
52
|
+
|
|
39
53
|
if IS_PYDANTIC_V2:
|
|
40
54
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
41
55
|
else:
|
phenoml/core/client_wrapper.py
CHANGED
|
@@ -22,10 +22,10 @@ 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/3.0.0",
|
|
26
26
|
"X-Fern-Language": "Python",
|
|
27
27
|
"X-Fern-SDK-Name": "phenoml",
|
|
28
|
-
"X-Fern-SDK-Version": "
|
|
28
|
+
"X-Fern-SDK-Version": "3.0.0",
|
|
29
29
|
**(self.get_custom_headers() or {}),
|
|
30
30
|
}
|
|
31
31
|
headers["Authorization"] = f"Bearer {self._get_token()}"
|
phenoml/fhir/__init__.py
CHANGED
|
@@ -15,9 +15,10 @@ from .types import (
|
|
|
15
15
|
FhirResourceMeta,
|
|
16
16
|
FhirSearchResponse,
|
|
17
17
|
)
|
|
18
|
-
from .errors import BadRequestError, InternalServerError, NotFoundError, UnauthorizedError
|
|
18
|
+
from .errors import BadGatewayError, BadRequestError, InternalServerError, NotFoundError, UnauthorizedError
|
|
19
19
|
|
|
20
20
|
__all__ = [
|
|
21
|
+
"BadGatewayError",
|
|
21
22
|
"BadRequestError",
|
|
22
23
|
"ErrorResponse",
|
|
23
24
|
"FhirBundle",
|
phenoml/fhir/errors/__init__.py
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
+
from .bad_gateway_error import BadGatewayError
|
|
5
6
|
from .bad_request_error import BadRequestError
|
|
6
7
|
from .internal_server_error import InternalServerError
|
|
7
8
|
from .not_found_error import NotFoundError
|
|
8
9
|
from .unauthorized_error import UnauthorizedError
|
|
9
10
|
|
|
10
|
-
__all__ = ["BadRequestError", "InternalServerError", "NotFoundError", "UnauthorizedError"]
|
|
11
|
+
__all__ = ["BadGatewayError", "BadRequestError", "InternalServerError", "NotFoundError", "UnauthorizedError"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.api_error import ApiError
|
|
6
|
+
from ..types.error_response import ErrorResponse
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BadGatewayError(ApiError):
|
|
10
|
+
def __init__(self, body: ErrorResponse, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
11
|
+
super().__init__(status_code=502, headers=headers, body=body)
|
phenoml/fhir/raw_client.py
CHANGED
|
@@ -10,10 +10,12 @@ from ..core.jsonable_encoder import jsonable_encoder
|
|
|
10
10
|
from ..core.pydantic_utilities import parse_obj_as
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
12
|
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
13
|
+
from .errors.bad_gateway_error import BadGatewayError
|
|
13
14
|
from .errors.bad_request_error import BadRequestError
|
|
14
15
|
from .errors.internal_server_error import InternalServerError
|
|
15
16
|
from .errors.not_found_error import NotFoundError
|
|
16
17
|
from .errors.unauthorized_error import UnauthorizedError
|
|
18
|
+
from .types.error_response import ErrorResponse
|
|
17
19
|
from .types.fhir_bundle import FhirBundle
|
|
18
20
|
from .types.fhir_bundle_entry_item import FhirBundleEntryItem
|
|
19
21
|
from .types.fhir_patch_request_body_item import FhirPatchRequestBodyItem
|
|
@@ -147,6 +149,17 @@ class RawFhirClient:
|
|
|
147
149
|
),
|
|
148
150
|
),
|
|
149
151
|
)
|
|
152
|
+
if _response.status_code == 502:
|
|
153
|
+
raise BadGatewayError(
|
|
154
|
+
headers=dict(_response.headers),
|
|
155
|
+
body=typing.cast(
|
|
156
|
+
ErrorResponse,
|
|
157
|
+
parse_obj_as(
|
|
158
|
+
type_=ErrorResponse, # type: ignore
|
|
159
|
+
object_=_response.json(),
|
|
160
|
+
),
|
|
161
|
+
),
|
|
162
|
+
)
|
|
150
163
|
_response_json = _response.json()
|
|
151
164
|
except JSONDecodeError:
|
|
152
165
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -269,6 +282,17 @@ class RawFhirClient:
|
|
|
269
282
|
),
|
|
270
283
|
),
|
|
271
284
|
)
|
|
285
|
+
if _response.status_code == 502:
|
|
286
|
+
raise BadGatewayError(
|
|
287
|
+
headers=dict(_response.headers),
|
|
288
|
+
body=typing.cast(
|
|
289
|
+
ErrorResponse,
|
|
290
|
+
parse_obj_as(
|
|
291
|
+
type_=ErrorResponse, # type: ignore
|
|
292
|
+
object_=_response.json(),
|
|
293
|
+
),
|
|
294
|
+
),
|
|
295
|
+
)
|
|
272
296
|
_response_json = _response.json()
|
|
273
297
|
except JSONDecodeError:
|
|
274
298
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -391,6 +415,17 @@ class RawFhirClient:
|
|
|
391
415
|
),
|
|
392
416
|
),
|
|
393
417
|
)
|
|
418
|
+
if _response.status_code == 502:
|
|
419
|
+
raise BadGatewayError(
|
|
420
|
+
headers=dict(_response.headers),
|
|
421
|
+
body=typing.cast(
|
|
422
|
+
ErrorResponse,
|
|
423
|
+
parse_obj_as(
|
|
424
|
+
type_=ErrorResponse, # type: ignore
|
|
425
|
+
object_=_response.json(),
|
|
426
|
+
),
|
|
427
|
+
),
|
|
428
|
+
)
|
|
394
429
|
_response_json = _response.json()
|
|
395
430
|
except JSONDecodeError:
|
|
396
431
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -503,6 +538,17 @@ class RawFhirClient:
|
|
|
503
538
|
),
|
|
504
539
|
),
|
|
505
540
|
)
|
|
541
|
+
if _response.status_code == 502:
|
|
542
|
+
raise BadGatewayError(
|
|
543
|
+
headers=dict(_response.headers),
|
|
544
|
+
body=typing.cast(
|
|
545
|
+
ErrorResponse,
|
|
546
|
+
parse_obj_as(
|
|
547
|
+
type_=ErrorResponse, # type: ignore
|
|
548
|
+
object_=_response.json(),
|
|
549
|
+
),
|
|
550
|
+
),
|
|
551
|
+
)
|
|
506
552
|
_response_json = _response.json()
|
|
507
553
|
except JSONDecodeError:
|
|
508
554
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -628,6 +674,17 @@ class RawFhirClient:
|
|
|
628
674
|
),
|
|
629
675
|
),
|
|
630
676
|
)
|
|
677
|
+
if _response.status_code == 502:
|
|
678
|
+
raise BadGatewayError(
|
|
679
|
+
headers=dict(_response.headers),
|
|
680
|
+
body=typing.cast(
|
|
681
|
+
ErrorResponse,
|
|
682
|
+
parse_obj_as(
|
|
683
|
+
type_=ErrorResponse, # type: ignore
|
|
684
|
+
object_=_response.json(),
|
|
685
|
+
),
|
|
686
|
+
),
|
|
687
|
+
)
|
|
631
688
|
_response_json = _response.json()
|
|
632
689
|
except JSONDecodeError:
|
|
633
690
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -741,6 +798,17 @@ class RawFhirClient:
|
|
|
741
798
|
),
|
|
742
799
|
),
|
|
743
800
|
)
|
|
801
|
+
if _response.status_code == 502:
|
|
802
|
+
raise BadGatewayError(
|
|
803
|
+
headers=dict(_response.headers),
|
|
804
|
+
body=typing.cast(
|
|
805
|
+
ErrorResponse,
|
|
806
|
+
parse_obj_as(
|
|
807
|
+
type_=ErrorResponse, # type: ignore
|
|
808
|
+
object_=_response.json(),
|
|
809
|
+
),
|
|
810
|
+
),
|
|
811
|
+
)
|
|
744
812
|
_response_json = _response.json()
|
|
745
813
|
except JSONDecodeError:
|
|
746
814
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -869,6 +937,17 @@ class AsyncRawFhirClient:
|
|
|
869
937
|
),
|
|
870
938
|
),
|
|
871
939
|
)
|
|
940
|
+
if _response.status_code == 502:
|
|
941
|
+
raise BadGatewayError(
|
|
942
|
+
headers=dict(_response.headers),
|
|
943
|
+
body=typing.cast(
|
|
944
|
+
ErrorResponse,
|
|
945
|
+
parse_obj_as(
|
|
946
|
+
type_=ErrorResponse, # type: ignore
|
|
947
|
+
object_=_response.json(),
|
|
948
|
+
),
|
|
949
|
+
),
|
|
950
|
+
)
|
|
872
951
|
_response_json = _response.json()
|
|
873
952
|
except JSONDecodeError:
|
|
874
953
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -991,6 +1070,17 @@ class AsyncRawFhirClient:
|
|
|
991
1070
|
),
|
|
992
1071
|
),
|
|
993
1072
|
)
|
|
1073
|
+
if _response.status_code == 502:
|
|
1074
|
+
raise BadGatewayError(
|
|
1075
|
+
headers=dict(_response.headers),
|
|
1076
|
+
body=typing.cast(
|
|
1077
|
+
ErrorResponse,
|
|
1078
|
+
parse_obj_as(
|
|
1079
|
+
type_=ErrorResponse, # type: ignore
|
|
1080
|
+
object_=_response.json(),
|
|
1081
|
+
),
|
|
1082
|
+
),
|
|
1083
|
+
)
|
|
994
1084
|
_response_json = _response.json()
|
|
995
1085
|
except JSONDecodeError:
|
|
996
1086
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -1113,6 +1203,17 @@ class AsyncRawFhirClient:
|
|
|
1113
1203
|
),
|
|
1114
1204
|
),
|
|
1115
1205
|
)
|
|
1206
|
+
if _response.status_code == 502:
|
|
1207
|
+
raise BadGatewayError(
|
|
1208
|
+
headers=dict(_response.headers),
|
|
1209
|
+
body=typing.cast(
|
|
1210
|
+
ErrorResponse,
|
|
1211
|
+
parse_obj_as(
|
|
1212
|
+
type_=ErrorResponse, # type: ignore
|
|
1213
|
+
object_=_response.json(),
|
|
1214
|
+
),
|
|
1215
|
+
),
|
|
1216
|
+
)
|
|
1116
1217
|
_response_json = _response.json()
|
|
1117
1218
|
except JSONDecodeError:
|
|
1118
1219
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -1225,6 +1326,17 @@ class AsyncRawFhirClient:
|
|
|
1225
1326
|
),
|
|
1226
1327
|
),
|
|
1227
1328
|
)
|
|
1329
|
+
if _response.status_code == 502:
|
|
1330
|
+
raise BadGatewayError(
|
|
1331
|
+
headers=dict(_response.headers),
|
|
1332
|
+
body=typing.cast(
|
|
1333
|
+
ErrorResponse,
|
|
1334
|
+
parse_obj_as(
|
|
1335
|
+
type_=ErrorResponse, # type: ignore
|
|
1336
|
+
object_=_response.json(),
|
|
1337
|
+
),
|
|
1338
|
+
),
|
|
1339
|
+
)
|
|
1228
1340
|
_response_json = _response.json()
|
|
1229
1341
|
except JSONDecodeError:
|
|
1230
1342
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -1350,6 +1462,17 @@ class AsyncRawFhirClient:
|
|
|
1350
1462
|
),
|
|
1351
1463
|
),
|
|
1352
1464
|
)
|
|
1465
|
+
if _response.status_code == 502:
|
|
1466
|
+
raise BadGatewayError(
|
|
1467
|
+
headers=dict(_response.headers),
|
|
1468
|
+
body=typing.cast(
|
|
1469
|
+
ErrorResponse,
|
|
1470
|
+
parse_obj_as(
|
|
1471
|
+
type_=ErrorResponse, # type: ignore
|
|
1472
|
+
object_=_response.json(),
|
|
1473
|
+
),
|
|
1474
|
+
),
|
|
1475
|
+
)
|
|
1353
1476
|
_response_json = _response.json()
|
|
1354
1477
|
except JSONDecodeError:
|
|
1355
1478
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
@@ -1463,6 +1586,17 @@ class AsyncRawFhirClient:
|
|
|
1463
1586
|
),
|
|
1464
1587
|
),
|
|
1465
1588
|
)
|
|
1589
|
+
if _response.status_code == 502:
|
|
1590
|
+
raise BadGatewayError(
|
|
1591
|
+
headers=dict(_response.headers),
|
|
1592
|
+
body=typing.cast(
|
|
1593
|
+
ErrorResponse,
|
|
1594
|
+
parse_obj_as(
|
|
1595
|
+
type_=ErrorResponse, # type: ignore
|
|
1596
|
+
object_=_response.json(),
|
|
1597
|
+
),
|
|
1598
|
+
),
|
|
1599
|
+
)
|
|
1466
1600
|
_response_json = _response.json()
|
|
1467
1601
|
except JSONDecodeError:
|
|
1468
1602
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
phenoml/lang2fhir/__init__.py
CHANGED
|
@@ -9,7 +9,6 @@ from .types import (
|
|
|
9
9
|
CreateMultiResponseBundleEntryItemRequest,
|
|
10
10
|
CreateMultiResponseResourcesItem,
|
|
11
11
|
CreateRequestResource,
|
|
12
|
-
DocumentRequestFileType,
|
|
13
12
|
DocumentRequestResource,
|
|
14
13
|
FhirResource,
|
|
15
14
|
Lang2FhirUploadProfileResponse,
|
|
@@ -26,7 +25,6 @@ __all__ = [
|
|
|
26
25
|
"CreateMultiResponseBundleEntryItemRequest",
|
|
27
26
|
"CreateMultiResponseResourcesItem",
|
|
28
27
|
"CreateRequestResource",
|
|
29
|
-
"DocumentRequestFileType",
|
|
30
28
|
"DocumentRequestResource",
|
|
31
29
|
"FailedDependencyError",
|
|
32
30
|
"FhirResource",
|
phenoml/lang2fhir/client.py
CHANGED
|
@@ -7,7 +7,6 @@ from ..core.request_options import RequestOptions
|
|
|
7
7
|
from .raw_client import AsyncRawLang2FhirClient, RawLang2FhirClient
|
|
8
8
|
from .types.create_multi_response import CreateMultiResponse
|
|
9
9
|
from .types.create_request_resource import CreateRequestResource
|
|
10
|
-
from .types.document_request_file_type import DocumentRequestFileType
|
|
11
10
|
from .types.document_request_resource import DocumentRequestResource
|
|
12
11
|
from .types.fhir_resource import FhirResource
|
|
13
12
|
from .types.lang2fhir_upload_profile_response import Lang2FhirUploadProfileResponse
|
|
@@ -223,7 +222,6 @@ class Lang2FhirClient:
|
|
|
223
222
|
version: str,
|
|
224
223
|
resource: DocumentRequestResource,
|
|
225
224
|
content: str,
|
|
226
|
-
file_type: DocumentRequestFileType,
|
|
227
225
|
request_options: typing.Optional[RequestOptions] = None,
|
|
228
226
|
) -> FhirResource:
|
|
229
227
|
"""
|
|
@@ -238,10 +236,9 @@ class Lang2FhirClient:
|
|
|
238
236
|
Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported)
|
|
239
237
|
|
|
240
238
|
content : str
|
|
241
|
-
Base64 encoded file content
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
MIME type of the file
|
|
239
|
+
Base64 encoded file content.
|
|
240
|
+
Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
|
|
241
|
+
File type is auto-detected from content magic bytes.
|
|
245
242
|
|
|
246
243
|
request_options : typing.Optional[RequestOptions]
|
|
247
244
|
Request-specific configuration.
|
|
@@ -262,11 +259,10 @@ class Lang2FhirClient:
|
|
|
262
259
|
version="R4",
|
|
263
260
|
resource="questionnaire",
|
|
264
261
|
content="content",
|
|
265
|
-
file_type="application/pdf",
|
|
266
262
|
)
|
|
267
263
|
"""
|
|
268
264
|
_response = self._raw_client.document(
|
|
269
|
-
version=version, resource=resource, content=content,
|
|
265
|
+
version=version, resource=resource, content=content, request_options=request_options
|
|
270
266
|
)
|
|
271
267
|
return _response.data
|
|
272
268
|
|
|
@@ -509,7 +505,6 @@ class AsyncLang2FhirClient:
|
|
|
509
505
|
version: str,
|
|
510
506
|
resource: DocumentRequestResource,
|
|
511
507
|
content: str,
|
|
512
|
-
file_type: DocumentRequestFileType,
|
|
513
508
|
request_options: typing.Optional[RequestOptions] = None,
|
|
514
509
|
) -> FhirResource:
|
|
515
510
|
"""
|
|
@@ -524,10 +519,9 @@ class AsyncLang2FhirClient:
|
|
|
524
519
|
Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported)
|
|
525
520
|
|
|
526
521
|
content : str
|
|
527
|
-
Base64 encoded file content
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
MIME type of the file
|
|
522
|
+
Base64 encoded file content.
|
|
523
|
+
Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
|
|
524
|
+
File type is auto-detected from content magic bytes.
|
|
531
525
|
|
|
532
526
|
request_options : typing.Optional[RequestOptions]
|
|
533
527
|
Request-specific configuration.
|
|
@@ -553,13 +547,12 @@ class AsyncLang2FhirClient:
|
|
|
553
547
|
version="R4",
|
|
554
548
|
resource="questionnaire",
|
|
555
549
|
content="content",
|
|
556
|
-
file_type="application/pdf",
|
|
557
550
|
)
|
|
558
551
|
|
|
559
552
|
|
|
560
553
|
asyncio.run(main())
|
|
561
554
|
"""
|
|
562
555
|
_response = await self._raw_client.document(
|
|
563
|
-
version=version, resource=resource, content=content,
|
|
556
|
+
version=version, resource=resource, content=content, request_options=request_options
|
|
564
557
|
)
|
|
565
558
|
return _response.data
|
phenoml/lang2fhir/raw_client.py
CHANGED
|
@@ -15,7 +15,6 @@ from .errors.internal_server_error import InternalServerError
|
|
|
15
15
|
from .errors.unauthorized_error import UnauthorizedError
|
|
16
16
|
from .types.create_multi_response import CreateMultiResponse
|
|
17
17
|
from .types.create_request_resource import CreateRequestResource
|
|
18
|
-
from .types.document_request_file_type import DocumentRequestFileType
|
|
19
18
|
from .types.document_request_resource import DocumentRequestResource
|
|
20
19
|
from .types.fhir_resource import FhirResource
|
|
21
20
|
from .types.lang2fhir_upload_profile_response import Lang2FhirUploadProfileResponse
|
|
@@ -424,7 +423,6 @@ class RawLang2FhirClient:
|
|
|
424
423
|
version: str,
|
|
425
424
|
resource: DocumentRequestResource,
|
|
426
425
|
content: str,
|
|
427
|
-
file_type: DocumentRequestFileType,
|
|
428
426
|
request_options: typing.Optional[RequestOptions] = None,
|
|
429
427
|
) -> HttpResponse[FhirResource]:
|
|
430
428
|
"""
|
|
@@ -439,10 +437,9 @@ class RawLang2FhirClient:
|
|
|
439
437
|
Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported)
|
|
440
438
|
|
|
441
439
|
content : str
|
|
442
|
-
Base64 encoded file content
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
MIME type of the file
|
|
440
|
+
Base64 encoded file content.
|
|
441
|
+
Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
|
|
442
|
+
File type is auto-detected from content magic bytes.
|
|
446
443
|
|
|
447
444
|
request_options : typing.Optional[RequestOptions]
|
|
448
445
|
Request-specific configuration.
|
|
@@ -459,7 +456,6 @@ class RawLang2FhirClient:
|
|
|
459
456
|
"version": version,
|
|
460
457
|
"resource": resource,
|
|
461
458
|
"content": content,
|
|
462
|
-
"fileType": file_type,
|
|
463
459
|
},
|
|
464
460
|
headers={
|
|
465
461
|
"content-type": "application/json",
|
|
@@ -915,7 +911,6 @@ class AsyncRawLang2FhirClient:
|
|
|
915
911
|
version: str,
|
|
916
912
|
resource: DocumentRequestResource,
|
|
917
913
|
content: str,
|
|
918
|
-
file_type: DocumentRequestFileType,
|
|
919
914
|
request_options: typing.Optional[RequestOptions] = None,
|
|
920
915
|
) -> AsyncHttpResponse[FhirResource]:
|
|
921
916
|
"""
|
|
@@ -930,10 +925,9 @@ class AsyncRawLang2FhirClient:
|
|
|
930
925
|
Type of FHIR resource to create (questionnaire and US Core questionnaireresponse profiles currently supported)
|
|
931
926
|
|
|
932
927
|
content : str
|
|
933
|
-
Base64 encoded file content
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
MIME type of the file
|
|
928
|
+
Base64 encoded file content.
|
|
929
|
+
Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg).
|
|
930
|
+
File type is auto-detected from content magic bytes.
|
|
937
931
|
|
|
938
932
|
request_options : typing.Optional[RequestOptions]
|
|
939
933
|
Request-specific configuration.
|
|
@@ -950,7 +944,6 @@ class AsyncRawLang2FhirClient:
|
|
|
950
944
|
"version": version,
|
|
951
945
|
"resource": resource,
|
|
952
946
|
"content": content,
|
|
953
|
-
"fileType": file_type,
|
|
954
947
|
},
|
|
955
948
|
headers={
|
|
956
949
|
"content-type": "application/json",
|
|
@@ -8,7 +8,6 @@ from .create_multi_response_bundle_entry_item import CreateMultiResponseBundleEn
|
|
|
8
8
|
from .create_multi_response_bundle_entry_item_request import CreateMultiResponseBundleEntryItemRequest
|
|
9
9
|
from .create_multi_response_resources_item import CreateMultiResponseResourcesItem
|
|
10
10
|
from .create_request_resource import CreateRequestResource
|
|
11
|
-
from .document_request_file_type import DocumentRequestFileType
|
|
12
11
|
from .document_request_resource import DocumentRequestResource
|
|
13
12
|
from .fhir_resource import FhirResource
|
|
14
13
|
from .lang2fhir_upload_profile_response import Lang2FhirUploadProfileResponse
|
|
@@ -22,7 +21,6 @@ __all__ = [
|
|
|
22
21
|
"CreateMultiResponseBundleEntryItemRequest",
|
|
23
22
|
"CreateMultiResponseResourcesItem",
|
|
24
23
|
"CreateRequestResource",
|
|
25
|
-
"DocumentRequestFileType",
|
|
26
24
|
"DocumentRequestResource",
|
|
27
25
|
"FhirResource",
|
|
28
26
|
"Lang2FhirUploadProfileResponse",
|
|
@@ -60,8 +60,8 @@ phenoml/cohort/raw_client.py,sha256=yhquYZ6fNyhAJG_-6YwQqLMOcIP_JvojryxOEXt_Qfc,
|
|
|
60
60
|
phenoml/cohort/types/__init__.py,sha256=zNq1Pom_534srvUJxnEcFPoUK98Cr4oYzPxvL_ifBmc,218
|
|
61
61
|
phenoml/cohort/types/cohort_response.py,sha256=A0ekTeNT6jh_yMRAcdnMoavcrqUGKZuy_6-k4YwoFmk,981
|
|
62
62
|
phenoml/cohort/types/search_concept.py,sha256=yIGRoIp8ASZ0I0G-9UA6eTseoZPwHrUuvRRQMamf4yA,1041
|
|
63
|
-
phenoml/construe/__init__.py,sha256=
|
|
64
|
-
phenoml/construe/client.py,sha256=
|
|
63
|
+
phenoml/construe/__init__.py,sha256=KHCJ7TiA4JxJ55RZpC6JQwQc5o9R7rBlBPL2pYqYOY8,1565
|
|
64
|
+
phenoml/construe/client.py,sha256=xbWorgGPs6vk4e0tmI4zst0evbMnYXeT5pHziDLHqvA,27913
|
|
65
65
|
phenoml/construe/errors/__init__.py,sha256=OW8bCfk31qWc4LNXH4Csi91w88lP8Vwjku3kN-X6dYk,718
|
|
66
66
|
phenoml/construe/errors/bad_request_error.py,sha256=nv0bK4gtOnTon6a2NdVxJxHBje_O_7wIoRtXLZHovUQ,339
|
|
67
67
|
phenoml/construe/errors/conflict_error.py,sha256=NyA4yoleBcQcrDK2rF79eVs62xclhih2kpEIBlAToow,337
|
|
@@ -71,18 +71,19 @@ phenoml/construe/errors/not_found_error.py,sha256=hQ1KdyGQJCBQqo6iLu2-szlKJdzaoV
|
|
|
71
71
|
phenoml/construe/errors/not_implemented_error.py,sha256=xI30CT0KC5dz6BojqH9VXfa9syDvBp8ofKaWv_PxM0c,343
|
|
72
72
|
phenoml/construe/errors/service_unavailable_error.py,sha256=eY72I1v4lGcCKg76JWWQhXcCIFV7ejpjEMOz4iaWJkE,347
|
|
73
73
|
phenoml/construe/errors/unauthorized_error.py,sha256=h8T6QhXuTo0GLL9MKfIM5p--wDqlB1-ZkMp3lY-aM3E,341
|
|
74
|
-
phenoml/construe/raw_client.py,sha256=
|
|
75
|
-
phenoml/construe/types/__init__.py,sha256=
|
|
74
|
+
phenoml/construe/raw_client.py,sha256=D_egRBiFICg5YSfrm9S5RdhZin8z516Wirk62sfGbBE,63264
|
|
75
|
+
phenoml/construe/types/__init__.py,sha256=OpjGeaS5BgVQhFvJs4c82KcB0_hjra_UShW5nFQalf8,1719
|
|
76
|
+
phenoml/construe/types/citation.py,sha256=8xuaHC9eRFaTIWCmS7eVGoFXIr1buNWzVkQboS8_wH8,949
|
|
76
77
|
phenoml/construe/types/code_response.py,sha256=w9DNpGQLEwCtQjY_EyQ7ARF6FFcyY0PJn5PgrmzxbwI,806
|
|
77
78
|
phenoml/construe/types/code_system_details.py,sha256=fq6SFEObhTDD4DSplavTKvcQed7AZI6IXdXL7VTCFN8,867
|
|
78
79
|
phenoml/construe/types/code_system_info.py,sha256=M5bfzOJV11UDMtTVUzDBQ_OQwmCtSccGPTTRF8Betrk,655
|
|
79
80
|
phenoml/construe/types/construe_upload_code_system_response.py,sha256=s0m5EHpkhkp7hYiC5zLZeIeqQ4mrwXlPI1Msihb-ZGo,566
|
|
80
81
|
phenoml/construe/types/extract_codes_result.py,sha256=DbVDLWqtmt9TyD5MC0q8grgnNXPnXq4eJnLDinTe0uc,701
|
|
81
|
-
phenoml/construe/types/extract_request_config.py,sha256=
|
|
82
|
+
phenoml/construe/types/extract_request_config.py,sha256=HBozvJPQJqZq1wP5WeJZnLmyBTffdcUn667luv3oCA4,2576
|
|
82
83
|
phenoml/construe/types/extract_request_config_chunking_method.py,sha256=AmVPPj0oT5r0pwWUoFxG_K8s5g8xaGYIRsPt3VvqSXQ,209
|
|
83
84
|
phenoml/construe/types/extract_request_config_validation_method.py,sha256=6uUqKn8DXF34EDtNKPa6KLW07DsxgQF2aR5BGdG5Fd4,199
|
|
84
|
-
phenoml/construe/types/extract_request_system.py,sha256=
|
|
85
|
-
phenoml/construe/types/extracted_code_result.py,sha256=
|
|
85
|
+
phenoml/construe/types/extract_request_system.py,sha256=dMLflz7FeNbXwMmoEn8jlypqnAfFr_oh2aasbdiQ-CA,1257
|
|
86
|
+
phenoml/construe/types/extracted_code_result.py,sha256=RsL8Er3m6D_FA885lsCowmDq0WTXoU_t1L4O6fyHqng,1890
|
|
86
87
|
phenoml/construe/types/get_code_response.py,sha256=cDR4SI3AvfQnpOlblXOCLOizxPjFacKmBWyC789o5cw,881
|
|
87
88
|
phenoml/construe/types/list_code_systems_response.py,sha256=XPHSKsg6sIYAyLgIlSJRtkj6KtfCslL01V21HubzyWo,612
|
|
88
89
|
phenoml/construe/types/list_codes_response.py,sha256=f5ZOQ6nYUGYX2S1nc1qtScm-EcNUHWHxpJxq9BH7pFo,909
|
|
@@ -93,7 +94,7 @@ phenoml/construe/types/text_search_result.py,sha256=FqHzcSBId9Pcp68gB10aJJYsHpsy
|
|
|
93
94
|
phenoml/construe/types/upload_request_format.py,sha256=5mJhMM7R7hn6gGQNDJT9lxPDsRpUkRzqNxtRU0Nnlls,158
|
|
94
95
|
phenoml/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
|
|
95
96
|
phenoml/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
|
|
96
|
-
phenoml/core/client_wrapper.py,sha256=
|
|
97
|
+
phenoml/core/client_wrapper.py,sha256=E4mBwSZSzQZeuL75saNbghO1DublWXn8zrJdxUrP5WI,2641
|
|
97
98
|
phenoml/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
98
99
|
phenoml/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
99
100
|
phenoml/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
|
|
@@ -106,14 +107,15 @@ phenoml/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd86
|
|
|
106
107
|
phenoml/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
|
|
107
108
|
phenoml/core/serialization.py,sha256=ECL3bvv_0i7U4uvPidZCNel--MUbA0iq0aGcNKi3kws,9818
|
|
108
109
|
phenoml/environment.py,sha256=x2TB5u9AblwVCke6_38YZmVhcjjHLE5gXBo5TMeaeO8,164
|
|
109
|
-
phenoml/fhir/__init__.py,sha256=
|
|
110
|
+
phenoml/fhir/__init__.py,sha256=zIsx4hoEBYLeZpXAleNc2zZYm48K9Cesxmu1lVB7aNo,950
|
|
110
111
|
phenoml/fhir/client.py,sha256=1hQSCDOYsC89zPlPWHJIKgVBa-j8mRT_97lDHFJ3jN8,43581
|
|
111
|
-
phenoml/fhir/errors/__init__.py,sha256=
|
|
112
|
+
phenoml/fhir/errors/__init__.py,sha256=9mougWJnia9nrNLt0kHJB7fMylhz6I9IhN4Su2XX6_E,438
|
|
113
|
+
phenoml/fhir/errors/bad_gateway_error.py,sha256=-NquqI4plYJj4z9xUwa3qvJsK5XdGMHrCL6zDxTvaaI,374
|
|
112
114
|
phenoml/fhir/errors/bad_request_error.py,sha256=nv0bK4gtOnTon6a2NdVxJxHBje_O_7wIoRtXLZHovUQ,339
|
|
113
115
|
phenoml/fhir/errors/internal_server_error.py,sha256=biBHJfSP1_zWF5CJgxY4B8wrL1uC18RSccQ-BCKmYNs,343
|
|
114
116
|
phenoml/fhir/errors/not_found_error.py,sha256=hQ1KdyGQJCBQqo6iLu2-szlKJdzaoV5odq_7kdXAEbc,337
|
|
115
117
|
phenoml/fhir/errors/unauthorized_error.py,sha256=h8T6QhXuTo0GLL9MKfIM5p--wDqlB1-ZkMp3lY-aM3E,341
|
|
116
|
-
phenoml/fhir/raw_client.py,sha256=
|
|
118
|
+
phenoml/fhir/raw_client.py,sha256=K-eBndiyB78j4BfwK7hc-XKfNrKf8e-R4zoFRMUWbHQ,71750
|
|
117
119
|
phenoml/fhir/types/__init__.py,sha256=J9Gj1h5TZ5mNjBYE-Vn2bVPR3VCRwRIf1BrS5DHQrV4,1054
|
|
118
120
|
phenoml/fhir/types/error_response.py,sha256=Vw1veSbj51ki93gmYml3fRjB6XAEwvnkcYkSNhyLDeU,897
|
|
119
121
|
phenoml/fhir/types/fhir_bundle.py,sha256=p_CsuL2U1q7Qzmkdu6vCBtNZLznWmHXw5WtMzDnstdE,1373
|
|
@@ -154,23 +156,22 @@ phenoml/fhir_provider/types/role.py,sha256=Igag80s-KaGOc4nWfrGWyT81HU__c6_WJ-1oV
|
|
|
154
156
|
phenoml/fhir_provider/types/service_account_key.py,sha256=uup1Xl0HSc_B3278i0CS-ygCroShLS5_q0KtqXI96HY,1085
|
|
155
157
|
phenoml/fhir_provider/types/service_account_metadata.py,sha256=dNOWoWaAoi3dvoA0vhxKxV9k3pYm5ib_zDM1LVNiAxk,1170
|
|
156
158
|
phenoml/fhir_provider/types/smart_configuration.py,sha256=bG_J1yNFEWWo9kjxF0s2Ik9rXehB1JHcQ2fTn6dht6k,1174
|
|
157
|
-
phenoml/lang2fhir/__init__.py,sha256=
|
|
158
|
-
phenoml/lang2fhir/client.py,sha256=
|
|
159
|
+
phenoml/lang2fhir/__init__.py,sha256=SPx4QQvm1iMFOgmmM1Meb4rzoxLulxA9BV7K8Mc_f7M,1072
|
|
160
|
+
phenoml/lang2fhir/client.py,sha256=XaOfLKx6mSZ5_kHxV61o0Gw8LCJg3hClce9cccZIdik,18425
|
|
159
161
|
phenoml/lang2fhir/errors/__init__.py,sha256=nIzg981R3USgSar0WuuVrpDVg-H5vIp2AceEzbhphGw,458
|
|
160
162
|
phenoml/lang2fhir/errors/bad_request_error.py,sha256=nv0bK4gtOnTon6a2NdVxJxHBje_O_7wIoRtXLZHovUQ,339
|
|
161
163
|
phenoml/lang2fhir/errors/failed_dependency_error.py,sha256=eXiqG062inkUF7fs2Newhx9uAKReK6fosz29PMD4gVw,345
|
|
162
164
|
phenoml/lang2fhir/errors/forbidden_error.py,sha256=ek8-sffTy9gY3F0zyaSkcskDVvq9puXP_YvvB2BJYbA,338
|
|
163
165
|
phenoml/lang2fhir/errors/internal_server_error.py,sha256=biBHJfSP1_zWF5CJgxY4B8wrL1uC18RSccQ-BCKmYNs,343
|
|
164
166
|
phenoml/lang2fhir/errors/unauthorized_error.py,sha256=h8T6QhXuTo0GLL9MKfIM5p--wDqlB1-ZkMp3lY-aM3E,341
|
|
165
|
-
phenoml/lang2fhir/raw_client.py,sha256=
|
|
166
|
-
phenoml/lang2fhir/types/__init__.py,sha256=
|
|
167
|
+
phenoml/lang2fhir/raw_client.py,sha256=U_c06qriq4GA1e6WmvWW8Pk7XGPDftfoxyCMNvW6a1U,40514
|
|
168
|
+
phenoml/lang2fhir/types/__init__.py,sha256=TZWDi-tu34TRaCPsKqYGI3_rRjM_YdTVVMrN93DdChI,1216
|
|
167
169
|
phenoml/lang2fhir/types/create_multi_response.py,sha256=GrOBnwDp7pSmCRqaaG_4jL0P1lqXYMk5ioTabVaP2zg,1212
|
|
168
170
|
phenoml/lang2fhir/types/create_multi_response_bundle.py,sha256=os13oK7NULRoN647NBfE3QuKe2Gvi2qSa6KJpkWIHsA,994
|
|
169
171
|
phenoml/lang2fhir/types/create_multi_response_bundle_entry_item.py,sha256=1qvcTZuE_WzOzwGs6CrQOaU9cCFdtH2A7EGhMR8aqL4,970
|
|
170
172
|
phenoml/lang2fhir/types/create_multi_response_bundle_entry_item_request.py,sha256=R-qHcnHjFz8rSYYDlo2Yqi7_Ul4jZtleE0BYhFA0jnE,612
|
|
171
173
|
phenoml/lang2fhir/types/create_multi_response_resources_item.py,sha256=VFggDG3w6KpskIVeSKInNrcgCFmlYmz1IFNGvMJq7hk,1119
|
|
172
174
|
phenoml/lang2fhir/types/create_request_resource.py,sha256=JyfWUXGae-BMEvjtbDqQVNyIL4Qoh7nJwJyHOwP070Q,596
|
|
173
|
-
phenoml/lang2fhir/types/document_request_file_type.py,sha256=VgPYn7FB-5hgvNsyvQEGIsEQ6F4ruM4VN9TWxr_Tfv4,212
|
|
174
175
|
phenoml/lang2fhir/types/document_request_resource.py,sha256=keHsMn9UxgHd9VUNT54Atcj4Z4YI9uU0Fj9g1RwGUrg,189
|
|
175
176
|
phenoml/lang2fhir/types/fhir_resource.py,sha256=EprHErQgwP_MkaCrul94OhkOWQcbvUjMeerF2ISh9LU,141
|
|
176
177
|
phenoml/lang2fhir/types/lang2fhir_upload_profile_response.py,sha256=X41WiVztePQtZOcNRzNsder-h3rQTj94Y622HQ1izP8,721
|
|
@@ -264,7 +265,7 @@ phenoml/workflows/types/workflows_delete_response.py,sha256=izcubUOnSNOgThD9Ozo6
|
|
|
264
265
|
phenoml/workflows/types/workflows_get_response.py,sha256=gfNyUs14JSynprRwT-fuq4IDsGrPZmUSsK3WmgqIEi8,891
|
|
265
266
|
phenoml/workflows/types/workflows_update_response.py,sha256=FEvQpC9ZRk8dV1oaIAwV5bSDD2tkXZ5fG4mozRjibuQ,1046
|
|
266
267
|
phenoml/wrapper_client.py,sha256=JYTdhXgju4tOsata06wQY_ZbMsuMj3qaxkgvDzpY068,5022
|
|
267
|
-
phenoml-
|
|
268
|
-
phenoml-
|
|
269
|
-
phenoml-
|
|
270
|
-
phenoml-
|
|
268
|
+
phenoml-3.0.0.dist-info/LICENSE,sha256=Am1fNNveR2gcmOloSWQTsnUw2SQEF8HtowFqIvlagfk,1064
|
|
269
|
+
phenoml-3.0.0.dist-info/METADATA,sha256=_XGq4Xroo4mCMcZ0Xsc1Yj-6fQcuXgd4p2BGMHTj_xs,5330
|
|
270
|
+
phenoml-3.0.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
271
|
+
phenoml-3.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|