phenoml 0.0.18__py3-none-any.whl → 0.0.19__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.
Files changed (31) hide show
  1. phenoml/agent/__init__.py +4 -0
  2. phenoml/agent/client.py +23 -8
  3. phenoml/agent/raw_client.py +21 -6
  4. phenoml/agent/types/__init__.py +4 -0
  5. phenoml/agent/types/agent_get_chat_messages_request_role.py +5 -0
  6. phenoml/agent/types/chat_message_template.py +7 -2
  7. phenoml/agent/types/chat_message_template_role.py +5 -0
  8. phenoml/core/client_wrapper.py +2 -2
  9. phenoml/fhir_provider/__init__.py +8 -2
  10. phenoml/fhir_provider/client.py +66 -21
  11. phenoml/fhir_provider/raw_client.py +70 -47
  12. phenoml/fhir_provider/types/__init__.py +8 -2
  13. phenoml/fhir_provider/types/fhir_provider_auth_config.py +12 -0
  14. phenoml/fhir_provider/types/fhir_provider_list_response.py +14 -2
  15. phenoml/fhir_provider/types/fhir_provider_list_response_fhir_providers_item.py +8 -0
  16. phenoml/fhir_provider/types/fhir_provider_response.py +9 -2
  17. phenoml/fhir_provider/types/fhir_provider_response_data.py +8 -0
  18. phenoml/fhir_provider/types/fhir_provider_sandbox_info.py +46 -0
  19. phenoml/fhir_provider/types/provider.py +3 -1
  20. phenoml/fhir_provider/types/service_account_metadata.py +41 -0
  21. phenoml/lang2fhir/__init__.py +2 -0
  22. phenoml/lang2fhir/client.py +34 -4
  23. phenoml/lang2fhir/raw_client.py +34 -4
  24. phenoml/lang2fhir/types/__init__.py +2 -0
  25. phenoml/lang2fhir/types/search_response.py +7 -4
  26. phenoml/lang2fhir/types/search_response_resource_type.py +39 -0
  27. {phenoml-0.0.18.dist-info → phenoml-0.0.19.dist-info}/METADATA +1 -1
  28. {phenoml-0.0.18.dist-info → phenoml-0.0.19.dist-info}/RECORD +30 -24
  29. phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +0 -22
  30. {phenoml-0.0.18.dist-info → phenoml-0.0.19.dist-info}/LICENSE +0 -0
  31. {phenoml-0.0.18.dist-info → phenoml-0.0.19.dist-info}/WHEEL +0 -0
@@ -21,7 +21,6 @@ from .types.fhir_provider_delete_response import FhirProviderDeleteResponse
21
21
  from .types.fhir_provider_list_response import FhirProviderListResponse
22
22
  from .types.fhir_provider_remove_auth_config_response import FhirProviderRemoveAuthConfigResponse
23
23
  from .types.fhir_provider_response import FhirProviderResponse
24
- from .types.fhir_provider_set_active_auth_config_response import FhirProviderSetActiveAuthConfigResponse
25
24
  from .types.provider import Provider
26
25
  from .types.role import Role
27
26
  from .types.service_account_key import ServiceAccountKey
@@ -50,7 +49,9 @@ class RawFhirProviderClient:
50
49
  request_options: typing.Optional[RequestOptions] = None,
51
50
  ) -> HttpResponse[FhirProviderResponse]:
52
51
  """
53
- Creates a new FHIR provider configuration with authentication credentials
52
+ Creates a new FHIR provider configuration with authentication credentials.
53
+
54
+ Note: The "sandbox" provider type cannot be created via this API - it is managed internally.
54
55
 
55
56
  Parameters
56
57
  ----------
@@ -174,7 +175,10 @@ class RawFhirProviderClient:
174
175
  self, *, request_options: typing.Optional[RequestOptions] = None
175
176
  ) -> HttpResponse[FhirProviderListResponse]:
176
177
  """
177
- Retrieves a list of all active FHIR providers for the authenticated user
178
+ Retrieves a list of all active FHIR providers for the authenticated user.
179
+
180
+ On shared instances, only sandbox providers are returned.
181
+ Sandbox providers return FhirProviderSandboxInfo.
178
182
 
