Skip to content

Commit

Permalink
Release 2.1.153
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 20, 2024
1 parent ac8abe5 commit ddcb2b8
Show file tree
Hide file tree
Showing 8 changed files with 268 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vital"
version = "2.1.152"
version = "2.1.153"
description = ""
readme = "README.md"
authors = []
Expand Down
70 changes: 70 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12872,6 +12872,76 @@ client.testkit.create_order(
</details>

## Insurance
<details><summary><code>client.insurance.<a href="src/vital/insurance/client.py">search_get_payor_info</a>(...)</code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from vital import Vital

client = Vital(
api_key="YOUR_API_KEY",
)
client.insurance.search_get_payor_info()

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**insurance_name:** `typing.Optional[str]`

</dd>
</dl>

<dl>
<dd>

**provider:** `typing.Optional[PayorCodeExternalProvider]`

</dd>
</dl>

<dl>
<dd>

**provider_payor_id:** `typing.Optional[str]`

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.insurance.<a href="src/vital/insurance/client.py">search_payor_info</a>(...)</code></summary>
<dl>
<dd>
Expand Down
2 changes: 2 additions & 0 deletions src/vital/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
ClientFacingOrderEvent,
ClientFacingPatientDetailsCompatible,
ClientFacingPayorSearchResponse,
ClientFacingPayorSearchResponseDeprecated,
ClientFacingPhysician,
ClientFacingProfile,
ClientFacingProvider,
Expand Down Expand Up @@ -535,6 +536,7 @@
"ClientFacingOrderEvent",
"ClientFacingPatientDetailsCompatible",
"ClientFacingPayorSearchResponse",
"ClientFacingPayorSearchResponseDeprecated",
"ClientFacingPhysician",
"ClientFacingProfile",
"ClientFacingProvider",
Expand Down
2 changes: 1 addition & 1 deletion src/vital/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "vital",
"X-Fern-SDK-Version": "2.1.152",
"X-Fern-SDK-Version": "2.1.153",
}
headers["x-vital-api-key"] = self.api_key
return headers
Expand Down
161 changes: 153 additions & 8 deletions src/vital/insurance/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ..types.http_validation_error import HttpValidationError
from json.decoder import JSONDecodeError
from ..core.api_error import ApiError
from ..types.client_facing_payor_search_response_deprecated import ClientFacingPayorSearchResponseDeprecated
from ..types.client_facing_diagnosis_information import ClientFacingDiagnosisInformation
from ..core.client_wrapper import AsyncClientWrapper

Expand All @@ -21,14 +22,82 @@ class InsuranceClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper

