assured-py 0.1.0a0__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.
- assured/__init__.py +6 -0
- assured/client.py +318 -0
- assured/exceptions.py +35 -0
- assured/models/__init__.py +1 -0
- assured/models/common.py +29 -0
- assured/models/credentialing.py +106 -0
- assured/models/facilities.py +19 -0
- assured/models/files.py +55 -0
- assured/models/hospital_affiliations.py +72 -0
- assured/models/payer_enrollment.py +97 -0
- assured/models/practice_locations.py +39 -0
- assured/models/provider_profile.py +442 -0
- assured/models/providers.py +71 -0
- assured/models/tasks.py +86 -0
- assured/models/tax_entities.py +25 -0
- assured/models/users.py +37 -0
- assured/resources/__init__.py +1 -0
- assured/resources/account.py +24 -0
- assured/resources/credentialing.py +60 -0
- assured/resources/facilities.py +39 -0
- assured/resources/files.py +67 -0
- assured/resources/hospital_affiliations.py +133 -0
- assured/resources/payer_enrollment.py +131 -0
- assured/resources/practice_locations.py +52 -0
- assured/resources/provider_profile.py +460 -0
- assured/resources/providers.py +134 -0
- assured/resources/tasks.py +90 -0
- assured/resources/tax_entities.py +48 -0
- assured/resources/users.py +81 -0
- assured/settings.py +57 -0
- assured_py-0.1.0a0.dist-info/METADATA +105 -0
- assured_py-0.1.0a0.dist-info/RECORD +33 -0
- assured_py-0.1.0a0.dist-info/WHEEL +4 -0
assured/__init__.py
ADDED
assured/client.py
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"""Core async HTTP client for the Assured Platform API."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
import logging
|
|
7
|
+
from typing import TYPE_CHECKING, Any
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
import pandas as pd
|
|
11
|
+
|
|
12
|
+
from assured.exceptions import (
|
|
13
|
+
AssuredAPIError,
|
|
14
|
+
AssuredAuthError,
|
|
15
|
+
AssuredNotFoundError,
|
|
16
|
+
AssuredRateLimitError,
|
|
17
|
+
AssuredValidationError,
|
|
18
|
+
)
|
|
19
|
+
from assured.settings import Settings
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from assured.resources.account import AccountResource
|
|
23
|
+
from assured.resources.credentialing import CredentialingResource
|
|
24
|
+
from assured.resources.facilities import FacilitiesResource
|
|
25
|
+
from assured.resources.files import FilesResource
|
|
26
|
+
from assured.resources.hospital_affiliations import HospitalAffiliationsResource
|
|
27
|
+
from assured.resources.payer_enrollment import PayerEnrollmentResource
|
|
28
|
+
from assured.resources.practice_locations import PracticeLocationsResource
|
|
29
|
+
from assured.resources.provider_profile import ProviderProfileResource
|
|
30
|
+
from assured.resources.providers import ProvidersResource
|
|
31
|
+
from assured.resources.tasks import TasksResource
|
|
32
|
+
from assured.resources.tax_entities import TaxEntitiesResource
|
|
33
|
+
from assured.resources.users import UsersResource
|
|
34
|
+
|
|
35
|
+
logger = logging.getLogger("assured")
|
|
36
|
+
|
|
37
|
+
_RETRY_STATUS_CODES = frozenset({429, 500, 502, 503, 504})
|
|
38
|
+
_MAX_RETRIES = 3
|
|
39
|
+
_BACKOFF_BASE = 0.5 # seconds
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class AssuredClient:
|
|
43
|
+
"""Async-first client for the Assured Platform API.
|
|
44
|
+
|
|
45
|
+
Usage::
|
|
46
|
+
|
|
47
|
+
async with AssuredClient() as client:
|
|
48
|
+
users = await client.users.list()
|
|
49
|
+
|
|
50
|
+
Or with explicit settings::
|
|
51
|
+
|
|
52
|
+
settings = Settings(base_url="https://...", api_key="sk-...")
|
|
53
|
+
async with AssuredClient(settings=settings) as client:
|
|
54
|
+
...
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
def __init__(self, *, settings: Settings | None = None) -> None:
|
|
58
|
+
self.settings = settings or Settings()
|
|
59
|
+
self._http: httpx.AsyncClient | None = None
|
|
60
|
+
self._jwt_cache: str | None = None
|
|
61
|
+
|
|
62
|
+
# Lazy-initialised resource helpers (cached on first access).
|
|
63
|
+
self._users: UsersResource | None = None
|
|
64
|
+
self._providers: ProvidersResource | None = None
|
|
65
|
+
self._credentialing: CredentialingResource | None = None
|
|
66
|
+
self._tasks: TasksResource | None = None
|
|
67
|
+
self._provider_profile: ProviderProfileResource | None = None
|
|
68
|
+
self._practice_locations: PracticeLocationsResource | None = None
|
|
69
|
+
self._tax_entities: TaxEntitiesResource | None = None
|
|
70
|
+
self._facilities: FacilitiesResource | None = None
|
|
71
|
+
self._payer_enrollment: PayerEnrollmentResource | None = None
|
|
72
|
+
self._hospital_affiliations: HospitalAffiliationsResource | None = None
|
|
73
|
+
self._account: AccountResource | None = None
|
|
74
|
+
self._files: FilesResource | None = None
|
|
75
|
+
|
|
76
|
+
# ------------------------------------------------------------------
|
|
77
|
+
# Context-manager
|
|
78
|
+
# ------------------------------------------------------------------
|
|
79
|
+
|
|
80
|
+
async def __aenter__(self) -> AssuredClient:
|
|
81
|
+
self._http = httpx.AsyncClient(
|
|
82
|
+
base_url=self.settings.base_url.rstrip("/"),
|
|
83
|
+
headers={"x-api-key": self.settings.api_key},
|
|
84
|
+
timeout=httpx.Timeout(30.0),
|
|
85
|
+
)
|
|
86
|
+
return self
|
|
87
|
+
|
|
88
|
+
async def __aexit__(self, *exc: object) -> None:
|
|
89
|
+
if self._http:
|
|
90
|
+
await self._http.aclose()
|
|
91
|
+
self._http = None
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def http(self) -> httpx.AsyncClient:
|
|
95
|
+
if self._http is None:
|
|
96
|
+
msg = "Client not initialised — use `async with AssuredClient() as client:`"
|
|
97
|
+
raise RuntimeError(msg)
|
|
98
|
+
return self._http
|
|
99
|
+
|
|
100
|
+
# ------------------------------------------------------------------
|
|
101
|
+
# Resource properties
|
|
102
|
+
# ------------------------------------------------------------------
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def users(self) -> UsersResource:
|
|
106
|
+
if self._users is None:
|
|
107
|
+
from assured.resources.users import UsersResource
|
|
108
|
+
|
|
109
|
+
self._users = UsersResource(self)
|
|
110
|
+
return self._users
|
|
111
|
+
|
|
112
|
+
@property
|
|
113
|
+
def providers(self) -> ProvidersResource:
|
|
114
|
+
if self._providers is None:
|
|
115
|
+
from assured.resources.providers import ProvidersResource
|
|
116
|
+
|
|
117
|
+
self._providers = ProvidersResource(self)
|
|
118
|
+
return self._providers
|
|
119
|
+
|
|
120
|
+
@property
|
|
121
|
+
def credentialing(self) -> CredentialingResource:
|
|
122
|
+
if self._credentialing is None:
|
|
123
|
+
from assured.resources.credentialing import CredentialingResource
|
|
124
|
+
|
|
125
|
+
self._credentialing = CredentialingResource(self)
|
|
126
|
+
return self._credentialing
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def tasks(self) -> TasksResource:
|
|
130
|
+
if self._tasks is None:
|
|
131
|
+
from assured.resources.tasks import TasksResource
|
|
132
|
+
|
|
133
|
+
self._tasks = TasksResource(self)
|
|
134
|
+
return self._tasks
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def provider_profile(self) -> ProviderProfileResource:
|
|
138
|
+
if self._provider_profile is None:
|
|
139
|
+
from assured.resources.provider_profile import ProviderProfileResource
|
|
140
|
+
|
|
141
|
+
self._provider_profile = ProviderProfileResource(self)
|
|
142
|
+
return self._provider_profile
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def practice_locations(self) -> PracticeLocationsResource:
|
|
146
|
+
if self._practice_locations is None:
|
|
147
|
+
from assured.resources.practice_locations import PracticeLocationsResource
|
|
148
|
+
|
|
149
|
+
self._practice_locations = PracticeLocationsResource(self)
|
|
150
|
+
return self._practice_locations
|
|
151
|
+
|
|
152
|
+
@property
|
|
153
|
+
def tax_entities(self) -> TaxEntitiesResource:
|
|
154
|
+
if self._tax_entities is None:
|
|
155
|
+
from assured.resources.tax_entities import TaxEntitiesResource
|
|
156
|
+
|
|
157
|
+
self._tax_entities = TaxEntitiesResource(self)
|
|
158
|
+
return self._tax_entities
|
|
159
|
+
|
|
160
|
+
@property
|
|
161
|
+
def facilities(self) -> FacilitiesResource:
|
|
162
|
+
if self._facilities is None:
|
|
163
|
+
from assured.resources.facilities import FacilitiesResource
|
|
164
|
+
|
|
165
|
+
self._facilities = FacilitiesResource(self)
|
|
166
|
+
return self._facilities
|
|
167
|
+
|
|
168
|
+
@property
|
|
169
|
+
def payer_enrollment(self) -> PayerEnrollmentResource:
|
|
170
|
+
if self._payer_enrollment is None:
|
|
171
|
+
from assured.resources.payer_enrollment import PayerEnrollmentResource
|
|
172
|
+
|
|
173
|
+
self._payer_enrollment = PayerEnrollmentResource(self)
|
|
174
|
+
return self._payer_enrollment
|
|
175
|
+
|
|
176
|
+
@property
|
|
177
|
+
def hospital_affiliations(self) -> HospitalAffiliationsResource:
|
|
178
|
+
if self._hospital_affiliations is None:
|
|
179
|
+
from assured.resources.hospital_affiliations import HospitalAffiliationsResource
|
|
180
|
+
|
|
181
|
+
self._hospital_affiliations = HospitalAffiliationsResource(self)
|
|
182
|
+
return self._hospital_affiliations
|
|
183
|
+
|
|
184
|
+
@property
|
|
185
|
+
def account(self) -> AccountResource:
|
|
186
|
+
if self._account is None:
|
|
187
|
+
from assured.resources.account import AccountResource
|
|
188
|
+
|
|
189
|
+
self._account = AccountResource(self)
|
|
190
|
+
return self._account
|
|
191
|
+
|
|
192
|
+
@property
|
|
193
|
+
def files(self) -> FilesResource:
|
|
194
|
+
if self._files is None:
|
|
195
|
+
from assured.resources.files import FilesResource
|
|
196
|
+
|
|
197
|
+
self._files = FilesResource(self)
|
|
198
|
+
return self._files
|
|
199
|
+
|
|
200
|
+
# ------------------------------------------------------------------
|
|
201
|
+
# Low-level HTTP helpers (with retry)
|
|
202
|
+
# ------------------------------------------------------------------
|
|
203
|
+
|
|
204
|
+
async def _get_jwt(self) -> str:
|
|
205
|
+
"""Fetch and cache a session JWT using credentials from settings."""
|
|
206
|
+
if self._jwt_cache is None:
|
|
207
|
+
if not self.settings.user or not self.settings.password:
|
|
208
|
+
msg = "ASSURED_USER and ASSURED_PASS environment variables are required for JWT-based endpoints."
|
|
209
|
+
raise RuntimeError(msg)
|
|
210
|
+
self._jwt_cache = await self.users.login(self.settings.user, self.settings.password)
|
|
211
|
+
return self._jwt_cache
|
|
212
|
+
|
|
213
|
+
async def _request(self, method: str, path: str, *, requires_jwt: bool = False, **kwargs: Any) -> httpx.Response:
|
|
214
|
+
"""Execute an HTTP request with automatic retry & backoff."""
|
|
215
|
+
if requires_jwt:
|
|
216
|
+
jwt = await self._get_jwt()
|
|
217
|
+
headers = kwargs.pop("headers", {}) or {}
|
|
218
|
+
headers["Authorization"] = f"Bearer {jwt}"
|
|
219
|
+
kwargs["headers"] = headers
|
|
220
|
+
|
|
221
|
+
last_resp: httpx.Response | None = None
|
|
222
|
+
for attempt in range(_MAX_RETRIES + 1):
|
|
223
|
+
resp = await self.http.request(method, path, **kwargs)
|
|
224
|
+
if resp.status_code not in _RETRY_STATUS_CODES or attempt == _MAX_RETRIES:
|
|
225
|
+
last_resp = resp
|
|
226
|
+
break
|
|
227
|
+
wait = _BACKOFF_BASE * (2**attempt)
|
|
228
|
+
logger.warning(
|
|
229
|
+
"Retrying %s %s (status %d, attempt %d, wait %.1fs)", method, path, resp.status_code, attempt + 1, wait
|
|
230
|
+
)
|
|
231
|
+
await asyncio.sleep(wait)
|
|
232
|
+
last_resp = resp
|
|
233
|
+
|
|
234
|
+
assert last_resp is not None
|
|
235
|
+
return last_resp
|
|
236
|
+
|
|
237
|
+
def _raise_for_status(self, resp: httpx.Response) -> None:
|
|
238
|
+
"""Raise a typed exception for error status codes."""
|
|
239
|
+
if resp.is_success:
|
|
240
|
+
return
|
|
241
|
+
try:
|
|
242
|
+
detail = resp.json()
|
|
243
|
+
except Exception:
|
|
244
|
+
detail = resp.text
|
|
245
|
+
|
|
246
|
+
url = str(resp.url)
|
|
247
|
+
match resp.status_code:
|
|
248
|
+
case 400:
|
|
249
|
+
raise AssuredValidationError(resp.status_code, detail, url=url)
|
|
250
|
+
case 401:
|
|
251
|
+
raise AssuredAuthError(resp.status_code, detail, url=url)
|
|
252
|
+
case 404:
|
|
253
|
+
raise AssuredNotFoundError(resp.status_code, detail, url=url)
|
|
254
|
+
case 429:
|
|
255
|
+
raise AssuredRateLimitError(resp.status_code, detail, url=url)
|
|
256
|
+
case _:
|
|
257
|
+
raise AssuredAPIError(resp.status_code, detail, url=url)
|
|
258
|
+
|
|
259
|
+
async def _get(
|
|
260
|
+
self, path: str, *, params: dict[str, Any] | None = None, requires_jwt: bool = False
|
|
261
|
+
) -> dict[str, Any]:
|
|
262
|
+
resp = await self._request("GET", path, params=_clean_params(params), requires_jwt=requires_jwt)
|
|
263
|
+
self._raise_for_status(resp)
|
|
264
|
+
return resp.json()
|
|
265
|
+
|
|
266
|
+
async def _post(
|
|
267
|
+
self, path: str, *, json: Any = None, data: Any = None, files: Any = None, requires_jwt: bool = False
|
|
268
|
+
) -> dict[str, Any]:
|
|
269
|
+
resp = await self._request("POST", path, json=json, data=data, files=files, requires_jwt=requires_jwt)
|
|
270
|
+
self._raise_for_status(resp)
|
|
271
|
+
return resp.json()
|
|
272
|
+
|
|
273
|
+
async def _patch(self, path: str, *, json: Any = None, requires_jwt: bool = False) -> dict[str, Any]:
|
|
274
|
+
resp = await self._request("PATCH", path, json=json, requires_jwt=requires_jwt)
|
|
275
|
+
self._raise_for_status(resp)
|
|
276
|
+
return resp.json()
|
|
277
|
+
|
|
278
|
+
# ------------------------------------------------------------------
|
|
279
|
+
# Pagination helpers
|
|
280
|
+
# ------------------------------------------------------------------
|
|
281
|
+
|
|
282
|
+
async def _get_all_pages(self, path: str, *, params: dict[str, Any] | None = None) -> list[dict[str, Any]]:
|
|
283
|
+
"""Fetch every page and return all ``results`` concatenated."""
|
|
284
|
+
all_results: list[dict[str, Any]] = []
|
|
285
|
+
params = dict(params or {})
|
|
286
|
+
while True:
|
|
287
|
+
data = await self._get(path, params=params)
|
|
288
|
+
all_results.extend(data.get("results", []))
|
|
289
|
+
next_url = data.get("next")
|
|
290
|
+
if not next_url:
|
|
291
|
+
break
|
|
292
|
+
# The API returns absolute next URLs — extract offset/limit.
|
|
293
|
+
parsed = httpx.URL(next_url)
|
|
294
|
+
params["offset"] = parsed.params.get("offset", "0")
|
|
295
|
+
if limit_val := parsed.params.get("limit"):
|
|
296
|
+
params["limit"] = limit_val
|
|
297
|
+
return all_results
|
|
298
|
+
|
|
299
|
+
async def _get_page(self, path: str, *, params: dict[str, Any] | None = None) -> dict[str, Any]:
|
|
300
|
+
"""Fetch a single page and return the raw paginated response dict."""
|
|
301
|
+
return await self._get(path, params=params)
|
|
302
|
+
|
|
303
|
+
@staticmethod
|
|
304
|
+
def to_dataframe(records: list[dict[str, Any]]) -> pd.DataFrame:
|
|
305
|
+
"""Convert a list of flat dicts to a pandas DataFrame."""
|
|
306
|
+
return pd.json_normalize(records) if records else pd.DataFrame()
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
# ------------------------------------------------------------------
|
|
310
|
+
# Utility
|
|
311
|
+
# ------------------------------------------------------------------
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def _clean_params(params: dict[str, Any] | None) -> dict[str, Any] | None:
|
|
315
|
+
"""Strip ``None`` values from query parameters."""
|
|
316
|
+
if params is None:
|
|
317
|
+
return None
|
|
318
|
+
return {k: v for k, v in params.items() if v is not None}
|
assured/exceptions.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Custom exception hierarchy for Assured API errors."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AssuredError(Exception):
|
|
9
|
+
"""Base exception for all Assured SDK errors."""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AssuredAPIError(AssuredError):
|
|
13
|
+
"""Raised when the API returns a non-success HTTP status."""
|
|
14
|
+
|
|
15
|
+
def __init__(self, status_code: int, detail: Any = None, *, url: str = "") -> None:
|
|
16
|
+
self.status_code = status_code
|
|
17
|
+
self.detail = detail
|
|
18
|
+
self.url = url
|
|
19
|
+
super().__init__(f"HTTP {status_code} from {url}: {detail}")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AssuredAuthError(AssuredAPIError):
|
|
23
|
+
"""Raised on HTTP 401 — invalid or missing API key."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class AssuredNotFoundError(AssuredAPIError):
|
|
27
|
+
"""Raised on HTTP 404 — resource not found."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AssuredValidationError(AssuredAPIError):
|
|
31
|
+
"""Raised on HTTP 400 — bad request / validation failure."""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class AssuredRateLimitError(AssuredAPIError):
|
|
35
|
+
"""Raised on HTTP 429 — rate limited (after retries exhausted)."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Assured SDK — Pydantic models package."""
|
assured/models/common.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Shared / generic model types."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class PaginatedResponse[T](BaseModel):
|
|
9
|
+
"""Standard Assured paginated list envelope."""
|
|
10
|
+
|
|
11
|
+
count: int = 0
|
|
12
|
+
next: str | None = None
|
|
13
|
+
previous: str | None = None
|
|
14
|
+
results: list[T] = []
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ClientDetails(BaseModel):
|
|
18
|
+
"""Nested client info returned in several endpoints."""
|
|
19
|
+
|
|
20
|
+
id: str | None = None
|
|
21
|
+
name: str | None = None
|
|
22
|
+
sop_file: str | None = None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SignoffAllowed(BaseModel):
|
|
26
|
+
"""Credentialing sign-off permission check."""
|
|
27
|
+
|
|
28
|
+
value: bool = False
|
|
29
|
+
msg: str | None = None
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""Credentialing models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
|
|
9
|
+
from assured.models.common import ClientDetails, SignoffAllowed
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ProviderDetails(BaseModel):
|
|
13
|
+
"""Nested provider info in credentialing responses."""
|
|
14
|
+
|
|
15
|
+
id: str | None = None
|
|
16
|
+
email: str | None = None
|
|
17
|
+
first_name: str | None = None
|
|
18
|
+
last_name: str | None = None
|
|
19
|
+
user_type: str | None = None
|
|
20
|
+
is_active: bool | None = None
|
|
21
|
+
provider_profile_id: str | None = None
|
|
22
|
+
individual_npi: str | None = None
|
|
23
|
+
provider_type: str | None = None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class CredentialingRequestCreate(BaseModel):
|
|
27
|
+
"""Payload to create a credentialing request."""
|
|
28
|
+
|
|
29
|
+
provider: str
|
|
30
|
+
credentialing_type: str = "INITIAL_CREDENTIALING"
|
|
31
|
+
state_codes: list[str] | None = None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class CredentialingRequest(BaseModel):
|
|
35
|
+
"""A credentialing request as returned by the list endpoint."""
|
|
36
|
+
|
|
37
|
+
id: str | None = None
|
|
38
|
+
provider_details: ProviderDetails | None = None
|
|
39
|
+
client_details: ClientDetails | None = None
|
|
40
|
+
state_codes: list[str] | None = None
|
|
41
|
+
assignee: str | None = None
|
|
42
|
+
credentialing_type: str | None = None
|
|
43
|
+
request_completed_at: datetime | None = None
|
|
44
|
+
oa_completed_at: datetime | None = None
|
|
45
|
+
automation_status: str | None = None
|
|
46
|
+
status: str | None = None
|
|
47
|
+
created_at: datetime | None = None
|
|
48
|
+
updated_at: datetime | None = None
|
|
49
|
+
request_id: str | None = None
|
|
50
|
+
attestation_url: str | None = None
|
|
51
|
+
attestation_url_presigned: str | None = None
|
|
52
|
+
request_type: str | None = None
|
|
53
|
+
verifier_signed_off: bool | None = None
|
|
54
|
+
is_signoff_allowed: SignoffAllowed | None = None
|
|
55
|
+
assigned_at: datetime | None = None
|
|
56
|
+
assignee_email: str | None = None
|
|
57
|
+
assignee_full_name: str | None = None
|
|
58
|
+
requested_by_full_name: str | None = None
|
|
59
|
+
requested_by: str | None = None
|
|
60
|
+
approval_date: str | None = None
|
|
61
|
+
approver_name: str | None = None
|
|
62
|
+
request_closed_by: str | None = None
|
|
63
|
+
sla_days: int | None = None
|
|
64
|
+
re_credentialing_date: str | None = None
|
|
65
|
+
reason_for_termination: str | None = None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class CredentialingRequestDetail(CredentialingRequest):
|
|
69
|
+
"""Detailed credentialing request (same fields, returned by detail endpoint)."""
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class CredentialingListParams(BaseModel):
|
|
73
|
+
"""Query parameters for the credentialing request list."""
|
|
74
|
+
|
|
75
|
+
assigned_at_after: datetime | None = None
|
|
76
|
+
assigned_at_before: datetime | None = None
|
|
77
|
+
assignee: str | None = None
|
|
78
|
+
assignee_in: str | None = None
|
|
79
|
+
automation_status: str | None = None
|
|
80
|
+
client_ids: str | None = None
|
|
81
|
+
created_at_after: datetime | None = None
|
|
82
|
+
created_at_before: datetime | None = None
|
|
83
|
+
created_at_month: str | None = None
|
|
84
|
+
credentialing_type: str | None = None
|
|
85
|
+
individual_npis: str | None = None
|
|
86
|
+
limit: int | None = None
|
|
87
|
+
oa_completed_at_after: datetime | None = None
|
|
88
|
+
oa_completed_at_before: datetime | None = None
|
|
89
|
+
offset: int | None = None
|
|
90
|
+
ordering: str | None = None
|
|
91
|
+
provider: str | None = None
|
|
92
|
+
provider_in: str | None = None
|
|
93
|
+
provider_type: str | None = None
|
|
94
|
+
request_completed_at_after: datetime | None = None
|
|
95
|
+
request_completed_at_before: datetime | None = None
|
|
96
|
+
request_type: str | None = None
|
|
97
|
+
requested_by: str | None = None
|
|
98
|
+
requested_by_in: str | None = None
|
|
99
|
+
search: str | None = None
|
|
100
|
+
state_codes_in: str | None = None
|
|
101
|
+
status: str | None = None
|
|
102
|
+
status_in: str | None = None
|
|
103
|
+
tab: str | None = None
|
|
104
|
+
updated_at_after: datetime | None = None
|
|
105
|
+
updated_at_before: datetime | None = None
|
|
106
|
+
verifier_signed_off: bool | None = None
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Facility models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FacilityProfile(BaseModel):
|
|
9
|
+
id: str | None = None
|
|
10
|
+
name: str | None = None
|
|
11
|
+
facility_type: str | None = None
|
|
12
|
+
status: str | None = None
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class FacilityListParams(BaseModel):
|
|
16
|
+
limit: int | None = None
|
|
17
|
+
offset: int | None = None
|
|
18
|
+
search: str | None = None
|
|
19
|
+
ordering: str | None = None
|
assured/models/files.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""File handling models."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class StorageMetadata(BaseModel):
|
|
10
|
+
model_config = ConfigDict(extra="ignore")
|
|
11
|
+
|
|
12
|
+
storage_backend: str | None = None
|
|
13
|
+
storage_backend_class: str | None = None
|
|
14
|
+
bucket_name: str | None = None
|
|
15
|
+
region: str | None = None
|
|
16
|
+
endpoint_url: str | None = None
|
|
17
|
+
custom_domain: str | None = None
|
|
18
|
+
credential_profile: str | None = None
|
|
19
|
+
media_root: str | None = None
|
|
20
|
+
use_s3_for_media: bool | None = None
|
|
21
|
+
acl: str | None = None
|
|
22
|
+
signature_version: str | None = None
|
|
23
|
+
file_overwrite: bool | None = None
|
|
24
|
+
querystring_auth: bool | None = None
|
|
25
|
+
object_parameters: dict[str, Any] | None = None
|
|
26
|
+
original_filename: str | None = None
|
|
27
|
+
content_type: str | None = None
|
|
28
|
+
file_size_bytes: int | None = None
|
|
29
|
+
upload_path: str | None = None
|
|
30
|
+
uploaded_by_user_id: str | None = None
|
|
31
|
+
uploaded_by_client_id: str | None = None
|
|
32
|
+
s3_object_url: str | None = None
|
|
33
|
+
s3_uri: str | None = None
|
|
34
|
+
django_env: str | None = None
|
|
35
|
+
debug_mode: bool | None = None
|
|
36
|
+
uploaded_file_url: str | None = None
|
|
37
|
+
uploaded_file_uri: str | None = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class FileRecord(BaseModel):
|
|
41
|
+
model_config = ConfigDict(extra="ignore")
|
|
42
|
+
|
|
43
|
+
id: str
|
|
44
|
+
file: str | None = None
|
|
45
|
+
file_url: str | None = None
|
|
46
|
+
name: str | None = None
|
|
47
|
+
created_at: datetime | None = None
|
|
48
|
+
storage_metadata: StorageMetadata | None = None
|
|
49
|
+
uploaded_file_uri: str | None = None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class PresignedUrlResponse(BaseModel):
|
|
53
|
+
model_config = ConfigDict(extra="ignore")
|
|
54
|
+
|
|
55
|
+
presigned_url: str
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Hospital affiliation models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
# ---- Admitting Arrangements ----
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AdmittingArrangement(BaseModel):
|
|
11
|
+
id: str | None = None
|
|
12
|
+
hospital_name: str | None = None
|
|
13
|
+
arrangement_type: str | None = None
|
|
14
|
+
start_date: str | None = None
|
|
15
|
+
end_date: str | None = None
|
|
16
|
+
provider: str | None = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AdmittingArrangementCreate(BaseModel):
|
|
20
|
+
provider: str
|
|
21
|
+
hospital_name: str | None = None
|
|
22
|
+
arrangement_type: str | None = None
|
|
23
|
+
start_date: str | None = None
|
|
24
|
+
end_date: str | None = None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# ---- Admitting Privileges ----
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AdmittingPrivilege(BaseModel):
|
|
31
|
+
id: str | None = None
|
|
32
|
+
hospital_name: str | None = None
|
|
33
|
+
privilege_type: str | None = None
|
|
34
|
+
status: str | None = None
|
|
35
|
+
start_date: str | None = None
|
|
36
|
+
end_date: str | None = None
|
|
37
|
+
provider: str | None = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class AdmittingPrivilegeCreate(BaseModel):
|
|
41
|
+
provider: str
|
|
42
|
+
hospital_name: str | None = None
|
|
43
|
+
privilege_type: str | None = None
|
|
44
|
+
status: str | None = None
|
|
45
|
+
start_date: str | None = None
|
|
46
|
+
end_date: str | None = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# ---- Non-Admitting Affiliations ----
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class NonAdmittingAffiliation(BaseModel):
|
|
53
|
+
id: str | None = None
|
|
54
|
+
hospital_name: str | None = None
|
|
55
|
+
affiliation_type: str | None = None
|
|
56
|
+
start_date: str | None = None
|
|
57
|
+
end_date: str | None = None
|
|
58
|
+
provider: str | None = None
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class NonAdmittingAffiliationCreate(BaseModel):
|
|
62
|
+
provider: str
|
|
63
|
+
hospital_name: str | None = None
|
|
64
|
+
affiliation_type: str | None = None
|
|
65
|
+
start_date: str | None = None
|
|
66
|
+
end_date: str | None = None
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class HospitalAffiliationListParams(BaseModel):
|
|
70
|
+
limit: int | None = None
|
|
71
|
+
offset: int | None = None
|
|
72
|
+
provider: str | None = None
|