179
183
  Parameters
180
184
  ----------
@@ -212,17 +216,6 @@ class RawFhirProviderClient:
212
216
  ),
213
217
  ),
214
218
  )
215
- if _response.status_code == 403:
216
- raise ForbiddenError(
217
- headers=dict(_response.headers),
218
- body=typing.cast(
219
- typing.Optional[typing.Any],
220
- parse_obj_as(
221
- type_=typing.Optional[typing.Any], # type: ignore
222
- object_=_response.json(),
223
- ),
224
- ),
225
- )
226
219
  if _response.status_code == 500:
227
220
  raise InternalServerError(
228
221
  headers=dict(_response.headers),
@@ -243,7 +236,10 @@ class RawFhirProviderClient:
243
236
  self, fhir_provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
244
237
  ) -> HttpResponse[FhirProviderResponse]:
245
238
  """
246
- Retrieves a specific FHIR provider configuration by its ID
239
+ Retrieves a specific FHIR provider configuration by its ID.
240
+
241
+ Sandbox providers return FhirProviderSandboxInfo.
242
+ On shared instances, only sandbox providers can be accessed.
247
243
 
248
244
  Parameters
249
245
  ----------
@@ -326,7 +322,9 @@ class RawFhirProviderClient:
326
322
  self, fhir_provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
327
323
  ) -> HttpResponse[FhirProviderDeleteResponse]:
328
324
  """
329
- Soft deletes a FHIR provider by setting is_active to false
325
+ Soft deletes a FHIR provider by setting is_active to false.
326
+
327
+ Note: Sandbox providers cannot be deleted.
330
328
 
331
329
  Parameters
332
330
  ----------
@@ -418,7 +416,10 @@ class RawFhirProviderClient:
418
416
  request_options: typing.Optional[RequestOptions] = None,
419
417
  ) -> HttpResponse[FhirProviderResponse]:
420
418
  """
421
- Adds a new authentication configuration to an existing FHIR provider. This enables key rotation and multiple auth configurations per provider.
419
+ Adds a new authentication configuration to an existing FHIR provider.
420
+ This enables key rotation and multiple auth configurations per provider.
421
+
422
+ Note: Sandbox providers cannot be modified.
422
423
 
423
424
  Parameters
424
425
  ----------
@@ -539,9 +540,15 @@ class RawFhirProviderClient:
539
540
 
540
541
  def set_active_auth_config(
541
542
  self, fhir_provider_id: str, *, auth_config_id: str, request_options: typing.Optional[RequestOptions] = None
542
- ) -> HttpResponse[FhirProviderSetActiveAuthConfigResponse]:
543
+ ) -> HttpResponse[FhirProviderResponse]:
543
544
  """
544
- Sets which authentication configuration should be active for a FHIR provider. Only one auth config can be active at a time.
545
+ Sets which authentication configuration should be active for a FHIR provider.
546
+ Only one auth config can be active at a time.
547
+
548
+ If the specified auth config is already active, the request succeeds without
549
+ making any changes and returns a message indicating the config is already active.
550
+
551
+ Note: Sandbox providers cannot be modified.
545
552
 
546
553
  Parameters
547
554
  ----------
@@ -556,8 +563,9 @@ class RawFhirProviderClient:
556
563
 
557
564
  Returns
558
565
  -------
559
- HttpResponse[FhirProviderSetActiveAuthConfigResponse]
560
- Active auth configuration set successfully
566
+ HttpResponse[FhirProviderResponse]
567
+ Active auth configuration set successfully, or the config was already active.
568
+ Check the message field to determine which case occurred.
561
569
  """
562
570
  _response = self._client_wrapper.httpx_client.request(
563
571
  f"fhir-provider/{jsonable_encoder(fhir_provider_id)}/set-active-auth-config",
@@ -574,9 +582,9 @@ class RawFhirProviderClient:
574
582
  try:
575
583
  if 200 <= _response.status_code < 300:
576
584
  _data = typing.cast(
577
- FhirProviderSetActiveAuthConfigResponse,
585
+ FhirProviderResponse,
578
586
  parse_obj_as(
579
- type_=FhirProviderSetActiveAuthConfigResponse, # type: ignore
587
+ type_=FhirProviderResponse, # type: ignore
580
588
  object_=_response.json(),
581
589
  ),
582
590
  )
@@ -645,7 +653,10 @@ class RawFhirProviderClient:
645
653
  self, fhir_provider_id: str, *, auth_config_id: str, request_options: typing.Optional[RequestOptions] = None
646
654
  ) -> HttpResponse[FhirProviderRemoveAuthConfigResponse]:
647
655
  """
