phenoml 0.0.2__py3-none-any.whl → 0.0.17__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 (149) hide show
  1. phenoml/agent/__init__.py +6 -8
  2. phenoml/agent/client.py +85 -67
  3. phenoml/agent/raw_client.py +61 -77
  4. phenoml/agent/types/__init__.py +6 -8
  5. phenoml/agent/types/agent_create_request.py +53 -0
  6. phenoml/agent/types/agent_create_request_provider.py +5 -0
  7. phenoml/agent/types/agent_template.py +3 -6
  8. phenoml/agent/types/agent_template_provider.py +5 -0
  9. phenoml/agent/types/json_patch_operation.py +5 -1
  10. phenoml/client.py +12 -0
  11. phenoml/construe/__init__.py +2 -16
  12. phenoml/construe/client.py +0 -90
  13. phenoml/construe/raw_client.py +0 -180
  14. phenoml/construe/types/__init__.py +2 -20
  15. phenoml/construe/types/extract_request_config.py +33 -4
  16. phenoml/construe/types/extract_request_config_chunking_method.py +3 -1
  17. phenoml/construe/types/extract_request_config_validation_method.py +5 -0
  18. phenoml/construe/types/extract_request_system.py +2 -0
  19. phenoml/core/client_wrapper.py +2 -2
  20. phenoml/fhir/__init__.py +36 -0
  21. phenoml/fhir/client.py +1072 -0
  22. phenoml/fhir/errors/__init__.py +10 -0
  23. phenoml/fhir/errors/bad_request_error.py +10 -0
  24. phenoml/fhir/errors/internal_server_error.py +10 -0
  25. phenoml/fhir/errors/not_found_error.py +10 -0
  26. phenoml/fhir/errors/unauthorized_error.py +10 -0
  27. phenoml/fhir/raw_client.py +1469 -0
  28. phenoml/fhir/types/__init__.py +29 -0
  29. phenoml/{agent/types/chat_fhir_client_config.py → fhir/types/error_response.py} +11 -6
  30. phenoml/fhir/types/fhir_bundle.py +43 -0
  31. phenoml/fhir/types/fhir_bundle_entry_item.py +34 -0
  32. phenoml/fhir/types/fhir_bundle_entry_item_request.py +25 -0
  33. phenoml/fhir/types/fhir_bundle_entry_item_request_method.py +5 -0
  34. phenoml/{construe/types/bad_request_error_body.py → fhir/types/fhir_bundle_entry_item_response.py} +4 -7
  35. phenoml/fhir/types/fhir_patch_request_body_item.py +40 -0
  36. phenoml/fhir/types/fhir_patch_request_body_item_op.py +7 -0
  37. phenoml/fhir/types/fhir_resource.py +40 -0
  38. phenoml/fhir/types/fhir_resource_meta.py +28 -0
  39. phenoml/fhir/types/fhir_search_response.py +8 -0
  40. phenoml/fhir_provider/__init__.py +45 -0
  41. phenoml/fhir_provider/client.py +748 -0
  42. phenoml/fhir_provider/errors/__init__.py +11 -0
  43. phenoml/fhir_provider/errors/bad_request_error.py +10 -0
  44. phenoml/fhir_provider/errors/forbidden_error.py +10 -0
  45. phenoml/fhir_provider/errors/internal_server_error.py +10 -0
  46. phenoml/fhir_provider/errors/not_found_error.py +10 -0
  47. phenoml/fhir_provider/errors/unauthorized_error.py +10 -0
  48. phenoml/fhir_provider/raw_client.py +1462 -0
  49. phenoml/fhir_provider/types/__init__.py +37 -0
  50. phenoml/fhir_provider/types/auth_method.py +7 -0
  51. phenoml/fhir_provider/types/fhir_provider_auth_config.py +53 -0
  52. phenoml/fhir_provider/types/fhir_provider_delete_response.py +20 -0
  53. phenoml/fhir_provider/types/fhir_provider_list_response.py +22 -0
  54. phenoml/fhir_provider/types/fhir_provider_remove_auth_config_response.py +22 -0
  55. phenoml/fhir_provider/types/fhir_provider_response.py +22 -0
  56. phenoml/fhir_provider/types/fhir_provider_set_active_auth_config_response.py +22 -0
  57. phenoml/fhir_provider/types/fhir_provider_template.py +66 -0
  58. phenoml/fhir_provider/types/fhir_query_response.py +27 -0
  59. phenoml/fhir_provider/types/fhir_query_response_data.py +5 -0
  60. phenoml/fhir_provider/types/json_web_key.py +51 -0
  61. phenoml/fhir_provider/types/provider.py +8 -0
  62. phenoml/fhir_provider/types/role.py +27 -0
  63. phenoml/fhir_provider/types/service_account_key.py +35 -0
  64. phenoml/fhir_provider/types/smart_configuration.py +46 -0
  65. phenoml/lang2fhir/__init__.py +10 -0
  66. phenoml/lang2fhir/client.py +111 -6
  67. phenoml/lang2fhir/raw_client.py +189 -0
  68. phenoml/lang2fhir/types/__init__.py +10 -0
  69. phenoml/lang2fhir/types/create_multi_response.py +39 -0
  70. phenoml/lang2fhir/types/create_multi_response_bundle.py +28 -0
  71. phenoml/lang2fhir/types/create_multi_response_bundle_entry_item.py +24 -0
  72. phenoml/lang2fhir/types/create_multi_response_bundle_entry_item_request.py +20 -0
  73. phenoml/{construe/types/construe_cohort_response_queries_item_code_extract_results_item_codes_item.py → lang2fhir/types/create_multi_response_resources_item.py} +13 -7
  74. phenoml/summary/__init__.py +41 -0
  75. phenoml/summary/client.py +668 -0
  76. phenoml/summary/errors/__init__.py +11 -0
  77. phenoml/summary/errors/bad_request_error.py +10 -0
  78. phenoml/summary/errors/forbidden_error.py +10 -0
  79. phenoml/summary/errors/internal_server_error.py +10 -0
  80. phenoml/summary/errors/not_found_error.py +10 -0
  81. phenoml/summary/errors/unauthorized_error.py +10 -0
  82. phenoml/summary/raw_client.py +1202 -0
  83. phenoml/summary/types/__init__.py +33 -0
  84. phenoml/summary/types/create_summary_request_fhir_resources.py +8 -0
  85. phenoml/summary/types/create_summary_request_mode.py +5 -0
  86. phenoml/{agent/types/agent_fhir_config.py → summary/types/create_summary_response.py} +7 -9
  87. phenoml/summary/types/create_summary_template_response.py +23 -0
  88. phenoml/{construe/types/unauthorized_error_body.py → summary/types/error_response.py} +4 -8
  89. phenoml/summary/types/fhir_bundle.py +23 -0
  90. phenoml/summary/types/fhir_bundle_entry_item.py +20 -0
  91. phenoml/summary/types/fhir_resource.py +24 -0
  92. phenoml/summary/types/summary_delete_template_response.py +20 -0
  93. phenoml/summary/types/summary_get_template_response.py +21 -0
  94. phenoml/summary/types/summary_list_templates_response.py +21 -0
  95. phenoml/summary/types/summary_template.py +41 -0
  96. phenoml/summary/types/summary_update_template_response.py +22 -0
  97. phenoml/tools/__init__.py +6 -8
  98. phenoml/tools/client.py +259 -44
  99. phenoml/tools/raw_client.py +347 -55
  100. phenoml/tools/types/__init__.py +6 -8
  101. phenoml/tools/types/lang2fhir_and_create_multi_response.py +41 -0
  102. phenoml/{construe/types/construe_cohort_response_queries_item_code_extract_results_item.py → tools/types/lang2fhir_and_create_multi_response_resource_info_item.py} +14 -7
  103. phenoml/tools/types/lang2fhir_and_create_multi_response_response_bundle.py +27 -0
  104. phenoml/workflows/__init__.py +61 -0
  105. phenoml/workflows/client.py +694 -0
  106. phenoml/workflows/errors/__init__.py +11 -0
  107. phenoml/workflows/errors/bad_request_error.py +10 -0
  108. phenoml/workflows/errors/forbidden_error.py +10 -0
  109. phenoml/workflows/errors/internal_server_error.py +10 -0
  110. phenoml/workflows/errors/not_found_error.py +10 -0
  111. phenoml/workflows/errors/unauthorized_error.py +10 -0
  112. phenoml/workflows/raw_client.py +1266 -0
  113. phenoml/workflows/types/__init__.py +53 -0
  114. phenoml/workflows/types/create_workflow_request_fhir_provider_id.py +5 -0
  115. phenoml/workflows/types/create_workflow_response.py +44 -0
  116. phenoml/{tools/types/fhir_client_config.py → workflows/types/decision_node_definition.py} +7 -6
  117. phenoml/workflows/types/execute_workflow_response.py +30 -0
  118. phenoml/{construe/types/internal_server_error_body.py → workflows/types/execute_workflow_response_results.py} +3 -8
  119. phenoml/workflows/types/lang2fhir_create_definition.py +37 -0
  120. phenoml/workflows/types/lang2fhir_search_definition.py +42 -0
  121. phenoml/workflows/types/list_workflows_response.py +39 -0
  122. phenoml/workflows/types/step_operation.py +26 -0
  123. phenoml/workflows/types/sub_workflow_definition.py +32 -0
  124. phenoml/workflows/types/update_workflow_request_fhir_provider_id.py +5 -0
  125. phenoml/workflows/types/workflow_config.py +27 -0
  126. phenoml/workflows/types/workflow_definition.py +57 -0
  127. phenoml/workflows/types/workflow_graph.py +23 -0
  128. phenoml/workflows/types/workflow_response.py +61 -0
  129. phenoml/workflows/types/workflow_response_graph.py +23 -0
  130. phenoml/workflows/types/workflow_step.py +55 -0
  131. phenoml/workflows/types/workflow_step_summary.py +47 -0
  132. phenoml/workflows/types/workflow_step_summary_type.py +5 -0
  133. phenoml/workflows/types/workflow_step_type.py +5 -0
  134. phenoml/workflows/types/workflows_delete_response.py +20 -0
  135. phenoml/workflows/types/workflows_get_response.py +26 -0
  136. phenoml/workflows/types/workflows_update_response.py +31 -0
  137. phenoml-0.0.17.dist-info/LICENSE +21 -0
  138. {phenoml-0.0.2.dist-info → phenoml-0.0.17.dist-info}/METADATA +1 -1
  139. phenoml-0.0.17.dist-info/RECORD +251 -0
  140. phenoml/agent/types/agent_provider.py +0 -7
  141. phenoml/agent/types/provider_type.py +0 -5
  142. phenoml/construe/types/construe_cohort_request_config.py +0 -37
  143. phenoml/construe/types/construe_cohort_response.py +0 -33
  144. phenoml/construe/types/construe_cohort_response_queries_item.py +0 -49
  145. phenoml/tools/types/cohort_request_provider.py +0 -5
  146. phenoml/tools/types/lang2fhir_and_create_request_provider.py +0 -7
  147. phenoml/tools/types/lang2fhir_and_search_request_provider.py +0 -7
  148. phenoml-0.0.2.dist-info/RECORD +0 -153
  149. {phenoml-0.0.2.dist-info → phenoml-0.0.17.dist-info}/WHEEL +0 -0
