phenoml 0.0.16__py3-none-any.whl → 0.0.18__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.
@@ -16,7 +16,10 @@ class ExtractRequestConfig(UniversalBaseModel):
16
16
 
17
17
  max_codes_per_chunk: typing.Optional[int] = pydantic.Field(default=None)
18
18
  """
19
- Maximum number of codes to extract per chunk
19
+ Maximum number of codes to extract per chunk. If not specified, uses system-specific defaults:
20
+ * SNOMED: 10
21
+ * LOINC, HPO, RXNORM: 20
22
+ * All other systems: 5
20
23
  """
21
24
 
22
25
  code_similarity_filter: typing.Optional[float] = pydantic.Field(default=None)
@@ -42,6 +45,11 @@ class ExtractRequestConfig(UniversalBaseModel):
42
45
  Whether to include ancestor/parent codes in the results
43
46
  """
44
47
 
48
+ include_invalid: typing.Optional[bool] = pydantic.Field(default=None)
49
+ """
50
+ Whether to include codes that failed validation in the results
51
+ """
52
+
45
53
  if IS_PYDANTIC_V2:
46
54
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
47
55
  else:
@@ -19,6 +19,11 @@ class ExtractedCodeResult(UniversalBaseModel):
19
19
  Short description of the code
20
20
  """
21
21
 
22
+ valid: bool = pydantic.Field()
23
+ """
24
+ Whether the code passed validation. Always true unless include_invalid is set to true, in which case invalid codes will have this set to false.
25
+ """
26
+
22
27
  long_description: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="longDescription")] = (
23
28
  pydantic.Field(default=None)
24
29
  )
@@ -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/v0.0.16",
25
+ "User-Agent": "phenoml/v0.0.18",
26
26
  "X-Fern-Language": "Python",
27
27
  "X-Fern-SDK-Name": "phenoml",
28
- "X-Fern-SDK-Version": "v0.0.16",
28
+ "X-Fern-SDK-Version": "v0.0.18",
29
29
  **(self.get_custom_headers() or {}),
30
30
  }
31
31
  headers["Authorization"] = f"Bearer {self._get_token()}"
@@ -3,6 +3,11 @@
3
3
  # isort: skip_file
4
4
 