648
- Removes an authentication configuration from a FHIR provider. Cannot remove the currently active auth configuration.
656
+ Removes an authentication configuration from a FHIR provider.
657
+ Cannot remove the currently active auth configuration.
658
+
659
+ Note: Sandbox providers cannot be modified.
649
660
 
650
661
  Parameters
651
662
  ----------
@@ -766,7 +777,9 @@ class AsyncRawFhirProviderClient:
766
777
  request_options: typing.Optional[RequestOptions] = None,
767
778
  ) -> AsyncHttpResponse[FhirProviderResponse]:
768
779
  """
769
- Creates a new FHIR provider configuration with authentication credentials
780
+ Creates a new FHIR provider configuration with authentication credentials.
781
+
782
+ Note: The "sandbox" provider type cannot be created via this API - it is managed internally.
770
783
 
771
784
  Parameters
772
785
  ----------
@@ -890,7 +903,10 @@ class AsyncRawFhirProviderClient:
890
903
  self, *, request_options: typing.Optional[RequestOptions] = None
891
904
  ) -> AsyncHttpResponse[FhirProviderListResponse]:
892
905
  """
893
- Retrieves a list of all active FHIR providers for the authenticated user
906
+ Retrieves a list of all active FHIR providers for the authenticated user.
907
+
908
+ On shared instances, only sandbox providers are returned.
909
+ Sandbox providers return FhirProviderSandboxInfo.
894
910
 
895
911
  Parameters
896
912
  ----------
@@ -928,17 +944,6 @@ class AsyncRawFhirProviderClient:
928
944
  ),
929
945
  ),
930
946
  )
931
- if _response.status_code == 403:
932
- raise ForbiddenError(
933
- headers=dict(_response.headers),
934
- body=typing.cast(
935
- typing.Optional[typing.Any],
936
- parse_obj_as(
937
- type_=typing.Optional[typing.Any], # type: ignore
938
- object_=_response.json(),
939
- ),
940
- ),
941
- )
942
947
  if _response.status_code == 500:
943
948
  raise InternalServerError(
944
949
  headers=dict(_response.headers),
@@ -959,7 +964,10 @@ class AsyncRawFhirProviderClient:
959
964
  self, fhir_provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
960
965
  ) -> AsyncHttpResponse[FhirProviderResponse]:
961
966
  """
962
- Retrieves a specific FHIR provider configuration by its ID
967
+ Retrieves a specific FHIR provider configuration by its ID.
968
+
969
+ Sandbox providers return FhirProviderSandboxInfo.
970
+ On shared instances, only sandbox providers can be accessed.
963
971
 
964
972
  Parameters
965
973
  ----------
@@ -1042,7 +1050,9 @@ class AsyncRawFhirProviderClient:
1042
1050
  self, fhir_provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
1043
1051
  ) -> AsyncHttpResponse[FhirProviderDeleteResponse]:
1044
1052
  """
1045
- Soft deletes a FHIR provider by setting is_active to false
1053
+ Soft deletes a FHIR provider by setting is_active to false.
1054
+
1055
+ Note: Sandbox providers cannot be deleted.
1046
1056
 
1047
1057
  Parameters
1048
1058
  ----------
@@ -1134,7 +1144,10 @@ class AsyncRawFhirProviderClient:
1134
1144
  request_options: typing.Optional[RequestOptions] = None,
1135
1145
  ) -> AsyncHttpResponse[FhirProviderResponse]:
