samplehc 0.9.0__py3-none-any.whl → 0.11.0__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 (101) hide show
  1. samplehc/_base_client.py +3 -3
  2. samplehc/_compat.py +48 -48
  3. samplehc/_models.py +41 -41
  4. samplehc/_types.py +35 -1
  5. samplehc/_utils/__init__.py +9 -2
  6. samplehc/_utils/_compat.py +45 -0
  7. samplehc/_utils/_datetime_parse.py +136 -0
  8. samplehc/_utils/_transform.py +11 -1
  9. samplehc/_utils/_typing.py +6 -1
  10. samplehc/_utils/_utils.py +0 -1
  11. samplehc/_version.py +1 -1
  12. samplehc/resources/v2/browser_agents/__init__.py +33 -0
  13. samplehc/resources/v2/{browser_agents.py → browser_agents/browser_agents.py} +40 -8
  14. samplehc/resources/v2/browser_agents/runs/__init__.py +33 -0
  15. samplehc/resources/v2/browser_agents/runs/help_requests.py +191 -0
  16. samplehc/resources/v2/browser_agents/runs/runs.py +102 -0
  17. samplehc/resources/v2/clearinghouse/clearinghouse.py +4 -4
  18. samplehc/resources/v2/clearinghouse/payers.py +18 -20
  19. samplehc/resources/v2/{events/events.py → events.py} +8 -40
  20. samplehc/resources/v2/integrations/__init__.py +28 -0
  21. samplehc/resources/v2/integrations/careviso.py +10 -10
  22. samplehc/resources/v2/integrations/integrations.py +64 -0
  23. samplehc/resources/v2/integrations/salesforce.py +193 -0
  24. samplehc/resources/v2/{events/integrations → integrations}/xcures.py +7 -7
  25. samplehc/resources/v2/ledger/__init__.py +27 -55
  26. samplehc/resources/v2/ledger/{orders.py → account.py} +120 -82
  27. samplehc/resources/v2/ledger/entry.py +382 -0
  28. samplehc/resources/v2/ledger/ledger.py +38 -1560
  29. samplehc/resources/v2/v2.py +16 -16
  30. samplehc/types/v2/__init__.py +0 -28
  31. samplehc/types/v2/browser_agent_invoke_response.py +3 -0
  32. samplehc/types/v2/browser_agents/runs/__init__.py +6 -0
  33. samplehc/types/v2/browser_agents/runs/help_request_resolve_params.py +18 -0
  34. samplehc/types/v2/browser_agents/runs/help_request_resolve_response.py +30 -0
  35. samplehc/types/v2/clearinghouse/__init__.py +2 -2
  36. samplehc/types/v2/clearinghouse/claim_submit_params.py +10 -9
  37. samplehc/types/v2/clearinghouse/{payer_retrieve_search_params.py → payer_search_params.py} +2 -2
  38. samplehc/types/v2/clearinghouse/{payer_retrieve_search_response.py → payer_search_response.py} +2 -2
  39. samplehc/types/v2/clearinghouse_calculate_patient_cost_params.py +3 -2
  40. samplehc/types/v2/clearinghouse_check_eligibility_params.py +2 -2
  41. samplehc/types/v2/communication_send_letter_params.py +4 -3
  42. samplehc/types/v2/document_classify_params.py +3 -2
  43. samplehc/types/v2/document_generate_csv_params.py +3 -2
  44. samplehc/types/v2/documents/legacy_extract_params.py +8 -7
  45. samplehc/types/v2/integrations/__init__.py +2 -0
  46. samplehc/types/v2/integrations/careviso_submit_prior_authorization_params.py +6 -5
  47. samplehc/types/v2/integrations/glidian/prior_authorizations/clinical_question_update_params.py +3 -2
  48. samplehc/types/v2/integrations/salesforce_run_crud_action_params.py +22 -0
  49. samplehc/types/v2/ledger/__init__.py +6 -17
  50. samplehc/types/v2/ledger/account_writeoff_params.py +24 -0
  51. samplehc/types/v2/ledger/account_writeoff_response.py +12 -0
  52. samplehc/types/v2/ledger/entry_post_params.py +61 -0
  53. samplehc/types/v2/ledger/entry_post_response.py +10 -0
  54. samplehc/types/v2/ledger/entry_reverse_params.py +19 -0
  55. samplehc/types/v2/ledger/entry_reverse_response.py +10 -0
  56. {samplehc-0.9.0.dist-info → samplehc-0.11.0.dist-info}/METADATA +1 -1
  57. {samplehc-0.9.0.dist-info → samplehc-0.11.0.dist-info}/RECORD +61 -83
  58. samplehc/resources/v2/events/__init__.py +0 -33
  59. samplehc/resources/v2/events/integrations/__init__.py +0 -33
  60. samplehc/resources/v2/events/integrations/integrations.py +0 -102
  61. samplehc/resources/v2/ledger/institutions/__init__.py +0 -33
  62. samplehc/resources/v2/ledger/institutions/institutions.py +0 -258
  63. samplehc/resources/v2/ledger/institutions/orders.py +0 -169
  64. samplehc/resources/v2/ledger/insurance.py +0 -141
  65. samplehc/resources/v2/ledger/patients.py +0 -141
  66. samplehc/types/v2/events/integrations/__init__.py +0 -5
  67. samplehc/types/v2/ledger/institution_list_outstanding_accounts_response.py +0 -25
  68. samplehc/types/v2/ledger/institution_retrieve_outstanding_orders_response.py +0 -25
  69. samplehc/types/v2/ledger/institutions/__init__.py +0 -5
  70. samplehc/types/v2/ledger/institutions/order_retrieve_balance_response.py +0 -12
  71. samplehc/types/v2/ledger/insurance_list_outstanding_accounts_response.py +0 -25
  72. samplehc/types/v2/ledger/order_retrieve_balances_response.py +0 -31
  73. samplehc/types/v2/ledger/order_retrieve_batch_balances_params.py +0 -15
  74. samplehc/types/v2/ledger/order_retrieve_batch_balances_response.py +0 -38
  75. samplehc/types/v2/ledger/patient_list_outstanding_accounts_response.py +0 -22
  76. samplehc/types/v2/ledger_assign_invoice_params.py +0 -34
  77. samplehc/types/v2/ledger_assign_invoice_response.py +0 -12
  78. samplehc/types/v2/ledger_claim_adjustment_params.py +0 -34
  79. samplehc/types/v2/ledger_claim_adjustment_response.py +0 -12
  80. samplehc/types/v2/ledger_claim_payment_params.py +0 -34
  81. samplehc/types/v2/ledger_claim_payment_response.py +0 -12
  82. samplehc/types/v2/ledger_institution_adjustment_params.py +0 -31
  83. samplehc/types/v2/ledger_institution_adjustment_response.py +0 -12
  84. samplehc/types/v2/ledger_institution_payment_params.py +0 -31
  85. samplehc/types/v2/ledger_institution_payment_response.py +0 -12
  86. samplehc/types/v2/ledger_new_order_params.py +0 -22
  87. samplehc/types/v2/ledger_new_order_response.py +0 -12
  88. samplehc/types/v2/ledger_order_writeoff_params.py +0 -28
  89. samplehc/types/v2/ledger_order_writeoff_response.py +0 -12
  90. samplehc/types/v2/ledger_patient_adjustment_params.py +0 -31
  91. samplehc/types/v2/ledger_patient_adjustment_response.py +0 -12
  92. samplehc/types/v2/ledger_patient_payment_params.py +0 -28
  93. samplehc/types/v2/ledger_patient_payment_response.py +0 -12
  94. samplehc/types/v2/ledger_post_remittance_accepted_params.py +0 -37
  95. samplehc/types/v2/ledger_post_remittance_accepted_response.py +0 -12
  96. samplehc/types/v2/ledger_reverse_entry_params.py +0 -12
  97. samplehc/types/v2/ledger_reverse_entry_response.py +0 -12
  98. /samplehc/types/v2/{events → browser_agents}/__init__.py +0 -0
  99. /samplehc/types/v2/{events/integrations → integrations}/xcure_make_request_params.py +0 -0
  100. {samplehc-0.9.0.dist-info → samplehc-0.11.0.dist-info}/WHEEL +0 -0
  101. {samplehc-0.9.0.dist-info → samplehc-0.11.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,382 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Union
6
+ from datetime import datetime
7
+ from typing_extensions import Literal
8
+
9
+ import httpx
10
+
11
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from ...._utils import maybe_transform, strip_not_given, async_maybe_transform
13
+ from ...._compat import cached_property
14
+ from ...._resource import SyncAPIResource, AsyncAPIResource
15
+ from ...._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from ...._base_client import make_request_options
22
+ from ....types.v2.ledger import entry_post_params, entry_reverse_params
23
+ from ....types.v2.ledger.entry_post_response import EntryPostResponse
24
+ from ....types.v2.ledger.entry_reverse_response import EntryReverseResponse
25
+
26
+ __all__ = ["EntryResource", "AsyncEntryResource"]
27
+
28
+
29
+ class EntryResource(SyncAPIResource):
30
+ @cached_property
31
+ def with_raw_response(self) -> EntryResourceWithRawResponse:
32
+ """
33
+ This property can be used as a prefix for any HTTP method call to return
34
+ the raw response object instead of the parsed content.
35
+
36
+ For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
37
+ """
38
+ return EntryResourceWithRawResponse(self)
39
+
40
+ @cached_property
41
+ def with_streaming_response(self) -> EntryResourceWithStreamingResponse:
42
+ """
43
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44
+
45
+ For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
46
+ """
47
+ return EntryResourceWithStreamingResponse(self)
48
+
49
+ def post(
50
+ self,
51
+ *,
52
+ amount_usd_cents: float,
53
+ entry_category: Literal["charge", "payment", "adjustment"],
54
+ line_item_id: str,
55
+ order_id: str,
56
+ description: str | NotGiven = NOT_GIVEN,
57
+ entry_type: Union[
58
+ Literal[
59
+ "insurance-payment",
60
+ "institution-payment",
61
+ "patient-payment",
62
+ "write-off",
63
+ "institution-discount",
64
+ "contracted-payer-adjustment",
65
+ "patient-pay-adjustment",
66
+ "charge",
67
+ "payment",
68
+ "adjustment",
69
+ ],
70
+ object,
71
+ ]
72
+ | NotGiven = NOT_GIVEN,
73
+ metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
74
+ payment_source: str | NotGiven = NOT_GIVEN,
75
+ posted_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
76
+ idempotency_key: str | NotGiven = NOT_GIVEN,
77
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
78
+ # The extra values given here take precedence over values defined on the client or passed to this method.
79
+ extra_headers: Headers | None = None,
80
+ extra_query: Query | None = None,
81
+ extra_body: Body | None = None,
82
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
83
+ ) -> EntryPostResponse:
84
+ """
85
+ Create diagnostics ledger entry
86
+
87
+ Args:
88
+ amount_usd_cents: The amount of the ledger entry in cents. Positive for charges, negative for
89
+ payments.
90
+
91
+ line_item_id: The line item ID associated with the ledger entry.
92
+
93
+ order_id: The order ID associated with the ledger entry.
94
+
95
+ description: The description of the ledger entry.
96
+
97
+ entry_type: The type of ledger entry.
98
+
99
+ metadata: Any optional metadata to associate with the ledger entry.
100
+
101
+ payment_source: The source of the payment, e.g. payer ID, patient ID, etc.
102
+
103
+ posted_at: The date and time the ledger entry was posted.
104
+
105
+ extra_headers: Send extra headers
106
+
107
+ extra_query: Add additional query parameters to the request
108
+
109
+ extra_body: Add additional JSON properties to the request
110
+
111
+ timeout: Override the client-level default timeout for this request, in seconds
112
+ """
113
+ extra_headers = {**strip_not_given({"idempotency-key": idempotency_key}), **(extra_headers or {})}
114
+ return self._post(
115
+ "/api/v2/ledger/entry",
116
+ body=maybe_transform(
117
+ {
118
+ "amount_usd_cents": amount_usd_cents,
119
+ "entry_category": entry_category,
120
+ "line_item_id": line_item_id,
121
+ "order_id": order_id,
122
+ "description": description,
123
+ "entry_type": entry_type,
124
+ "metadata": metadata,
125
+ "payment_source": payment_source,
126
+ "posted_at": posted_at,
127
+ },
128
+ entry_post_params.EntryPostParams,
129
+ ),
130
+ options=make_request_options(
131
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
132
+ ),
133
+ cast_to=EntryPostResponse,
134
+ )
135
+
136
+ def reverse(
137
+ self,
138
+ id: str,
139
+ *,
140
+ metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
141
+ posted_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
142
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
143
+ # The extra values given here take precedence over values defined on the client or passed to this method.
144
+ extra_headers: Headers | None = None,
145
+ extra_query: Query | None = None,
146
+ extra_body: Body | None = None,
147
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
148
+ ) -> EntryReverseResponse:
149
+ """
150
+ Reverse diagnostics ledger entry
151
+
152
+ Args:
153
+ metadata: Any optional metadata to associate with the reversal entry.
154
+
155
+ posted_at: The date and time the reversal entry was posted.
156
+
157
+ extra_headers: Send extra headers
158
+
159
+ extra_query: Add additional query parameters to the request
160
+
161
+ extra_body: Add additional JSON properties to the request
162
+
163
+ timeout: Override the client-level default timeout for this request, in seconds
164
+ """
165
+ if not id:
166
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
167
+ return self._post(
168
+ f"/api/v2/ledger/entry/{id}/reverse",
169
+ body=maybe_transform(
170
+ {
171
+ "metadata": metadata,
172
+ "posted_at": posted_at,
173
+ },
174
+ entry_reverse_params.EntryReverseParams,
175
+ ),
176
+ options=make_request_options(
177
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
178
+ ),
179
+ cast_to=EntryReverseResponse,
180
+ )
181
+
182
+
183
+ class AsyncEntryResource(AsyncAPIResource):
184
+ @cached_property
185
+ def with_raw_response(self) -> AsyncEntryResourceWithRawResponse:
186
+ """
187
+ This property can be used as a prefix for any HTTP method call to return
188
+ the raw response object instead of the parsed content.
189
+
190
+ For more information, see https://www.github.com/samplehc/samplehc-python#accessing-raw-response-data-eg-headers
191
+ """
192
+ return AsyncEntryResourceWithRawResponse(self)
193
+
194
+ @cached_property
195
+ def with_streaming_response(self) -> AsyncEntryResourceWithStreamingResponse:
196
+ """
197
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
198
+
199
+ For more information, see https://www.github.com/samplehc/samplehc-python#with_streaming_response
200
+ """
201
+ return AsyncEntryResourceWithStreamingResponse(self)
202
+
203
+ async def post(
204
+ self,
205
+ *,
206
+ amount_usd_cents: float,
207
+ entry_category: Literal["charge", "payment", "adjustment"],
208
+ line_item_id: str,
209
+ order_id: str,
210
+ description: str | NotGiven = NOT_GIVEN,
211
+ entry_type: Union[
212
+ Literal[
213
+ "insurance-payment",
214
+ "institution-payment",
215
+ "patient-payment",
216
+ "write-off",
217
+ "institution-discount",
218
+ "contracted-payer-adjustment",
219
+ "patient-pay-adjustment",
220
+ "charge",
221
+ "payment",
222
+ "adjustment",
223
+ ],
224
+ object,
225
+ ]
226
+ | NotGiven = NOT_GIVEN,
227
+ metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
228
+ payment_source: str | NotGiven = NOT_GIVEN,
229
+ posted_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
230
+ idempotency_key: str | NotGiven = NOT_GIVEN,
231
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
232
+ # The extra values given here take precedence over values defined on the client or passed to this method.
233
+ extra_headers: Headers | None = None,
234
+ extra_query: Query | None = None,
235
+ extra_body: Body | None = None,
236
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
237
+ ) -> EntryPostResponse:
238
+ """
239
+ Create diagnostics ledger entry
240
+
241
+ Args:
242
+ amount_usd_cents: The amount of the ledger entry in cents. Positive for charges, negative for
243
+ payments.
244
+
245
+ line_item_id: The line item ID associated with the ledger entry.
246
+
247
+ order_id: The order ID associated with the ledger entry.
248
+
249
+ description: The description of the ledger entry.
250
+
251
+ entry_type: The type of ledger entry.
252
+
253
+ metadata: Any optional metadata to associate with the ledger entry.
254
+
255
+ payment_source: The source of the payment, e.g. payer ID, patient ID, etc.
256
+
257
+ posted_at: The date and time the ledger entry was posted.
258
+
259
+ extra_headers: Send extra headers
260
+
261
+ extra_query: Add additional query parameters to the request
262
+
263
+ extra_body: Add additional JSON properties to the request
264
+
265
+ timeout: Override the client-level default timeout for this request, in seconds
266
+ """
267
+ extra_headers = {**strip_not_given({"idempotency-key": idempotency_key}), **(extra_headers or {})}
268
+ return await self._post(
269
+ "/api/v2/ledger/entry",
270
+ body=await async_maybe_transform(
271
+ {
272
+ "amount_usd_cents": amount_usd_cents,
273
+ "entry_category": entry_category,
274
+ "line_item_id": line_item_id,
275
+ "order_id": order_id,
276
+ "description": description,
277
+ "entry_type": entry_type,
278
+ "metadata": metadata,
279
+ "payment_source": payment_source,
280
+ "posted_at": posted_at,
281
+ },
282
+ entry_post_params.EntryPostParams,
283
+ ),
284
+ options=make_request_options(
285
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
286
+ ),
287
+ cast_to=EntryPostResponse,
288
+ )
289
+
290
+ async def reverse(
291
+ self,
292
+ id: str,
293
+ *,
294
+ metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
295
+ posted_at: Union[str, datetime] | NotGiven = NOT_GIVEN,
296
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
297
+ # The extra values given here take precedence over values defined on the client or passed to this method.
298
+ extra_headers: Headers | None = None,
299
+ extra_query: Query | None = None,
300
+ extra_body: Body | None = None,
301
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
302
+ ) -> EntryReverseResponse:
303
+ """
304
+ Reverse diagnostics ledger entry
305
+
306
+ Args:
307
+ metadata: Any optional metadata to associate with the reversal entry.
308
+
309
+ posted_at: The date and time the reversal entry was posted.
310
+
311
+ extra_headers: Send extra headers
312
+
313
+ extra_query: Add additional query parameters to the request
314
+
315
+ extra_body: Add additional JSON properties to the request
316
+
317
+ timeout: Override the client-level default timeout for this request, in seconds
318
+ """
319
+ if not id:
320
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
321
+ return await self._post(
322
+ f"/api/v2/ledger/entry/{id}/reverse",
323
+ body=await async_maybe_transform(
324
+ {
325
+ "metadata": metadata,
326
+ "posted_at": posted_at,
327
+ },
328
+ entry_reverse_params.EntryReverseParams,
329
+ ),
330
+ options=make_request_options(
331
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
332
+ ),
333
+ cast_to=EntryReverseResponse,
334
+ )
335
+
336
+
337
+ class EntryResourceWithRawResponse:
338
+ def __init__(self, entry: EntryResource) -> None:
339
+ self._entry = entry
340
+
341
+ self.post = to_raw_response_wrapper(
342
+ entry.post,
343
+ )
344
+ self.reverse = to_raw_response_wrapper(
345
+ entry.reverse,
346
+ )
347
+
348
+
349
+ class AsyncEntryResourceWithRawResponse:
350
+ def __init__(self, entry: AsyncEntryResource) -> None:
351
+ self._entry = entry
352
+
353
+ self.post = async_to_raw_response_wrapper(
354
+ entry.post,
355
+ )
356
+ self.reverse = async_to_raw_response_wrapper(
357
+ entry.reverse,
358
+ )
359
+
360
+
361
+ class EntryResourceWithStreamingResponse:
362
+ def __init__(self, entry: EntryResource) -> None:
363
+ self._entry = entry
364
+
365
+ self.post = to_streamed_response_wrapper(
366
+ entry.post,
367
+ )
368
+ self.reverse = to_streamed_response_wrapper(
369
+ entry.reverse,
370
+ )
371
+
372
+
373
+ class AsyncEntryResourceWithStreamingResponse:
374
+ def __init__(self, entry: AsyncEntryResource) -> None:
375
+ self._entry = entry
376
+
377
+ self.post = async_to_streamed_response_wrapper(
378
+ entry.post,
379
+ )
380
+ self.reverse = async_to_streamed_response_wrapper(
381
+ entry.reverse,
382
+ )