5
5
  from .types import (
6
+ CreateMultiResponse,
7
+ CreateMultiResponseBundle,
8
+ CreateMultiResponseBundleEntryItem,
9
+ CreateMultiResponseBundleEntryItemRequest,
10
+ CreateMultiResponseResourcesItem,
6
11
  CreateRequestResource,
7
12
  DocumentRequestFileType,
8
13
  DocumentRequestResource,
@@ -14,6 +19,11 @@ from .errors import BadRequestError, FailedDependencyError, ForbiddenError, Inte
14
19
 
15
20
  __all__ = [
16
21
  "BadRequestError",
22
+ "CreateMultiResponse",
23
+ "CreateMultiResponseBundle",
24
+ "CreateMultiResponseBundleEntryItem",
25
+ "CreateMultiResponseBundleEntryItemRequest",
26
+ "CreateMultiResponseResourcesItem",
17
27
  "CreateRequestResource",
18
28
  "DocumentRequestFileType",
19
29
  "DocumentRequestResource",
@@ -5,6 +5,7 @@ import typing
5
5
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ..core.request_options import RequestOptions
7
7
  from .raw_client import AsyncRawLang2FhirClient, RawLang2FhirClient
8
+ from .types.create_multi_response import CreateMultiResponse
8
9
  from .types.create_request_resource import CreateRequestResource
9
10
  from .types.document_request_file_type import DocumentRequestFileType
10
11
  from .types.document_request_resource import DocumentRequestResource
@@ -79,6 +80,54 @@ class Lang2FhirClient:
79
80
  )
80
81
  return _response.data
81
82
 
83
+ def create_multi(
84
+ self,
85
+ *,
86
+ text: str,
87
+ version: typing.Optional[str] = OMIT,
88
+ provider: typing.Optional[str] = OMIT,
89
+ request_options: typing.Optional[RequestOptions] = None,
90
+ ) -> CreateMultiResponse:
91
+ """
92
+ Analyzes natural language text and extracts multiple FHIR resources, returning them as a transaction Bundle.
93
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text.
94
+ Resources are linked with proper references (e.g., Conditions reference the Patient).
95
+
96
+ Parameters
97
+ ----------
98
+ text : str
99
+ Natural language text containing multiple clinical concepts to extract
100
+
101
+ version : typing.Optional[str]
102
+ FHIR version to use
103
+
104
+ provider : typing.Optional[str]
105
+ Optional FHIR provider name for provider-specific profiles
106
+
107
+ request_options : typing.Optional[RequestOptions]
108
+ Request-specific configuration.
109
+
110
+ Returns
111
+ -------
112
+ CreateMultiResponse
113
+ Successfully extracted FHIR resources
114
+
115
+ Examples
116
+ --------
117
+ from phenoml import phenoml
118
+
119
+ client = phenoml(
120
+ token="YOUR_TOKEN",
121
+ )
122
+ client.lang2fhir.create_multi(
123
+ text="John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
124
+ )
125
+ """
126
+ _response = self._raw_client.create_multi(
127
+ text=text, version=version, provider=provider, request_options=request_options
128
+ )
129
+ return _response.data
130
+
82
131
  def search(self, *, text: str, request_options: typing.Optional[RequestOptions] = None) -> SearchResponse:
83
132
  """
84
133
  Converts natural language text into FHIR search parameters
@@ -278,6 +327,62 @@ class AsyncLang2FhirClient:
278
327
  )
279
328
  return _response.data
280
329
 
330
+ async def create_multi(
331
+ self,
332
+ *,
333
+ text: str,
334
+ version: typing.Optional[str] = OMIT,
335
+ provider: typing.Optional[str] = OMIT,
336
+ request_options: typing.Optional[RequestOptions] = None,
337
+ ) -> CreateMultiResponse:
338
+ """
339
+ Analyzes natural language text and extracts multiple FHIR resources, returning them as a transaction Bundle.
340
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text.
341
+ Resources are linked with proper references (e.g., Conditions reference the Patient).
342
+
343
+ Parameters
344
+ ----------
345
+ text : str
346
+ Natural language text containing multiple clinical concepts to extract
347
+
348
+ version : typing.Optional[str]
349
+ FHIR version to use
350
+
351
+ provider : typing.Optional[str]
352
+ Optional FHIR provider name for provider-specific profiles
353
+
354
+ request_options : typing.Optional[RequestOptions]
355
+ Request-specific configuration.
356
+
357
+ Returns
358
+ -------
359
+ CreateMultiResponse
360
+ Successfully extracted FHIR resources
361
+
362
+ Examples
363
+ --------
364
+ import asyncio
365
+
366
+ from phenoml import Asyncphenoml
367
+
368
+ client = Asyncphenoml(
369
+ token="YOUR_TOKEN",
370
+ )
371
+
372
+
373
+ async def main() -> None:
374
+ await client.lang2fhir.create_multi(
375
+ text="John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
376
+ )
377
+
378
+
379
+ asyncio.run(main())
380
+ """
381
+ _response = await self._raw_client.create_multi(
382
+ text=text, version=version, provider=provider, request_options=request_options
383
+ )
384
+ return _response.data
385
+
281
386
  async def search(self, *, text: str, request_options: typing.Optional[RequestOptions] = None) -> SearchResponse:
282
387
  """
283
388
  Converts natural language text into FHIR search parameters
@@ -13,6 +13,7 @@ from .errors.failed_dependency_error import FailedDependencyError
13
13
  from .errors.forbidden_error import ForbiddenError
14
14
  from .errors.internal_server_error import InternalServerError
15
15
  from .errors.unauthorized_error import UnauthorizedError
16
+ from .types.create_multi_response import CreateMultiResponse
16
17
  from .types.create_request_resource import CreateRequestResource
17
18
  from .types.document_request_file_type import DocumentRequestFileType
18
19
  from .types.document_request_resource import DocumentRequestResource
@@ -120,6 +121,100 @@ class RawLang2FhirClient:
120
121
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
121
122
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
122
123
 
124
+ def create_multi(
125
+ self,
126
+ *,
127
+ text: str,
128
+ version: typing.Optional[str] = OMIT,
129
+ provider: typing.Optional[str] = OMIT,
130
+ request_options: typing.Optional[RequestOptions] = None,
131
+ ) -> HttpResponse[CreateMultiResponse]:
132
+ """
133
+ Analyzes natural language text and extracts multiple FHIR resources, returning them as a transaction Bundle.
134
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text.
135
+ Resources are linked with proper references (e.g., Conditions reference the Patient).
136
+
137
+ Parameters
138
+ ----------
139
+ text : str
140
+ Natural language text containing multiple clinical concepts to extract
141
+
142
+ version : typing.Optional[str]
143
+ FHIR version to use
144
+
145
+ provider : typing.Optional[str]
146
+ Optional FHIR provider name for provider-specific profiles
147
+
148
+ request_options : typing.Optional[RequestOptions]
149
+ Request-specific configuration.
150
+
151
+ Returns
152
+ -------
153
+ HttpResponse[CreateMultiResponse]
154
+ Successfully extracted FHIR resources
155
+ """
156
+ _response = self._client_wrapper.httpx_client.request(
157
+ "lang2fhir/create/multi",
158
+ method="POST",
159
+ json={
160
+ "text": text,
161
+ "version": version,
162
+ "provider": provider,
163
+ },
164
+ headers={
165
+ "content-type": "application/json",
166
+ },
167
+ request_options=request_options,
168
+ omit=OMIT,
169
+ )
170
+ try:
171
+ if 200 <= _response.status_code < 300:
172
+ _data = typing.cast(
173
+ CreateMultiResponse,
174
+ parse_obj_as(
175
+ type_=CreateMultiResponse, # type: ignore
176
+ object_=_response.json(),
177
+ ),
178
+ )
179
+ return HttpResponse(response=_response, data=_data)
180
+ if _response.status_code == 400:
181
+ raise BadRequestError(
182
+ headers=dict(_response.headers),
183
+ body=typing.cast(
184
+ typing.Optional[typing.Any],
185
+ parse_obj_as(
186
+ type_=typing.Optional[typing.Any], # type: ignore
187
+ object_=_response.json(),
188
+ ),
189
+ ),
190
+ )
191
+ if _response.status_code == 401:
192
+ raise UnauthorizedError(
193
+ headers=dict(_response.headers),
194
+ body=typing.cast(
195
+ typing.Optional[typing.Any],
196
+ parse_obj_as(
197
+ type_=typing.Optional[typing.Any], # type: ignore
198
+ object_=_response.json(),
199
+ ),
200
+ ),
201
+ )
202
+ if _response.status_code == 500:
203
+ raise InternalServerError(
204
+ headers=dict(_response.headers),
205
+ body=typing.cast(
206
+ typing.Optional[typing.Any],
207
+ parse_obj_as(
208
+ type_=typing.Optional[typing.Any], # type: ignore
209
+ object_=_response.json(),
210
+ ),
211
+ ),
212
+ )
213
+ _response_json = _response.json()
214
+ except JSONDecodeError:
215
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
216
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
217
+
123
218
  def search(
124
219
  self, *, text: str, request_options: typing.Optional[RequestOptions] = None
125
220
  ) -> HttpResponse[SearchResponse]:
@@ -502,6 +597,100 @@ class AsyncRawLang2FhirClient:
502
597
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
503
598
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
504
599
 
600
+ async def create_multi(
601
+ self,
602
+ *,
603
+ text: str,
604
+ version: typing.Optional[str] = OMIT,
605
+ provider: typing.Optional[str] = OMIT,
606
+ request_options: typing.Optional[RequestOptions] = None,
607
+ ) -> AsyncHttpResponse[CreateMultiResponse]:
608
+ """
609
+ Analyzes natural language text and extracts multiple FHIR resources, returning them as a transaction Bundle.
610
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text.
611
+ Resources are linked with proper references (e.g., Conditions reference the Patient).
612
+
613
+ Parameters
614
+ ----------
615
+ text : str
616
+ Natural language text containing multiple clinical concepts to extract
617
+
618
+ version : typing.Optional[str]
619
+ FHIR version to use
620
+
621
+ provider : typing.Optional[str]
622
+ Optional FHIR provider name for provider-specific profiles
623
+
624
+ request_options : typing.Optional[RequestOptions]
625
+ Request-specific configuration.
626
+
627
+ Returns
628
+ -------
629
+ AsyncHttpResponse[CreateMultiResponse]
630
+ Successfully extracted FHIR resources
631
+ """
632
+ _response = await self._client_wrapper.httpx_client.request(
633
+ "lang2fhir/create/multi",
634
+ method="POST",
635
+ json={
636
+ "text": text,
637
+ "version": version,
638
+ "provider": provider,
639
+ },
640
+ headers={
641
+ "content-type": "application/json",
642
+ },
643
+ request_options=request_options,
644
+ omit=OMIT,
645
+ )
646
+ try:
647
+ if 200 <= _response.status_code < 300:
648
+ _data = typing.cast(
649
+ CreateMultiResponse,
650
+ parse_obj_as(
651
+ type_=CreateMultiResponse, # type: ignore
652
+ object_=_response.json(),
653
+ ),
654
+ )
655
+ return AsyncHttpResponse(response=_response, data=_data)
656
+ if _response.status_code == 400:
657
+ raise BadRequestError(
658
+ headers=dict(_response.headers),
659
+ body=typing.cast(
660
+ typing.Optional[typing.Any],
661
+ parse_obj_as(
662
+ type_=typing.Optional[typing.Any], # type: ignore
663
+ object_=_response.json(),
664
+ ),
665
+ ),
666
+ )
667
+ if _response.status_code == 401:
668
+ raise UnauthorizedError(
669
+ headers=dict(_response.headers),
670
+ body=typing.cast(
671
+ typing.Optional[typing.Any],
672
+ parse_obj_as(
673
+ type_=typing.Optional[typing.Any], # type: ignore
674
+ object_=_response.json(),
675
+ ),
676
+ ),
677
+ )
678
+ if _response.status_code == 500:
679
+ raise InternalServerError(
680
+ headers=dict(_response.headers),
681
+ body=typing.cast(
682
+ typing.Optional[typing.Any],
683
+ parse_obj_as(
684
+ type_=typing.Optional[typing.Any], # type: ignore
685
+ object_=_response.json(),
686
+ ),
687
+ ),
688
+ )
689
+ _response_json = _response.json()
690
+ except JSONDecodeError:
691
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
692
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
693
+
505
694
  async def search(
506
695
  self, *, text: str, request_options: typing.Optional[RequestOptions] = None
507
696
  ) -> AsyncHttpResponse[SearchResponse]:
@@ -2,6 +2,11 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ from .create_multi_response import CreateMultiResponse
6
+ from .create_multi_response_bundle import CreateMultiResponseBundle
7
+ from .create_multi_response_bundle_entry_item import CreateMultiResponseBundleEntryItem
8
+ from .create_multi_response_bundle_entry_item_request import CreateMultiResponseBundleEntryItemRequest
9
+ from .create_multi_response_resources_item import CreateMultiResponseResourcesItem
5
10
  from .create_request_resource import CreateRequestResource
6
11
  from .document_request_file_type import DocumentRequestFileType
7
12
  from .document_request_resource import DocumentRequestResource
@@ -10,6 +15,11 @@ from .lang2fhir_upload_profile_response import Lang2FhirUploadProfileResponse
10
15
  from .search_response import SearchResponse
11
16
 
12
17
  __all__ = [
18
+ "CreateMultiResponse",
19
+ "CreateMultiResponseBundle",
20
+ "CreateMultiResponseBundleEntryItem",
21
+ "CreateMultiResponseBundleEntryItemRequest",
22
+ "CreateMultiResponseResourcesItem",
13
23
  "CreateRequestResource",
14
24
  "DocumentRequestFileType",
15
25
  "DocumentRequestResource",
@@ -0,0 +1,39 @@
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
+ from .create_multi_response_bundle import CreateMultiResponseBundle
8
+ from .create_multi_response_resources_item import CreateMultiResponseResourcesItem
9
+
10
+
11
+ class CreateMultiResponse(UniversalBaseModel):
12
+ success: typing.Optional[bool] = pydantic.Field(default=None)
13
+ """
14
+ Whether extraction was successful
15
+ """
16
+
17
+ message: typing.Optional[str] = pydantic.Field(default=None)
18
+ """
19
+ Status message
20
+ """
21
+
22
+ bundle: typing.Optional[CreateMultiResponseBundle] = pydantic.Field(default=None)
23
+ """
24
+ FHIR transaction Bundle containing all extracted resources
25
+ """
26
+
27
+ resources: typing.Optional[typing.List[CreateMultiResponseResourcesItem]] = pydantic.Field(default=None)
28
+ """
29
+ Summary of extracted resources
30
+ """
31
+
32
+ if IS_PYDANTIC_V2:
33
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
34
+ else:
35
+
36
+ class Config:
37
+ frozen = True
38
+ smart_union = True
39
+ extra = pydantic.Extra.allow
@@ -0,0 +1,28 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+ from .create_multi_response_bundle_entry_item import CreateMultiResponseBundleEntryItem
10
+
11
+
12
+ class CreateMultiResponseBundle(UniversalBaseModel):
13
+ """
14
+ FHIR transaction Bundle containing all extracted resources
15
+ """
16
+
17
+ resource_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="resourceType")] = None
18
+ type: typing.Optional[str] = None
19
+ entry: typing.Optional[typing.List[CreateMultiResponseBundleEntryItem]] = None
20
+
21
+ if IS_PYDANTIC_V2:
22
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
23
+ else:
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
@@ -0,0 +1,24 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+ from .create_multi_response_bundle_entry_item_request import CreateMultiResponseBundleEntryItemRequest
10
+
11
+
12
+ class CreateMultiResponseBundleEntryItem(UniversalBaseModel):
13
+ full_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="fullUrl")] = None
14
+ resource: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
15
+ request: typing.Optional[CreateMultiResponseBundleEntryItemRequest] = None
16
+
17
+ if IS_PYDANTIC_V2:
18
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
19
+ else:
20
+
21
+ class Config:
22
+ frozen = True
23
+ smart_union = True
24
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
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 CreateMultiResponseBundleEntryItemRequest(UniversalBaseModel):
10
+ method: typing.Optional[str] = None
11
+ url: typing.Optional[str] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,38 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class CreateMultiResponseResourcesItem(UniversalBaseModel):
12
+ temp_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="tempId")] = pydantic.Field(
13
+ default=None
14
+ )
15
+ """
16
+ Temporary UUID for the resource
17
+ """
18
+
19
+ resource_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="resourceType")] = (
20
+ pydantic.Field(default=None)
21
+ )
22
+ """
23
+ FHIR resource type
24
+ """
25
+
26
+ description: typing.Optional[str] = pydantic.Field(default=None)
27
+ """
28
+ Text excerpt this resource was extracted from
29
+ """
30
+
31
+ if IS_PYDANTIC_V2:
32
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
33
+ else:
34
+
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ extra = pydantic.Extra.allow
phenoml/tools/__init__.py CHANGED
@@ -4,6 +4,9 @@
4
4
 