@@ -0,0 +1,37 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .auth_method import AuthMethod
6
+ from .fhir_provider_auth_config import FhirProviderAuthConfig
7
+ from .fhir_provider_delete_response import FhirProviderDeleteResponse
8
+ from .fhir_provider_list_response import FhirProviderListResponse
9
+ from .fhir_provider_remove_auth_config_response import FhirProviderRemoveAuthConfigResponse
10
+ from .fhir_provider_response import FhirProviderResponse
11
+ from .fhir_provider_set_active_auth_config_response import FhirProviderSetActiveAuthConfigResponse
12
+ from .fhir_provider_template import FhirProviderTemplate
13
+ from .fhir_query_response import FhirQueryResponse
14
+ from .fhir_query_response_data import FhirQueryResponseData
15
+ from .json_web_key import JsonWebKey
16
+ from .provider import Provider
17
+ from .role import Role
18
+ from .service_account_key import ServiceAccountKey
19
+ from .smart_configuration import SmartConfiguration
20
+
21
+ __all__ = [
22
+ "AuthMethod",
23
+ "FhirProviderAuthConfig",
24
+ "FhirProviderDeleteResponse",
25
+ "FhirProviderListResponse",
26
+ "FhirProviderRemoveAuthConfigResponse",
27
+ "FhirProviderResponse",
28
+ "FhirProviderSetActiveAuthConfigResponse",
29
+ "FhirProviderTemplate",
30
+ "FhirQueryResponse",
31
+ "FhirQueryResponseData",
32
+ "JsonWebKey",
33
+ "Provider",
34
+ "Role",
35
+ "ServiceAccountKey",
36
+ "SmartConfiguration",
37
+ ]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AuthMethod = typing.Union[
6
+ typing.Literal["client_secret", "google_healthcare", "jwt", "on_behalf_of", "token_passthrough", "none"], typing.Any
7
+ ]
@@ -0,0 +1,53 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from .auth_method import AuthMethod
9
+ from .json_web_key import JsonWebKey
10
+ from .smart_configuration import SmartConfiguration
11
+
12
+
13
+ class FhirProviderAuthConfig(UniversalBaseModel):
14
+ """
15
+ Authentication configuration for a FHIR provider (sensitive fields are hidden from JSON responses)
16
+ """
17
+
18
+ auth_config_id: typing.Optional[str] = pydantic.Field(default=None)
19
+ """
20
+ Unique identifier for this auth configuration
21
+ """
22
+
23
+ auth_method: typing.Optional[AuthMethod] = None
24
+ is_active_auth_config: typing.Optional[bool] = pydantic.Field(default=None)
25
+ """
26
+ Whether this auth configuration is currently active
27
+ """
28
+
29
+ public_key_cert_pem: typing.Optional[str] = pydantic.Field(default=None)
30
+ """
31
+ Public key certificate in PEM format (visible for JWT auth)
32
+ """
33
+
34
+ json_web_key: typing.Optional[JsonWebKey] = None
35
+ credential_expiry: typing.Optional[dt.datetime] = pydantic.Field(default=None)
36
+ """
37
+ Expiry time for credentials (JWT auth only)
38
+ """
39
+
40
+ smart_configuration: typing.Optional[SmartConfiguration] = None
41
+ scopes: typing.Optional[str] = pydantic.Field(default=None)
42
+ """
43
+ OAuth scopes
44
+ """
45
+
46
+ if IS_PYDANTIC_V2:
47
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
48
+ else:
49
+
50
+ class Config:
51
+ frozen = True
52
+ smart_union = True
53
+ 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 FhirProviderDeleteResponse(UniversalBaseModel):
10
+ success: typing.Optional[bool] = None
11
+ message: 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,22 @@
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 .fhir_provider_template import FhirProviderTemplate
8
+
9
+
10
+ class FhirProviderListResponse(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ message: typing.Optional[str] = None
13
+ fhir_providers: typing.Optional[typing.List[FhirProviderTemplate]] = None
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
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 .fhir_provider_template import FhirProviderTemplate
8
+
9
+
10
+ class FhirProviderRemoveAuthConfigResponse(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ message: typing.Optional[str] = None
13
+ data: typing.Optional[FhirProviderTemplate] = None
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
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 .fhir_provider_template import FhirProviderTemplate
8
+
9
+
10
+ class FhirProviderResponse(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ message: typing.Optional[str] = None
13
+ data: typing.Optional[FhirProviderTemplate] = None
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
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 .fhir_provider_template import FhirProviderTemplate
8
+
9
+
10
+ class FhirProviderSetActiveAuthConfigResponse(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ message: typing.Optional[str] = None
13
+ data: typing.Optional[FhirProviderTemplate] = None
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,66 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from .fhir_provider_auth_config import FhirProviderAuthConfig
9
+ from .provider import Provider
10
+
11
+
12
+ class FhirProviderTemplate(UniversalBaseModel):
13
+ id: typing.Optional[str] = pydantic.Field(default=None)
14
+ """
15
+ Unique identifier for the FHIR provider
16
+ """
17
+
18
+ user_id: typing.Optional[str] = pydantic.Field(default=None)
19
+ """
20
+ ID of the user who owns this FHIR provider
21
+ """
22
+
23
+ name: typing.Optional[str] = pydantic.Field(default=None)
24
+ """
25
+ Display name for the FHIR provider
26
+ """
27
+
28
+ description: typing.Optional[str] = pydantic.Field(default=None)
29
+ """
30
+ Optional description of the FHIR provider
31
+ """
32
+
33
+ provider: typing.Optional[Provider] = None
34
+ base_url: typing.Optional[str] = pydantic.Field(default=None)
35
+ """
36
+ Base URL of the FHIR server
37
+ """
38
+
39
+ client_id: typing.Optional[str] = pydantic.Field(default=None)
40
+ """
41
+ OAuth client ID
42
+ """
43
+
44
+ auth_configs: typing.Optional[typing.Dict[str, FhirProviderAuthConfig]] = pydantic.Field(default=None)
45
+ """
46
+ Map of authentication configurations (key is auth_config_id)
47
+ """
48
+
49
+ is_active: typing.Optional[bool] = pydantic.Field(default=None)
50
+ """
51
+ Whether the FHIR provider is active
52
+ """
53
+
54
+ last_updated: typing.Optional[dt.datetime] = pydantic.Field(default=None)
55
+ """
56
+ Timestamp when the provider was last updated
57
+ """
58
+
59
+ if IS_PYDANTIC_V2:
60
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
61
+ else:
62
+
63
+ class Config:
64
+ frozen = True
65
+ smart_union = True
66
+ 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
+ from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .fhir_query_response_data import FhirQueryResponseData
8
+
9
+
10
+ class FhirQueryResponse(UniversalBaseModel):
11
+ success: typing.Optional[bool] = None
12
+ status: typing.Optional[int] = pydantic.Field(default=None)
13
+ """
14
+ HTTP status code from the FHIR server response
15
+ """
16
+
17
+ message: typing.Optional[str] = None
18
+ data: typing.Optional[FhirQueryResponseData] = 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
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ FhirQueryResponseData = typing.Union[typing.Dict[str, typing.Optional[typing.Any]], str]
@@ -0,0 +1,51 @@
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 JsonWebKey(UniversalBaseModel):
10
+ """
11
+ JSON Web Key structure for RSA keys used in JWT authentication. Keys are automatically generated using RSA-2048 with RS384 signing algorithm. The Key ID (kid) is derived from a SHA256 hash of the public key PEM format.
12
+ """
13
+
14
+ kty: typing.Optional[str] = pydantic.Field(default=None)
15
+ """
16
+ Key Type
17
+ """
18
+
19
+ use: typing.Optional[str] = pydantic.Field(default=None)
20
+ """
21
+ Usage (sig for signature)
22
+ """
23
+
24
+ kid: typing.Optional[str] = pydantic.Field(default=None)
25
+ """
26
+ Key ID - SHA256 hash of the public key PEM (including headers) encoded as base64url. Generated by taking the public key in PEM format, hashing with SHA256, then base64url encoding (replacing + with -, / with _, and removing padding).
27
+ """
28
+
29
+ alg: typing.Optional[str] = pydantic.Field(default=None)
30
+ """
31
+ Algorithm used for JWT signing (RSA with SHA-384)
32
+ """
33
+
34
+ n: typing.Optional[str] = pydantic.Field(default=None)
35
+ """
36
+ RSA Modulus (base64url encoded)
37
+ """
38
+
39
+ e: typing.Optional[str] = pydantic.Field(default=None)
40
+ """
41
+ RSA Exponent (base64url encoded)
42
+ """
43
+
44
+ if IS_PYDANTIC_V2:
45
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
46
+ else:
47
+
48
+ class Config:
49
+ frozen = True
50
+ smart_union = True
51
+ extra = pydantic.Extra.allow
@@ -0,0 +1,8 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ Provider = typing.Union[
6
+ typing.Literal["athenahealth", "canvas", "cerner", "elation", "epic", "google_healthcare", "hapi", "medplum"],
7
+ typing.Any,
8
+ ]
@@ -0,0 +1,27 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ Role = typing.Union[
6
+ typing.Literal[
7
+ "SmartV1Admin",
8
+ "SmartV1Read",
9
+ "SmartV1Write",
10
+ "SmartV2Admin",
11
+ "SmartV2Read",
12
+ "SmartV2Write",
13
+ "USCDISmartV1Admin",
14
+ "USCDISmartV1Read",
15
+ "USCDISmartV1Write",
16
+ "USCDISmartV2Admin",
17
+ "USCDISmartV2Read",
18
+ "USCDISmartV2Write",
19
+ "CernerSmartV1Admin",
20
+ "CernerSmartV1Read",
21
+ "CernerSmartV1Write",
22
+ "CernerSmartV2Admin",
23
+ "CernerSmartV2Read",
24
+ "CernerSmartV2Write",
25
+ ],
26
+ typing.Any,
27
+ ]
@@ -0,0 +1,35 @@
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 ServiceAccountKey(UniversalBaseModel):
12
+ """
13
+ Google Cloud Service Account key (required for google_healthcare auth method)
14
+ """
15
+
16
+ type: str
17
+ project_id: str
18
+ private_key_id: str
19
+ private_key: str
20
+ client_email: str
21
+ client_id: str
22
+ auth_uri: str
23
+ token_uri: str
24
+ auth_provider_x509cert_url: typing_extensions.Annotated[str, FieldMetadata(alias="auth_provider_x509_cert_url")]
25
+ client_x509cert_url: typing_extensions.Annotated[str, FieldMetadata(alias="client_x509_cert_url")]
26
+ universe_domain: str
27
+
28
+ if IS_PYDANTIC_V2:
29
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
30
+ else:
31
+
32
+ class Config:
33
+ frozen = True
34
+ smart_union = True
35
+ extra = pydantic.Extra.allow
@@ -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 SmartConfiguration(UniversalBaseModel):
10
+ """
11
+ SMART on FHIR configuration for OAuth-based providers
12
+ """
13
+
14
+ authorization_endpoint: typing.Optional[str] = pydantic.Field(default=None)
15
+ """
16
+ OAuth2 authorization endpoint
17
+ """
18
+
19
+ token_endpoint: typing.Optional[str] = pydantic.Field(default=None)
20
+ """
21
+ OAuth2 token endpoint
22
+ """
23
+
24
+ issuer: typing.Optional[str] = pydantic.Field(default=None)
25
+ """
26
+ OIDC issuer URL
27
+ """
28
+
29
+ jwks_uri: typing.Optional[str] = pydantic.Field(default=None)
30
+ """
31
+ JSON Web Key Set URI
32
+ """
33
+
34
+ scopes_supported: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
35
+ """
36
+ List of supported scopes
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,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
@@ -143,9 +192,9 @@ class Lang2FhirClient:
143
192
  token="YOUR_TOKEN",
144
193
  )
145
194
  client.lang2fhir.upload_profile(
146
- version="version",
147
- resource="custom-patient",
148
- profile="profile",
195
+ version="R4",
196
+ resource="condition-encounter-diagnosis",
197
+ profile="(base64 encoded JSON string of the FHIR profile)",
149
198
  )
150
199
  """
151
200
  _response = self._raw_client.upload_profile(
@@ -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
@@ -355,9 +460,9 @@ class AsyncLang2FhirClient:
355
460
 
356
461
  async def main() -> None:
357
462
  await client.lang2fhir.upload_profile(
358
- version="version",
359
- resource="custom-patient",
360
- profile="profile",
463
+ version="R4",
464
+ resource="condition-encounter-diagnosis",
465
+ profile="(base64 encoded JSON string of the FHIR profile)",
361
466
  )
362
467
 
363
468