def search_get_payor_info(
self,
*,
insurance_name: typing.Optional[str] = None,
provider: typing.Optional[PayorCodeExternalProvider] = None,
provider_payor_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.List[ClientFacingPayorSearchResponse]:
"""
Parameters
----------
insurance_name : typing.Optional[str]
provider : typing.Optional[PayorCodeExternalProvider]
provider_payor_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[ClientFacingPayorSearchResponse]
Successful Response
Examples
--------
from vital import Vital
client = Vital(
api_key="YOUR_API_KEY",
)
client.insurance.search_get_payor_info()
"""
_response = self._client_wrapper.httpx_client.request(
"v3/insurance/search/payor",
method="GET",
params={
"insurance_name": insurance_name,
"provider": provider,
"provider_payor_id": provider_payor_id,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
return typing.cast(
typing.List[ClientFacingPayorSearchResponse],
parse_obj_as(
type_=typing.List[ClientFacingPayorSearchResponse], # type: ignore
object_=_response.json(),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
typing.cast(
HttpValidationError,
parse_obj_as(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
)
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def search_payor_info(
self,
*,
insurance_name: typing.Optional[str] = OMIT,
provider: typing.Optional[PayorCodeExternalProvider] = OMIT,
provider_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.List[ClientFacingPayorSearchResponse]:
) -> typing.List[ClientFacingPayorSearchResponseDeprecated]:
"""
Parameters
----------
Expand All @@ -43,7 +112,7 @@ def search_payor_info(
Returns
-------
typing.List[ClientFacingPayorSearchResponse]
typing.List[ClientFacingPayorSearchResponseDeprecated]
Successful Response
Examples
Expand All @@ -69,9 +138,9 @@ def search_payor_info(
try:
if 200 <= _response.status_code < 300:
return typing.cast(
typing.List[ClientFacingPayorSearchResponse],
typing.List[ClientFacingPayorSearchResponseDeprecated],
parse_obj_as(
type_=typing.List[ClientFacingPayorSearchResponse], # type: ignore
type_=typing.List[ClientFacingPayorSearchResponseDeprecated], # type: ignore
object_=_response.json(),
),
)
Expand Down Expand Up @@ -154,14 +223,90 @@ class AsyncInsuranceClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper

async def search_get_payor_info(
self,
*,
insurance_name: typing.Optional[str] = None,
provider: typing.Optional[PayorCodeExternalProvider] = None,
provider_payor_id: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.List[ClientFacingPayorSearchResponse]:
"""
Parameters
----------
insurance_name : typing.Optional[str]
provider : typing.Optional[PayorCodeExternalProvider]
provider_payor_id : typing.Optional[str]
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[ClientFacingPayorSearchResponse]
Successful Response
Examples
--------
import asyncio
from vital import AsyncVital
client = AsyncVital(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.insurance.search_get_payor_info()
asyncio.run(main())
"""
_response = await self._client_wrapper.httpx_client.request(
"v3/insurance/search/payor",
method="GET",
params={
"insurance_name": insurance_name,
"provider": provider,
"provider_payor_id": provider_payor_id,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
return typing.cast(
typing.List[ClientFacingPayorSearchResponse],
parse_obj_as(
type_=typing.List[ClientFacingPayorSearchResponse], # type: ignore
object_=_response.json(),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
typing.cast(
HttpValidationError,
parse_obj_as(
type_=HttpValidationError, # type: ignore
object_=_response.json(),
),
)
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def search_payor_info(
self,
*,
insurance_name: typing.Optional[str] = OMIT,
provider: typing.Optional[PayorCodeExternalProvider] = OMIT,
provider_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> typing.List[ClientFacingPayorSearchResponse]:
) -> typing.List[ClientFacingPayorSearchResponseDeprecated]:
"""
Parameters
----------
Expand All @@ -176,7 +321,7 @@ async def search_payor_info(
Returns
-------
typing.List[ClientFacingPayorSearchResponse]
typing.List[ClientFacingPayorSearchResponseDeprecated]
Successful Response
Examples
Expand Down Expand Up @@ -210,9 +355,9 @@ async def main() -> None:
try:
if 200 <= _response.status_code < 300:
return typing.cast(
typing.List[ClientFacingPayorSearchResponse],
typing.List[ClientFacingPayorSearchResponseDeprecated],
parse_obj_as(
type_=typing.List[ClientFacingPayorSearchResponse], # type: ignore
type_=typing.List[ClientFacingPayorSearchResponseDeprecated], # type: ignore
object_=_response.json(),
),
)
Expand Down
2 changes: 2 additions & 0 deletions src/vital/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
from .client_facing_order_event import ClientFacingOrderEvent
from .client_facing_patient_details_compatible import ClientFacingPatientDetailsCompatible
from .client_facing_payor_search_response import ClientFacingPayorSearchResponse
from .client_facing_payor_search_response_deprecated import ClientFacingPayorSearchResponseDeprecated
from .client_facing_physician import ClientFacingPhysician
from .client_facing_profile import ClientFacingProfile
from .client_facing_provider import ClientFacingProvider
Expand Down Expand Up @@ -541,6 +542,7 @@
"ClientFacingOrderEvent",
"ClientFacingPatientDetailsCompatible",
"ClientFacingPayorSearchResponse",
"ClientFacingPayorSearchResponseDeprecated",
"ClientFacingPhysician",
"ClientFacingProfile",
"ClientFacingProvider",
Expand Down
2 changes: 1 addition & 1 deletion src/vital/types/client_facing_payor_search_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class ClientFacingPayorSearchResponse(UniversalBaseModel):
code: str = pydantic.Field()
payor_code: str = pydantic.Field()
"""
Payor code returned for the insurance information.
"""
Expand Down
38 changes: 38 additions & 0 deletions src/vital/types/client_facing_payor_search_response_deprecated.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file was auto-generated by Fern from our API Definition.

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .address import Address
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ClientFacingPayorSearchResponseDeprecated(UniversalBaseModel):
code: str = pydantic.Field()
"""
Payor code returned for the insurance information.
"""

name: str = pydantic.Field()
"""
Insurance name returned for the insurance information.
"""

aliases: typing.List[str] = pydantic.Field()
"""
Insurance name aliases returned for the insurance information.
"""

org_address: Address = pydantic.Field()
"""
Insurance business address returned for the insurance information.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:

class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow

0 comments on commit ddcb2b8

Please sign in to comment.