5
5
  from .types import (
6
6
  CohortResponse,
7
+ Lang2FhirAndCreateMultiResponse,
8
+ Lang2FhirAndCreateMultiResponseResourceInfoItem,
9
+ Lang2FhirAndCreateMultiResponseResponseBundle,
7
10
  Lang2FhirAndCreateRequestResource,
8
11
  Lang2FhirAndCreateResponse,
9
12
  Lang2FhirAndSearchResponse,
@@ -23,6 +26,9 @@ __all__ = [
23
26
  "FailedDependencyError",
24
27
  "ForbiddenError",
25
28
  "InternalServerError",
29
+ "Lang2FhirAndCreateMultiResponse",
30
+ "Lang2FhirAndCreateMultiResponseResourceInfoItem",
31
+ "Lang2FhirAndCreateMultiResponseResponseBundle",
26
32
  "Lang2FhirAndCreateRequestResource",
27
33
  "Lang2FhirAndCreateResponse",
28
34
  "Lang2FhirAndSearchResponse",
phenoml/tools/client.py CHANGED
@@ -7,6 +7,7 @@ from ..core.request_options import RequestOptions
7
7
  from .mcp_server.client import AsyncMcpServerClient, McpServerClient
8
8
  from .raw_client import AsyncRawToolsClient, RawToolsClient
9
9
  from .types.cohort_response import CohortResponse
10
+ from .types.lang2fhir_and_create_multi_response import Lang2FhirAndCreateMultiResponse
10
11
  from .types.lang2fhir_and_create_request_resource import Lang2FhirAndCreateRequestResource
11
12
  from .types.lang2fhir_and_create_response import Lang2FhirAndCreateResponse
12
13
  from .types.lang2fhir_and_search_response import Lang2FhirAndSearchResponse
@@ -95,6 +96,74 @@ class ToolsClient:
95
96
  )
96
97
  return _response.data
97
98
 
99
+ def create_fhir_resources_multi(
100
+ self,
101
+ *,
102
+ text: str,
103
+ provider: str,
104
+ phenoml_on_behalf_of: typing.Optional[str] = None,
105
+ phenoml_fhir_provider: typing.Optional[str] = None,
106
+ version: typing.Optional[str] = OMIT,
107
+ request_options: typing.Optional[RequestOptions] = None,
108
+ ) -> Lang2FhirAndCreateMultiResponse:
109
+ """
110
+ Extracts multiple FHIR resources from natural language text and stores them in a FHIR server.
111
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types.
112
+ Resources are linked with proper references and submitted as a transaction bundle.
113
+ For FHIR servers that don't auto-resolve urn:uuid references, this endpoint will automatically
114
+ resolve them via PUT requests after the initial bundle creation.
115
+
116
+ Parameters
117
+ ----------
118
+ text : str
119
+ Natural language text containing multiple clinical concepts to extract
120
+
121
+ provider : str
122
+ FHIR provider ID or name
123
+
124
+ phenoml_on_behalf_of : typing.Optional[str]
125
+ Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
126
+ Must be in the format: Patient/{uuid} or Practitioner/{uuid}
127
+
128
+ phenoml_fhir_provider : typing.Optional[str]
129
+ Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
130
+ Multiple FHIR provider integrations can be provided as comma-separated values.
131
+
132
+ version : typing.Optional[str]
133
+ FHIR version to use
134
+
135
+ request_options : typing.Optional[RequestOptions]
136
+ Request-specific configuration.
137
+
138
+ Returns
139
+ -------
140
+ Lang2FhirAndCreateMultiResponse
141
+ Successfully created FHIR resources
142
+
143
+ Examples
144
+ --------
145
+ from phenoml import phenoml
146
+
147
+ client = phenoml(
148
+ token="YOUR_TOKEN",
149
+ )
150
+ client.tools.create_fhir_resources_multi(
151
+ phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
152
+ phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
153
+ text="John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
154
+ provider="medplum",
155
+ )
156
+ """
157
+ _response = self._raw_client.create_fhir_resources_multi(
158
+ text=text,
159
+ provider=provider,
160
+ phenoml_on_behalf_of=phenoml_on_behalf_of,
161
+ phenoml_fhir_provider=phenoml_fhir_provider,
162
+ version=version,
163
+ request_options=request_options,
164
+ )
165
+ return _response.data
166
+
98
167
  def search_fhir_resources(
99
168
  self,
100
169
  *,
@@ -316,6 +385,82 @@ class AsyncToolsClient:
316
385
  )
317
386
  return _response.data
318
387
 
388
+ async def create_fhir_resources_multi(
389
+ self,
390
+ *,
391
+ text: str,
392
+ provider: str,
393
+ phenoml_on_behalf_of: typing.Optional[str] = None,
394
+ phenoml_fhir_provider: typing.Optional[str] = None,
395
+ version: typing.Optional[str] = OMIT,
396
+ request_options: typing.Optional[RequestOptions] = None,
397
+ ) -> Lang2FhirAndCreateMultiResponse:
398
+ """
399
+ Extracts multiple FHIR resources from natural language text and stores them in a FHIR server.
400
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types.
401
+ Resources are linked with proper references and submitted as a transaction bundle.
402
+ For FHIR servers that don't auto-resolve urn:uuid references, this endpoint will automatically
403
+ resolve them via PUT requests after the initial bundle creation.
404
+
405
+ Parameters
406
+ ----------
407
+ text : str
408
+ Natural language text containing multiple clinical concepts to extract
409
+
410
+ provider : str
411
+ FHIR provider ID or name
412
+
413
+ phenoml_on_behalf_of : typing.Optional[str]
414
+ Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
415
+ Must be in the format: Patient/{uuid} or Practitioner/{uuid}
416
+
417
+ phenoml_fhir_provider : typing.Optional[str]
418
+ Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
419
+ Multiple FHIR provider integrations can be provided as comma-separated values.
420
+
421
+ version : typing.Optional[str]
422
+ FHIR version to use
423
+
424
+ request_options : typing.Optional[RequestOptions]
425
+ Request-specific configuration.
426
+
427
+ Returns
428
+ -------
429
+ Lang2FhirAndCreateMultiResponse
430
+ Successfully created FHIR resources
431
+
432
+ Examples
433
+ --------
434
+ import asyncio
435
+
436
+ from phenoml import Asyncphenoml
437
+
438
+ client = Asyncphenoml(
439
+ token="YOUR_TOKEN",
440
+ )
441
+
442
+
443
+ async def main() -> None:
444
+ await client.tools.create_fhir_resources_multi(
445
+ phenoml_on_behalf_of="Patient/550e8400-e29b-41d4-a716-446655440000",
446
+ phenoml_fhir_provider="550e8400-e29b-41d4-a716-446655440000:eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c...",
447
+ text="John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
448
+ provider="medplum",
449
+ )
450
+
451
+
452
+ asyncio.run(main())
453
+ """
454
+ _response = await self._raw_client.create_fhir_resources_multi(
455
+ text=text,
456
+ provider=provider,
457
+ phenoml_on_behalf_of=phenoml_on_behalf_of,
458
+ phenoml_fhir_provider=phenoml_fhir_provider,
459
+ version=version,
460
+ request_options=request_options,
461
+ )
462
+ return _response.data
463
+
319
464
  async def search_fhir_resources(
320
465
  self,
321
466
  *,
@@ -14,6 +14,7 @@ from .errors.forbidden_error import ForbiddenError
14
14
  from .errors.internal_server_error import InternalServerError
15
15
  from .errors.unauthorized_error import UnauthorizedError
16
16
  from .types.cohort_response import CohortResponse
17
+ from .types.lang2fhir_and_create_multi_response import Lang2FhirAndCreateMultiResponse
17
18
  from .types.lang2fhir_and_create_request_resource import Lang2FhirAndCreateRequestResource
18
19
  from .types.lang2fhir_and_create_response import Lang2FhirAndCreateResponse
19
20
  from .types.lang2fhir_and_search_response import Lang2FhirAndSearchResponse
@@ -152,6 +153,136 @@ class RawToolsClient:
152
153
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
153
154
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
154
155
 
156
+ def create_fhir_resources_multi(
157
+ self,
158
+ *,
159
+ text: str,
160
+ provider: str,
161
+ phenoml_on_behalf_of: typing.Optional[str] = None,
162
+ phenoml_fhir_provider: typing.Optional[str] = None,
163
+ version: typing.Optional[str] = OMIT,
164
+ request_options: typing.Optional[RequestOptions] = None,
165
+ ) -> HttpResponse[Lang2FhirAndCreateMultiResponse]:
166
+ """
167
+ Extracts multiple FHIR resources from natural language text and stores them in a FHIR server.
168
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types.
169
+ Resources are linked with proper references and submitted as a transaction bundle.
170
+ For FHIR servers that don't auto-resolve urn:uuid references, this endpoint will automatically
171
+ resolve them via PUT requests after the initial bundle creation.
172
+
173
+ Parameters
174
+ ----------
175
+ text : str
176
+ Natural language text containing multiple clinical concepts to extract
177
+
178
+ provider : str
179
+ FHIR provider ID or name
180
+
181
+ phenoml_on_behalf_of : typing.Optional[str]
182
+ Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity.
183
+ Must be in the format: Patient/{uuid} or Practitioner/{uuid}
184
+
185
+ phenoml_fhir_provider : typing.Optional[str]
186
+ Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}.
187
+ Multiple FHIR provider integrations can be provided as comma-separated values.
188
+
189
+ version : typing.Optional[str]
190
+ FHIR version to use
191
+
192
+ request_options : typing.Optional[RequestOptions]
193
+ Request-specific configuration.
194
+
195
+ Returns
196
+ -------
197
+ HttpResponse[Lang2FhirAndCreateMultiResponse]
198
+ Successfully created FHIR resources
199
+ """
200
+ _response = self._client_wrapper.httpx_client.request(
201
+ "tools/lang2fhir-and-create-multi",
202
+ method="POST",
203
+ json={
204
+ "text": text,
205
+ "version": version,
206
+ "provider": provider,
207
+ },
208
+ headers={
209
+ "content-type": "application/json",
210
+ "X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
211
+ "X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
212
+ },
213
+ request_options=request_options,
214
+ omit=OMIT,
215
+ )
216
+ try:
217
+ if 200 <= _response.status_code < 300:
218
+ _data = typing.cast(
219
+ Lang2FhirAndCreateMultiResponse,
220
+ parse_obj_as(
221
+ type_=Lang2FhirAndCreateMultiResponse, # type: ignore
222
+ object_=_response.json(),
223
+ ),
224
+ )
225
+ return HttpResponse(response=_response, data=_data)
226
+ if _response.status_code == 400:
227
+ raise BadRequestError(
228
+ headers=dict(_response.headers),
229
+ body=typing.cast(
230
+ typing.Optional[typing.Any],
231
+ parse_obj_as(
232
+ type_=typing.Optional[typing.Any], # type: ignore
233
+ object_=_response.json(),
234
+ ),
235
+ ),
236
+ )
237
+ if _response.status_code == 401:
238
+ raise UnauthorizedError(
239
+ headers=dict(_response.headers),
240
+ body=typing.cast(
241
+ typing.Optional[typing.Any],
242
+ parse_obj_as(
243
+ type_=typing.Optional[typing.Any], # type: ignore
244
+ object_=_response.json(),
245
+ ),
246
+ ),
247
+ )
248
+ if _response.status_code == 403:
249
+ raise ForbiddenError(
250
+ headers=dict(_response.headers),
251
+ body=typing.cast(
252
+ typing.Optional[typing.Any],
253
+ parse_obj_as(
254
+ type_=typing.Optional[typing.Any], # type: ignore
255
+ object_=_response.json(),
256
+ ),
257
+ ),
258
+ )
259
+ if _response.status_code == 424:
260
+ raise FailedDependencyError(
261
+ headers=dict(_response.headers),
262
+ body=typing.cast(
263
+ typing.Optional[typing.Any],
264
+ parse_obj_as(
265
+ type_=typing.Optional[typing.Any], # type: ignore
266
+ object_=_response.json(),
267
+ ),
268
+ ),
269
+ )
270
+ if _response.status_code == 500:
271
+ raise InternalServerError(
272
+ headers=dict(_response.headers),
273
+ body=typing.cast(
274
+ typing.Optional[typing.Any],
275
+ parse_obj_as(
276
+ type_=typing.Optional[typing.Any], # type: ignore
277
+ object_=_response.json(),
278
+ ),
279
+ ),
280
+ )
281
+ _response_json = _response.json()
282
+ except JSONDecodeError:
283
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
284
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
285
+
155
286
  def search_fhir_resources(
156
287
  self,
157
288
  *,
@@ -529,6 +660,136 @@ class AsyncRawToolsClient:
529
660
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
530
661
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
531
662
 
663
+ async def create_fhir_resources_multi(
664
+ self,
665
+ *,
666
+ text: str,
667
+ provider: str,
668
+ phenoml_on_behalf_of: typing.Optional[str] = None,
669
+ phenoml_fhir_provider: typing.Optional[str] = None,
670
+ version: typing.Optional[str] = OMIT,
671
+ request_options: typing.Optional[RequestOptions] = None,
672
+ ) -> AsyncHttpResponse[Lang2FhirAndCreateMultiResponse]:
673
+ """
674
+ Extracts multiple FHIR resources from natural language text and stores them in a FHIR server.
675
+ Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types.
676
+ Resources are linked with proper references and submitted as a transaction bundle.
677
+ For FHIR servers that don't auto-resolve urn:uuid references, this endpoint will automatically
678
+ resolve them via PUT requests after the initial bundle creation.
679
+
680
+ Parameters
681
+ ----------
682
+ text : str
683
+ Natural language text containing multiple clinical concepts to extract
684
+
685
+ provider : str
686
+ FHIR provider ID or name
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}
691
+
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.
695
+
696
+ version : typing.Optional[str]
697
+ FHIR version to use
698
+
699
+ request_options : typing.Optional[RequestOptions]
700
+ Request-specific configuration.
701
+
702
+ Returns
703
+ -------
704
+ AsyncHttpResponse[Lang2FhirAndCreateMultiResponse]
705
+ Successfully created FHIR resources
706
+ """
707
+ _response = await self._client_wrapper.httpx_client.request(
708
+ "tools/lang2fhir-and-create-multi",
709
+ method="POST",
710
+ json={
711
+ "text": text,
712
+ "version": version,
713
+ "provider": provider,
714
+ },
715
+ headers={
716
+ "content-type": "application/json",
717
+ "X-Phenoml-On-Behalf-Of": str(phenoml_on_behalf_of) if phenoml_on_behalf_of is not None else None,
718
+ "X-Phenoml-Fhir-Provider": str(phenoml_fhir_provider) if phenoml_fhir_provider is not None else None,
719
+ },
720
+ request_options=request_options,
721
+ omit=OMIT,
722
+ )
723
+ try:
724
+ if 200 <= _response.status_code < 300:
725
+ _data = typing.cast(
726
+ Lang2FhirAndCreateMultiResponse,
727
+ parse_obj_as(
728
+ type_=Lang2FhirAndCreateMultiResponse, # type: ignore
729
+ object_=_response.json(),
730
+ ),
731
+ )
732
+ return AsyncHttpResponse(response=_response, data=_data)
733
+ if _response.status_code == 400:
734
+ raise BadRequestError(
735
+ headers=dict(_response.headers),
736
+ body=typing.cast(
737
+ typing.Optional[typing.Any],
738
+ parse_obj_as(
739
+ type_=typing.Optional[typing.Any], # type: ignore
740
+ object_=_response.json(),
741
+ ),
742
+ ),
743
+ )
744
+ if _response.status_code == 401:
745
+ raise UnauthorizedError(
746
+ headers=dict(_response.headers),
747
+ body=typing.cast(
748
+ typing.Optional[typing.Any],
749
+ parse_obj_as(
750
+ type_=typing.Optional[typing.Any], # type: ignore
751
+ object_=_response.json(),
752
+ ),
753
+ ),
754
+ )
755
+ if _response.status_code == 403:
756
+ raise ForbiddenError(
757
+ headers=dict(_response.headers),
758
+ body=typing.cast(
759
+ typing.Optional[typing.Any],
760
+ parse_obj_as(
761
+ type_=typing.Optional[typing.Any], # type: ignore
762
+ object_=_response.json(),
763
+ ),
764
+ ),
765
+ )
766
+ if _response.status_code == 424:
767
+ raise FailedDependencyError(
768
+ headers=dict(_response.headers),
769
+ body=typing.cast(
770
+ typing.Optional[typing.Any],
771
+ parse_obj_as(
772
+ type_=typing.Optional[typing.Any], # type: ignore
773
+ object_=_response.json(),
774
+ ),
775
+ ),
776
+ )
777
+ if _response.status_code == 500:
778
+ raise InternalServerError(
779
+ headers=dict(_response.headers),
780
+ body=typing.cast(
781
+ typing.Optional[typing.Any],
782
+ parse_obj_as(
783
+ type_=typing.Optional[typing.Any], # type: ignore
784
+ object_=_response.json(),
785
+ ),
786
+ ),
787
+ )
788
+ _response_json = _response.json()
789
+ except JSONDecodeError:
790
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
791
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
792
+
532
793
  async def search_fhir_resources(
533
794
  self,
534
795
  *,
@@ -3,6 +3,9 @@
3
3
  # isort: skip_file
4
4
 
5
5
  from .cohort_response import CohortResponse
6
+ from .lang2fhir_and_create_multi_response import Lang2FhirAndCreateMultiResponse
7
+ from .lang2fhir_and_create_multi_response_resource_info_item import Lang2FhirAndCreateMultiResponseResourceInfoItem
8
+ from .lang2fhir_and_create_multi_response_response_bundle import Lang2FhirAndCreateMultiResponseResponseBundle
6
9
  from .lang2fhir_and_create_request_resource import Lang2FhirAndCreateRequestResource
7
10
  from .lang2fhir_and_create_response import Lang2FhirAndCreateResponse
8
11
  from .lang2fhir_and_search_response import Lang2FhirAndSearchResponse
@@ -15,6 +18,9 @@ from .search_concept import SearchConcept
15
18
 
16
19
  __all__ = [
17
20
  "CohortResponse",
21
+ "Lang2FhirAndCreateMultiResponse",
22
+ "Lang2FhirAndCreateMultiResponseResourceInfoItem",
23
+ "Lang2FhirAndCreateMultiResponseResponseBundle",
18
24
  "Lang2FhirAndCreateRequestResource",
19
25
  "Lang2FhirAndCreateResponse",
20
26
  "Lang2FhirAndSearchResponse",
@@ -0,0 +1,41 @@
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
+ from .lang2fhir_and_create_multi_response_resource_info_item import Lang2FhirAndCreateMultiResponseResourceInfoItem
8
+ from .lang2fhir_and_create_multi_response_response_bundle import Lang2FhirAndCreateMultiResponseResponseBundle
9
+
10
+
11
+ class Lang2FhirAndCreateMultiResponse(UniversalBaseModel):
12
+ success: typing.Optional[bool] = pydantic.Field(default=None)
13
+ """
14
+ Whether the resources were created successfully
15
+ """
16
+
17
+ message: typing.Optional[str] = pydantic.Field(default=None)
18
+ """
19
+ Status message
20
+ """
21
+
22
+ response_bundle: typing.Optional[Lang2FhirAndCreateMultiResponseResponseBundle] = pydantic.Field(default=None)
23
+ """
24
+ FHIR transaction-response Bundle from the server with resolved resource IDs
25
+ """
26
+
27
+ resource_info: typing.Optional[typing.List[Lang2FhirAndCreateMultiResponseResourceInfoItem]] = pydantic.Field(
28
+ default=None
29
+ )
30
+ """
31
+ Metadata about created resources (temp IDs, types, descriptions)
32
+ """
33
+
34
+ if IS_PYDANTIC_V2:
35
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
36
+ else:
37
+
38
+ class Config:
39
+ frozen = True
40
+ smart_union = True
41
+ extra = pydantic.Extra.allow
@@ -0,0 +1,38 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class Lang2FhirAndCreateMultiResponseResourceInfoItem(UniversalBaseModel):
12
+ temp_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="tempId")] = pydantic.Field(
13
+ default=None
14
+ )
15
+ """
16
+ Original temporary UUID
17
+ """
18
+
19
+ resource_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="resourceType")] = (
20
+ pydantic.Field(default=None)
21
+ )
22
+ """
23
+ FHIR resource type
24
+ """
25
+
26
+ description: typing.Optional[str] = pydantic.Field(default=None)
27
+ """
28
+ Text excerpt this resource was extracted from
29
+ """
30
+
31
+ if IS_PYDANTIC_V2:
32
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
33
+ else:
34
+
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ extra = pydantic.Extra.allow
@@ -0,0 +1,27 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ...core.serialization import FieldMetadata
9
+
10
+
11
+ class Lang2FhirAndCreateMultiResponseResponseBundle(UniversalBaseModel):
12
+ """
13
+ FHIR transaction-response Bundle from the server with resolved resource IDs
14
+ """
15
+
16
+ resource_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="resourceType")] = None
17
+ type: typing.Optional[str] = None
18
+ entry: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
19
+
20
+ if IS_PYDANTIC_V2:
21
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
22
+ else:
23
+
24
+ class Config:
25
+ frozen = True
26
+ smart_union = True
27
+ extra = pydantic.Extra.allow
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phenoml
3
- Version: 0.0.16
3
+ Version: 0.0.18
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -70,15 +70,15 @@ phenoml/construe/raw_client.py,sha256=xXhtTmLzDELw9TEXWSKk9ZK2UXYNKMfp3IAk2EKxzl
70
70
  phenoml/construe/types/__init__.py,sha256=Id0OJ58ZEQX9Ut-7iMwWEv49MTJLTTmNPH9es1ya8Cw,900