1136
1146
  """
1137
- Adds a new authentication configuration to an existing FHIR provider. This enables key rotation and multiple auth configurations per provider.
1147
+ Adds a new authentication configuration to an existing FHIR provider.
1148
+ This enables key rotation and multiple auth configurations per provider.
1149
+
1150
+ Note: Sandbox providers cannot be modified.
1138
1151
 
1139
1152
  Parameters
1140
1153
  ----------
@@ -1255,9 +1268,15 @@ class AsyncRawFhirProviderClient:
1255
1268
 
1256
1269
  async def set_active_auth_config(
1257
1270
  self, fhir_provider_id: str, *, auth_config_id: str, request_options: typing.Optional[RequestOptions] = None
1258
- ) -> AsyncHttpResponse[FhirProviderSetActiveAuthConfigResponse]:
1271
+ ) -> AsyncHttpResponse[FhirProviderResponse]:
1259
1272
  """
1260
- Sets which authentication configuration should be active for a FHIR provider. Only one auth config can be active at a time.
1273
+ Sets which authentication configuration should be active for a FHIR provider.
1274
+ Only one auth config can be active at a time.
1275
+
1276
+ If the specified auth config is already active, the request succeeds without
1277
+ making any changes and returns a message indicating the config is already active.
1278
+
1279
+ Note: Sandbox providers cannot be modified.
1261
1280
 
1262
1281
  Parameters
1263
1282
  ----------
@@ -1272,8 +1291,9 @@ class AsyncRawFhirProviderClient:
1272
1291
 
1273
1292
  Returns
1274
1293
  -------
1275
- AsyncHttpResponse[FhirProviderSetActiveAuthConfigResponse]
1276
- Active auth configuration set successfully
1294
+ AsyncHttpResponse[FhirProviderResponse]
1295
+ Active auth configuration set successfully, or the config was already active.
1296
+ Check the message field to determine which case occurred.
1277
1297
  """
1278
1298
  _response = await self._client_wrapper.httpx_client.request(
1279
1299
  f"fhir-provider/{jsonable_encoder(fhir_provider_id)}/set-active-auth-config",
@@ -1290,9 +1310,9 @@ class AsyncRawFhirProviderClient:
1290
1310
  try:
1291
1311
  if 200 <= _response.status_code < 300:
1292
1312
  _data = typing.cast(
1293
- FhirProviderSetActiveAuthConfigResponse,
1313
+ FhirProviderResponse,
1294
1314
  parse_obj_as(
1295
- type_=FhirProviderSetActiveAuthConfigResponse, # type: ignore
1315
+ type_=FhirProviderResponse, # type: ignore
1296
1316
  object_=_response.json(),
1297
1317
  ),
1298
1318
  )
@@ -1361,7 +1381,10 @@ class AsyncRawFhirProviderClient:
1361
1381
  self, fhir_provider_id: str, *, auth_config_id: str, request_options: typing.Optional[RequestOptions] = None
1362
1382
  ) -> AsyncHttpResponse[FhirProviderRemoveAuthConfigResponse]:
1363
1383
  """
1364
- Removes an authentication configuration from a FHIR provider. Cannot remove the currently active auth configuration.
1384
+ Removes an authentication configuration from a FHIR provider.
1385
+ Cannot remove the currently active auth configuration.
1386
+
1387
+ Note: Sandbox providers cannot be modified.
1365
1388
 
1366
1389
  Parameters
1367
1390
  ----------
@@ -6,9 +6,11 @@ from .auth_method import AuthMethod
6
6
  from .fhir_provider_auth_config import FhirProviderAuthConfig
7
7
  from .fhir_provider_delete_response import FhirProviderDeleteResponse
8
8
  from .fhir_provider_list_response import FhirProviderListResponse
9
+ from .fhir_provider_list_response_fhir_providers_item import FhirProviderListResponseFhirProvidersItem
9
10
  from .fhir_provider_remove_auth_config_response import FhirProviderRemoveAuthConfigResponse
10
11
  from .fhir_provider_response import FhirProviderResponse
