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