71
71
  phenoml/construe/types/construe_upload_code_system_response.py,sha256=s0m5EHpkhkp7hYiC5zLZeIeqQ4mrwXlPI1Msihb-ZGo,566
72
72
  phenoml/construe/types/extract_codes_result.py,sha256=DbVDLWqtmt9TyD5MC0q8grgnNXPnXq4eJnLDinTe0uc,701
73
- phenoml/construe/types/extract_request_config.py,sha256=-N_yPxXcWeuFx2JNOJIGHjtyJNSFMOGslmLbjYxMh18,1831
73
+ phenoml/construe/types/extract_request_config.py,sha256=2A22PNA1Hxq9qz1x89LvbySF-Hw8iB6oA2QqoSIrvg8,2112
74
74
  phenoml/construe/types/extract_request_config_chunking_method.py,sha256=AmVPPj0oT5r0pwWUoFxG_K8s5g8xaGYIRsPt3VvqSXQ,209
75
75
  phenoml/construe/types/extract_request_config_validation_method.py,sha256=6uUqKn8DXF34EDtNKPa6KLW07DsxgQF2aR5BGdG5Fd4,199
76
76
  phenoml/construe/types/extract_request_system.py,sha256=50qkxvinJKS5y1_glr-OFe5tQRyMWLYpeny1NZ9gFzw,1191