11
- from .fhir_provider_set_active_auth_config_response import FhirProviderSetActiveAuthConfigResponse
12
+ from .fhir_provider_response_data import FhirProviderResponseData
13
+ from .fhir_provider_sandbox_info import FhirProviderSandboxInfo
12
14
  from .fhir_provider_template import FhirProviderTemplate
13
15
  from .fhir_query_response import FhirQueryResponse
14
16
  from .fhir_query_response_data import FhirQueryResponseData
@@ -16,6 +18,7 @@ from .json_web_key import JsonWebKey
16
18
  from .provider import Provider
17
19
  from .role import Role
18
20
  from .service_account_key import ServiceAccountKey
21
+ from .service_account_metadata import ServiceAccountMetadata
19
22
  from .smart_configuration import SmartConfiguration
20
23
 
21
24
  __all__ = [
@@ -23,9 +26,11 @@ __all__ = [
23
26
  "FhirProviderAuthConfig",
24
27
  "FhirProviderDeleteResponse",
25
28
  "FhirProviderListResponse",
29
+ "FhirProviderListResponseFhirProvidersItem",
26
30
  "FhirProviderRemoveAuthConfigResponse",
27
31
  "FhirProviderResponse",
28
- "FhirProviderSetActiveAuthConfigResponse",
32
+ "FhirProviderResponseData",
33
+ "FhirProviderSandboxInfo",
29
34
  "FhirProviderTemplate",
30
35
  "FhirQueryResponse",
31
36
  "FhirQueryResponseData",
@@ -33,5 +38,6 @@ __all__ = [
33
38
  "Provider",
34
39
  "Role",
35
40
  "ServiceAccountKey",
41
+ "ServiceAccountMetadata",
36
42
  "SmartConfiguration",
37
43
  ]
@@ -7,6 +7,7 @@ import pydantic
7
7
  from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
8
  from .auth_method import AuthMethod
9
9
  from .json_web_key import JsonWebKey
10
+ from .service_account_metadata import ServiceAccountMetadata
10
11
  from .smart_configuration import SmartConfiguration
11
12
 
12
13
 
@@ -26,6 +27,16 @@ class FhirProviderAuthConfig(UniversalBaseModel):
26
27
  Whether this auth configuration is currently active
27
28
  """
28
29
 
30
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
31
+ """
32
+ Timestamp when this auth configuration was created
33
+ """
34
+
35
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
36
+ """
37
+ Timestamp when this auth configuration was last updated
38
+ """
39
+
29
40
  public_key_cert_pem: typing.Optional[str] = pydantic.Field(default=None)
30
41
  """
31
42
  Public key certificate in PEM format (visible for JWT auth)
@@ -38,6 +49,7 @@ class FhirProviderAuthConfig(UniversalBaseModel):
38
49
  """
39
50
 
40
51
  smart_configuration: typing.Optional[SmartConfiguration] = None
52
+ service_account_metadata: typing.Optional[ServiceAccountMetadata] = None
41
53
  scopes: typing.Optional[str] = pydantic.Field(default=None)
42
54
  """
43
55
  OAuth scopes
@@ -4,13 +4,25 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .fhir_provider_template import FhirProviderTemplate
7
+ from .fhir_provider_list_response_fhir_providers_item import FhirProviderListResponseFhirProvidersItem
8
8
 
9
9
 
10
10
  class FhirProviderListResponse(UniversalBaseModel):
11
+ """
12
+ Response payload for listing FHIR Providers.
13
+ On shared instances, only sandbox providers are returned (as FhirProviderSandboxInfo).
14
+ On dedicated instances, full provider details are returned (as FhirProviderTemplate).
15
+ """
16
+
11
17
  success: typing.Optional[bool] = None
12
18
  message: typing.Optional[str] = None
13
- fhir_providers: typing.Optional[typing.List[FhirProviderTemplate]] = None
19
+ fhir_providers: typing.Optional[typing.List[FhirProviderListResponseFhirProvidersItem]] = pydantic.Field(
20
+ default=None
21
+ )
22
+ """
23
+ List of FHIR providers. Sandbox providers return FhirProviderSandboxInfo,
24
+ other providers return FhirProviderTemplate.
25
+ """
14
26
 
15
27
  if IS_PYDANTIC_V2:
16
28
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .fhir_provider_sandbox_info import FhirProviderSandboxInfo
6
+ from .fhir_provider_template import FhirProviderTemplate
7
+
8
+ FhirProviderListResponseFhirProvidersItem = typing.Union[FhirProviderTemplate, FhirProviderSandboxInfo]
@@ -4,13 +4,20 @@ import typing
4
4
 
5
5
  import pydantic
6
6
  from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .fhir_provider_template import FhirProviderTemplate
7
+ from .fhir_provider_response_data import FhirProviderResponseData
8
8
 
9
9
 
10
10
  class FhirProviderResponse(UniversalBaseModel):
11
+ """
12
+ Response payload for a single FHIR Provider operation.
13
+ """
14
+
11
15
  success: typing.Optional[bool] = None
12
16
  message: typing.Optional[str] = None
13
- data: typing.Optional[FhirProviderTemplate] = None
17
+ data: typing.Optional[FhirProviderResponseData] = pydantic.Field(default=None)
18
+ """
19
+ Provider details. Sandbox providers return FhirProviderSandboxInfo.
20
+ """
14
21
 
15
22
  if IS_PYDANTIC_V2:
16
23
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .fhir_provider_sandbox_info import FhirProviderSandboxInfo
6
+ from .fhir_provider_template import FhirProviderTemplate
7
+
8
+ FhirProviderResponseData = typing.Union[FhirProviderTemplate, FhirProviderSandboxInfo]
@@ -0,0 +1,46 @@
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 FhirProviderSandboxInfo(UniversalBaseModel):
10
+ """
11
+ Information returned for sandbox FHIR providers.
12
+ """
13
+
14
+ id: typing.Optional[str] = pydantic.Field(default=None)
15
+ """
16
+ Unique identifier for the FHIR provider
17
+ """
18
+
19
+ name: typing.Optional[str] = pydantic.Field(default=None)
20
+ """
21
+ Display name for the FHIR provider
22
+ """
23
+
24
+ description: typing.Optional[str] = pydantic.Field(default=None)
25
+ """
26
+ Optional description of the FHIR provider
27
+ """
28
+
29
+ provider: typing.Optional[typing.Literal["sandbox"]] = pydantic.Field(default=None)
30
+ """
31
+ Provider type (always "sandbox" for this schema)
32
+ """
33
+
34
+ is_active: typing.Optional[bool] = pydantic.Field(default=None)
35
+ """
36
+ Whether the FHIR provider is active
37
+ """
38
+
39
+ if IS_PYDANTIC_V2:
40
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
41
+ else:
42
+
43
+ class Config:
44
+ frozen = True
45
+ smart_union = True
46
+ extra = pydantic.Extra.allow
@@ -3,6 +3,8 @@
3
3
  import typing
4
4
 
5
5
  Provider = typing.Union[
6
- typing.Literal["athenahealth", "canvas", "cerner", "elation", "epic", "google_healthcare", "hapi", "medplum"],
6
+ typing.Literal[
7
+ "athenahealth", "canvas", "cerner", "elation", "epic", "google_healthcare", "hapi", "medplum", "sandbox"
8
+ ],
7
9
  typing.Any,
8
10
  ]
@@ -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
+
8
+
9
+ class ServiceAccountMetadata(UniversalBaseModel):
10
+ """
11
+ Non-sensitive metadata from a Google Cloud Service Account, exposed in API responses to help identify auth configurations without revealing sensitive credentials.
12
+ """
13
+
14
+ type: typing.Optional[str] = pydantic.Field(default=None)
15
+ """
16
+ Account type (always "service_account")
17
+ """
18
+
19
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
20
+ """
21
+ Google Cloud project ID
22
+ """
23
+
24
+ client_email: typing.Optional[str] = pydantic.Field(default=None)
25
+ """
26
+ Service account email address
27
+ """
28
+
29
+ client_id: typing.Optional[str] = pydantic.Field(default=None)
30
+ """
31
+ Service account client ID
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
@@ -14,6 +14,7 @@ from .types import (
14
14
  FhirResource,
15
15
  Lang2FhirUploadProfileResponse,
16
16
  SearchResponse,
17
+ SearchResponseResourceType,
17
18
  )
18
19
  from .errors import BadRequestError, FailedDependencyError, ForbiddenError, InternalServerError, UnauthorizedError
19
20
 
@@ -33,5 +34,6 @@ __all__ = [
33
34
  "InternalServerError",
34
35
  "Lang2FhirUploadProfileResponse",
35
36
  "SearchResponse",
37
+ "SearchResponseResourceType",
36
38
  "UnauthorizedError",
37
39
  ]
@@ -130,12 +130,27 @@ class Lang2FhirClient:
130
130
 
131
131
  def search(self, *, text: str, request_options: typing.Optional[RequestOptions] = None) -> SearchResponse:
132
132
  """
133
- Converts natural language text into FHIR search parameters
133
+ Converts natural language text into FHIR search parameters.
134
+ Automatically identifies the appropriate FHIR resource type and generates valid search query parameters.
135
+
136
+ Supported resource types include: AllergyIntolerance, Appointment, CarePlan, CareTeam, Condition,
137
+ Coverage, Device, DiagnosticReport, DocumentReference, Encounter, Goal, Immunization, Location,
138
+ Medication, MedicationRequest, Observation, Organization, Patient, PlanDefinition, Practitioner,
139
+ PractitionerRole, Procedure, Provenance, Questionnaire, QuestionnaireResponse, RelatedPerson,
140
+ Schedule, ServiceRequest, Slot, and Specimen.
134
141
 
135
142
  Parameters
136
143
  ----------
137
144
  text : str
138
- Natural language text to convert into FHIR search parameters
145
+ Natural language text to convert into FHIR search parameters.
146
+ The system will automatically identify the appropriate resource type and generate valid search parameters.
147
+
148
+ Examples:
149
+ - "Appointments between March 2-9, 2025" → Appointment search with date range
150
+ - "Patients with diabetes" → Condition search with code parameter
151
+ - "Active medication requests for metformin" → MedicationRequest search
152
+ - "Lab results for creatinine" → DiagnosticReport search
153
+ - "Dr. Smith's schedule" → Practitioner or Schedule search
139
154
 
140
155
  request_options : typing.Optional[RequestOptions]
141
156
  Request-specific configuration.
@@ -385,12 +400,27 @@ class AsyncLang2FhirClient:
385
400
 
386
401
  async def search(self, *, text: str, request_options: typing.Optional[RequestOptions] = None) -> SearchResponse:
387
402
  """
388
- Converts natural language text into FHIR search parameters
403
+ Converts natural language text into FHIR search parameters.
404
+ Automatically identifies the appropriate FHIR resource type and generates valid search query parameters.
405
+
406
+ Supported resource types include: AllergyIntolerance, Appointment, CarePlan, CareTeam, Condition,
407
+ Coverage, Device, DiagnosticReport, DocumentReference, Encounter, Goal, Immunization, Location,
408
+ Medication, MedicationRequest, Observation, Organization, Patient, PlanDefinition, Practitioner,
409
+ PractitionerRole, Procedure, Provenance, Questionnaire, QuestionnaireResponse, RelatedPerson,
410
+ Schedule, ServiceRequest, Slot, and Specimen.
389
411
 
390
412
  Parameters
391
413
  ----------
392
414
  text : str
393
- Natural language text to convert into FHIR search parameters
415
+ Natural language text to convert into FHIR search parameters.
416
+ The system will automatically identify the appropriate resource type and generate valid search parameters.
417
+
418
+ Examples:
419
+ - "Appointments between March 2-9, 2025" → Appointment search with date range
420
+ - "Patients with diabetes" → Condition search with code parameter
421
+ - "Active medication requests for metformin" → MedicationRequest search
422
+ - "Lab results for creatinine" → DiagnosticReport search
423
+ - "Dr. Smith's schedule" → Practitioner or Schedule search
394
424
 
395
425
  request_options : typing.Optional[RequestOptions]
396
426
  Request-specific configuration.
@@ -219,12 +219,27 @@ class RawLang2FhirClient:
219
219
  self, *, text: str, request_options: typing.Optional[RequestOptions] = None
220
220
  ) -> HttpResponse[SearchResponse]:
221
221
  """
222
- Converts natural language text into FHIR search parameters
222
+ Converts natural language text into FHIR search parameters.
223
+ Automatically identifies the appropriate FHIR resource type and generates valid search query parameters.
224
+
225
+ Supported resource types include: AllergyIntolerance, Appointment, CarePlan, CareTeam, Condition,
226
+ Coverage, Device, DiagnosticReport, DocumentReference, Encounter, Goal, Immunization, Location,
227
+ Medication, MedicationRequest, Observation, Organization, Patient, PlanDefinition, Practitioner,
228
+ PractitionerRole, Procedure, Provenance, Questionnaire, QuestionnaireResponse, RelatedPerson,
229
+ Schedule, ServiceRequest, Slot, and Specimen.
223
230
 
224
231
  Parameters
225
232
  ----------
226
233
  text : str
227
- Natural language text to convert into FHIR search parameters
234
+ Natural language text to convert into FHIR search parameters.
235
+ The system will automatically identify the appropriate resource type and generate valid search parameters.
236
+
237
+ Examples:
238
+ - "Appointments between March 2-9, 2025" → Appointment search with date range
239
+ - "Patients with diabetes" → Condition search with code parameter
240
+ - "Active medication requests for metformin" → MedicationRequest search
241
+ - "Lab results for creatinine" → DiagnosticReport search
242
+ - "Dr. Smith's schedule" → Practitioner or Schedule search
228
243
 
229
244
  request_options : typing.Optional[RequestOptions]
230
245
  Request-specific configuration.
@@ -695,12 +710,27 @@ class AsyncRawLang2FhirClient:
695
710
  self, *, text: str, request_options: typing.Optional[RequestOptions] = None
696
711
  ) -> AsyncHttpResponse[SearchResponse]:
697
712
  """
698
- Converts natural language text into FHIR search parameters
713
+ Converts natural language text into FHIR search parameters.
714
+ Automatically identifies the appropriate FHIR resource type and generates valid search query parameters.
715
+
716
+ Supported resource types include: AllergyIntolerance, Appointment, CarePlan, CareTeam, Condition,
717
+ Coverage, Device, DiagnosticReport, DocumentReference, Encounter, Goal, Immunization, Location,
718
+ Medication, MedicationRequest, Observation, Organization, Patient, PlanDefinition, Practitioner,
719
+ PractitionerRole, Procedure, Provenance, Questionnaire, QuestionnaireResponse, RelatedPerson,
720
+ Schedule, ServiceRequest, Slot, and Specimen.
699
721
 
700
722
  Parameters
701
723
  ----------
702
724
  text : str
703
- Natural language text to convert into FHIR search parameters
725
+ Natural language text to convert into FHIR search parameters.
726
+ The system will automatically identify the appropriate resource type and generate valid search parameters.
727
+
728
+ Examples:
729
+ - "Appointments between March 2-9, 2025" → Appointment search with date range
730
+ - "Patients with diabetes" → Condition search with code parameter
731
+ - "Active medication requests for metformin" → MedicationRequest search
732
+ - "Lab results for creatinine" → DiagnosticReport search
733
+ - "Dr. Smith's schedule" → Practitioner or Schedule search
704
734
 
705
735
  request_options : typing.Optional[RequestOptions]
706
736
  Request-specific configuration.
@@ -13,6 +13,7 @@ from .document_request_resource import DocumentRequestResource
13
13
  from .fhir_resource import FhirResource
14
14
  from .lang2fhir_upload_profile_response import Lang2FhirUploadProfileResponse
15
15
  from .search_response import SearchResponse
16
+ from .search_response_resource_type import SearchResponseResourceType
16
17
 
17
18
  __all__ = [
18
19
  "CreateMultiResponse",
@@ -26,4 +27,5 @@ __all__ = [
26
27
  "FhirResource",
27
28
  "Lang2FhirUploadProfileResponse",
28
29
  "SearchResponse",
30
+ "SearchResponseResourceType",
29
31
  ]