77
- phenoml/construe/types/extracted_code_result.py,sha256=LmhaQYFeLXBWR_NWcF1c-qt3OqwWQduefvInJRHcvio,1121
77
+ phenoml/construe/types/extracted_code_result.py,sha256=3mIHO952KjbMRBY_YvwBt75XOjqdflg9Odc-xBbURac,1321
78
78
  phenoml/construe/types/upload_request_format.py,sha256=5mJhMM7R7hn6gGQNDJT9lxPDsRpUkRzqNxtRU0Nnlls,158
79
79
  phenoml/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
80
80
  phenoml/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
81
- phenoml/core/client_wrapper.py,sha256=jUWGtvhTYtnP_U6RqZrJmxAQWdCH8x-eMwO-XW6PzrI,2645
81
+ phenoml/core/client_wrapper.py,sha256=z1oi8fHFvxZesnHRdmy1-aaGsidR3l0xTrlWWgY_50o,2645
82
82
  phenoml/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
83
83
  phenoml/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
84
84
  phenoml/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
@@ -136,16 +136,21 @@ phenoml/fhir_provider/types/provider.py,sha256=AmGOmoy5Cv9W0km4rAf3mxqH3g3UUnj_x
136
136
  phenoml/fhir_provider/types/role.py,sha256=Igag80s-KaGOc4nWfrGWyT81HU__c6_WJ-1oV7DOVdE,638
137
137
  phenoml/fhir_provider/types/service_account_key.py,sha256=uup1Xl0HSc_B3278i0CS-ygCroShLS5_q0KtqXI96HY,1085
138
138
  phenoml/fhir_provider/types/smart_configuration.py,sha256=bG_J1yNFEWWo9kjxF0s2Ik9rXehB1JHcQ2fTn6dht6k,1174
139
- phenoml/lang2fhir/__init__.py,sha256=R8VOE03BLTk90GJVBfpiUXHeODUNX3rZLkRIC21s1ow,694
140
- phenoml/lang2fhir/client.py,sha256=HxOpDPSihtgHJq3ayaKsGPUl48wA-FG89-268MYb_sU,12810
139
+ phenoml/lang2fhir/__init__.py,sha256=zgnos0Sw2t255KUygG-lhZGl9yQCLPTJM7uMssWm1pc,1066
140
+ phenoml/lang2fhir/client.py,sha256=o86CP8qO_K6BFBv3sj1KY8lBr37ccH2pGWXyB7APUuA,16289
141
141
  phenoml/lang2fhir/errors/__init__.py,sha256=nIzg981R3USgSar0WuuVrpDVg-H5vIp2AceEzbhphGw,458
142
142
  phenoml/lang2fhir/errors/bad_request_error.py,sha256=nv0bK4gtOnTon6a2NdVxJxHBje_O_7wIoRtXLZHovUQ,339
143
143
  phenoml/lang2fhir/errors/failed_dependency_error.py,sha256=eXiqG062inkUF7fs2Newhx9uAKReK6fosz29PMD4gVw,345
144
144
  phenoml/lang2fhir/errors/forbidden_error.py,sha256=ek8-sffTy9gY3F0zyaSkcskDVvq9puXP_YvvB2BJYbA,338
145
145
  phenoml/lang2fhir/errors/internal_server_error.py,sha256=biBHJfSP1_zWF5CJgxY4B8wrL1uC18RSccQ-BCKmYNs,343
146
146
  phenoml/lang2fhir/errors/unauthorized_error.py,sha256=h8T6QhXuTo0GLL9MKfIM5p--wDqlB1-ZkMp3lY-aM3E,341
147
- phenoml/lang2fhir/raw_client.py,sha256=aJfhWF7OIYjGU-lq7eKfR-a5LNiX6ANI3jVOe1HAD2c,30786
148
- phenoml/lang2fhir/types/__init__.py,sha256=QIcpkgfIOpA_5Nwwymnk-WtyozrBJ-D4d4GwLKLCUpA,619
147
+ phenoml/lang2fhir/raw_client.py,sha256=uQN6oXZ7OD21Vvf_YOvOBrG56Eqbn79KMsPmq7RvIl4,38328
148
+ phenoml/lang2fhir/types/__init__.py,sha256=IDh7nk6AXkWbzy2gbjQ11I0YLr8J6XzD2gCcBbRIPWI,1207
149
+ phenoml/lang2fhir/types/create_multi_response.py,sha256=GrOBnwDp7pSmCRqaaG_4jL0P1lqXYMk5ioTabVaP2zg,1212
150
+ phenoml/lang2fhir/types/create_multi_response_bundle.py,sha256=os13oK7NULRoN647NBfE3QuKe2Gvi2qSa6KJpkWIHsA,994
151
+ phenoml/lang2fhir/types/create_multi_response_bundle_entry_item.py,sha256=1qvcTZuE_WzOzwGs6CrQOaU9cCFdtH2A7EGhMR8aqL4,970
152
+ phenoml/lang2fhir/types/create_multi_response_bundle_entry_item_request.py,sha256=R-qHcnHjFz8rSYYDlo2Yqi7_Ul4jZtleE0BYhFA0jnE,612
153
+ phenoml/lang2fhir/types/create_multi_response_resources_item.py,sha256=VFggDG3w6KpskIVeSKInNrcgCFmlYmz1IFNGvMJq7hk,1119
149
154
  phenoml/lang2fhir/types/create_request_resource.py,sha256=JyfWUXGae-BMEvjtbDqQVNyIL4Qoh7nJwJyHOwP070Q,596
150
155
  phenoml/lang2fhir/types/document_request_file_type.py,sha256=VgPYn7FB-5hgvNsyvQEGIsEQ6F4ruM4VN9TWxr_Tfv4,212
151
156
  phenoml/lang2fhir/types/document_request_resource.py,sha256=keHsMn9UxgHd9VUNT54Atcj4Z4YI9uU0Fj9g1RwGUrg,189
@@ -176,8 +181,8 @@ phenoml/summary/types/summary_get_template_response.py,sha256=u71jGARazI2XECeqmR
176
181
  phenoml/summary/types/summary_list_templates_response.py,sha256=go45lFGp3KktaZq4lCGN5KV6SYbaik5bNvn5NkTV6xI,678
177
182
  phenoml/summary/types/summary_template.py,sha256=eCM6BVMZC4jxp7d2PoIfcluflAMXa07oZcXf0nzytXM,1269
178
183
  phenoml/summary/types/summary_update_template_response.py,sha256=1i_2LELTdulyXLNaEaN10Phy9KZfmGUBQCcj_9eZZy4,706
179
- phenoml/tools/__init__.py,sha256=tWbUCa1RVpte1Ov53WgLExOXvGT72Mol2JM1Ul3nj3M,989
180
- phenoml/tools/client.py,sha256=JRLj2mUGWuJ_ClRiSRimSKxx55hWQOLtPACpvFFVqxw,18261
184
+ phenoml/tools/__init__.py,sha256=pbSU1CU2J38xaBZbvsMw3tNvbmmgCw8b1lKERCeIxY4,1277
185
+ phenoml/tools/client.py,sha256=jChK5oGyxOaIrk4Me9cL8ZZlnA1ZsDWP3oLlkuABMBM,24324
181
186
  phenoml/tools/errors/__init__.py,sha256=nIzg981R3USgSar0WuuVrpDVg-H5vIp2AceEzbhphGw,458
182
187
  phenoml/tools/errors/bad_request_error.py,sha256=nv0bK4gtOnTon6a2NdVxJxHBje_O_7wIoRtXLZHovUQ,339
183
188
  phenoml/tools/errors/failed_dependency_error.py,sha256=eXiqG062inkUF7fs2Newhx9uAKReK6fosz29PMD4gVw,345
@@ -190,9 +195,12 @@ phenoml/tools/mcp_server/raw_client.py,sha256=AVnepraHeEuI4zl1eBeHC3_-mkc7zfEIeY
190
195
  phenoml/tools/mcp_server/tools/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
191
196
  phenoml/tools/mcp_server/tools/client.py,sha256=iu-AclviqNB9NWfkS_h7LY9exfzPGmAjOG3MIbQgtuk,9807
192
197
  phenoml/tools/mcp_server/tools/raw_client.py,sha256=FC_OQZ526AGrN1lAnYLvtr-s8NrHfcKUpxM_YLKZgos,26380
193
- phenoml/tools/raw_client.py,sha256=AdHQW0jlx-QtysAT2lo8DuxFZE1rsU_ji8EbPfLrVPc,33432
194
- phenoml/tools/types/__init__.py,sha256=Q9a9RbiUDz9jFLZi_43I40t8ZZuolzaDtluYJWV8yN8,1021
198
+ phenoml/tools/raw_client.py,sha256=kBKvgWNOcLqvmSDfzdmKfaXTiLGnAMfW52bjOssEKDc,44916
199
+ phenoml/tools/types/__init__.py,sha256=6mlBraLARj7_4mVEaAktqY-T8PYZO_dkyMSkzPDjLo0,1476
195
200
  phenoml/tools/types/cohort_response.py,sha256=Nft1eLyFhNrKDNYOhQxzSH1o35JS7UdZlTgI9ndjdVM,1503
201
+ phenoml/tools/types/lang2fhir_and_create_multi_response.py,sha256=vFgylAXNd_hwclVpvDbFXdEcGRjFWNHL34XHNz_LhEg,1427
202
+ phenoml/tools/types/lang2fhir_and_create_multi_response_resource_info_item.py,sha256=TJEcnb2IPs_OJnOicLDZF9hOwPJEBWHmN-28tZ3yZas,1126
203
+ phenoml/tools/types/lang2fhir_and_create_multi_response_response_bundle.py,sha256=cUXGEUJuqEINdtqPyMW_zEOnHeto96scQnM6FL04zOU,954
196
204
  phenoml/tools/types/lang2fhir_and_create_request_resource.py,sha256=mIBUXOfKrweiYsCu-vxboK_uDu43GQUEdKWlVLHMOyU,608
197
205
  phenoml/tools/types/lang2fhir_and_create_response.py,sha256=jyEYZ_A3JSgVz0dwmlvbzKVMhj4C4SbmeOWbtVDV9uo,971
198
206
  phenoml/tools/types/lang2fhir_and_search_response.py,sha256=RaJ5zd-D1yFxRyINjksvcefGc81RfIFw_5WmhE4T7HQ,1146
@@ -237,7 +245,7 @@ phenoml/workflows/types/workflows_delete_response.py,sha256=izcubUOnSNOgThD9Ozo6
237
245
  phenoml/workflows/types/workflows_get_response.py,sha256=gfNyUs14JSynprRwT-fuq4IDsGrPZmUSsK3WmgqIEi8,891
238
246
  phenoml/workflows/types/workflows_update_response.py,sha256=FEvQpC9ZRk8dV1oaIAwV5bSDD2tkXZ5fG4mozRjibuQ,1046
239
247
  phenoml/wrapper_client.py,sha256=JYTdhXgju4tOsata06wQY_ZbMsuMj3qaxkgvDzpY068,5022
240
- phenoml-0.0.16.dist-info/LICENSE,sha256=Am1fNNveR2gcmOloSWQTsnUw2SQEF8HtowFqIvlagfk,1064
241
- phenoml-0.0.16.dist-info/METADATA,sha256=OThqy03xut7-0sX_5DNEriUHduGA1vfP4LixDBtIH0w,5331
242
- phenoml-0.0.16.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
243
- phenoml-0.0.16.dist-info/RECORD,,
248
+ phenoml-0.0.18.dist-info/LICENSE,sha256=Am1fNNveR2gcmOloSWQTsnUw2SQEF8HtowFqIvlagfk,1064
249
+ phenoml-0.0.18.dist-info/METADATA,sha256=Z1ieeoLMuZTCh90F_ExzmBFAU_0f9EJ74r7UOmrvfEE,5331
250
+ phenoml-0.0.18.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
251
+ phenoml-0.0.18.dist-info/RECORD,,