hubble-sdk-python 0.2.1__py3-none-any.whl → 0.3.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 (32) hide show
  1. hubble_sdk/__init__.py +24 -4
  2. hubble_sdk/_generated/api/default/create_consent.py +193 -0
  3. hubble_sdk/_generated/api/default/create_consent_link.py +8 -4
  4. hubble_sdk/_generated/api/default/export_patient_fhir.py +31 -12
  5. hubble_sdk/_generated/api/default/export_patient_pdf.py +36 -12
  6. hubble_sdk/_generated/api/default/get_application_token.py +194 -0
  7. hubble_sdk/_generated/api/default/get_patient_pdf_export.py +47 -20
  8. hubble_sdk/_generated/api/default/list_consents.py +16 -4
  9. hubble_sdk/_generated/api/default/read_fhir.py +48 -13
  10. hubble_sdk/_generated/models/__init__.py +20 -0
  11. hubble_sdk/_generated/models/application_token_error.py +54 -0
  12. hubble_sdk/_generated/models/application_token_error_error.py +31 -0
  13. hubble_sdk/_generated/models/application_token_request.py +72 -0
  14. hubble_sdk/_generated/models/application_token_response.py +69 -0
  15. hubble_sdk/_generated/models/attach_client_authorization_body.py +1 -1
  16. hubble_sdk/_generated/models/client_supplied_discloser.py +107 -0
  17. hubble_sdk/_generated/models/client_supplied_discloser_facility_type.py +28 -0
  18. hubble_sdk/_generated/models/consent.py +5 -4
  19. hubble_sdk/_generated/models/created_consent.py +152 -0
  20. hubble_sdk/_generated/models/facility_address.py +78 -0
  21. hubble_sdk/_generated/models/facility_address_state.py +77 -0
  22. hubble_sdk/_generated/models/patient_address.py +13 -5
  23. hubble_sdk/_generated/models/patient_address_state.py +77 -0
  24. hubble_sdk/_generated/models/patient_demographics.py +1 -1
  25. hubble_sdk/_generated/models/provider_seed.py +2 -1
  26. hubble_sdk/_hubble.py +281 -41
  27. hubble_sdk/_params.py +86 -0
  28. hubble_sdk/py.typed +0 -0
  29. {hubble_sdk_python-0.2.1.dist-info → hubble_sdk_python-0.3.0.dist-info}/METADATA +45 -16
  30. {hubble_sdk_python-0.2.1.dist-info → hubble_sdk_python-0.3.0.dist-info}/RECORD +32 -18
  31. {hubble_sdk_python-0.2.1.dist-info → hubble_sdk_python-0.3.0.dist-info}/WHEEL +0 -0
  32. {hubble_sdk_python-0.2.1.dist-info → hubble_sdk_python-0.3.0.dist-info}/licenses/LICENSE +0 -0
hubble_sdk/__init__.py CHANGED
@@ -5,10 +5,12 @@ Import the high-level client from here:
5
5
  from hubble_sdk import Hubble
6
6
 
7
7
  hub = Hubble(client_id="hbl_client_...", client_secret="hbl_prod_...")
8
- link = hub.create_link(patient_ref="abc123")
9
- print(link.verification_uri_complete) # send the patient here
10
- session = hub.wait_for_authorization(link)
11
- bundle = session.everything() # reads FHIR with the consent token
8
+ consent = hub.create_consent(patient_ref="abc123")
9
+ print(consent.link_url) # send the patient here
10
+ bundle = hub.everything(consent.id) # read whenever you like
11
+
12
+ The device flow (``create_link`` / ``wait_for_authorization``) still works for
13
+ existing integrations.
12
14
 
13
15
  The generated low-level client lives under ``hubble_sdk._generated``
14
16
  if you need direct access to raw operations and models.
@@ -17,6 +19,7 @@ if you need direct access to raw operations and models.
17
19
  from ._generated.models import (
18
20
  Consent,
19
21
  ConsentStatus,
22
+ CreatedConsent,
20
23
  DeviceAuthorizationResponse,
21
24
  TokenResponse,
22
25
  )
@@ -28,6 +31,15 @@ from ._hubble import (
28
31
  PdfExport,
29
32
  TokenSet,
30
33
  )
34
+ from ._params import (
35
+ ConsentStatusFilter,
36
+ DiscloserParams,
37
+ FacilityAddressParams,
38
+ PatientAddressParams,
39
+ PatientParams,
40
+ ProviderSeedParams,
41
+ UsStateCode,
42
+ )
31
43
  from ._webhooks import (
32
44
  WEBHOOK_SIGNATURE_HEADER,
33
45
  WebhookEvent,
@@ -43,6 +55,13 @@ __all__ = [
43
55
  "ConsentTimeout",
44
56
  "TokenSet",
45
57
  "PdfExport",
58
+ "ConsentStatusFilter",
59
+ "PatientParams",
60
+ "PatientAddressParams",
61
+ "ProviderSeedParams",
62
+ "DiscloserParams",
63
+ "FacilityAddressParams",
64
+ "UsStateCode",
46
65
  "construct_webhook_event",
47
66
  "WebhookEvent",
48
67
  "WebhookEventSource",
@@ -50,6 +69,7 @@ __all__ = [
50
69
  "WEBHOOK_SIGNATURE_HEADER",
51
70
  "Consent",
52
71
  "ConsentStatus",
72
+ "CreatedConsent",
53
73
  "DeviceAuthorizationResponse",
54
74
  "TokenResponse",
55
75
  ]
@@ -0,0 +1,193 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.api_error import ApiError
9
+ from ...models.consent_link_request import ConsentLinkRequest
10
+ from ...models.created_consent import CreatedConsent
11
+ from ...types import UNSET, Response, Unset
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: ConsentLinkRequest | Unset = UNSET,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "post",
22
+ "url": "/api/v1/consents",
23
+ }
24
+
25
+ if not isinstance(body, Unset):
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(
35
+ *, client: AuthenticatedClient | Client, response: httpx.Response
36
+ ) -> ApiError | CreatedConsent | None:
37
+ if response.status_code == 201:
38
+ response_201 = CreatedConsent.from_dict(response.json())
39
+
40
+ return response_201
41
+
42
+ if response.status_code == 400:
43
+ response_400 = ApiError.from_dict(response.json())
44
+
45
+ return response_400
46
+
47
+ if response.status_code == 401:
48
+ response_401 = ApiError.from_dict(response.json())
49
+
50
+ return response_401
51
+
52
+ if response.status_code == 403:
53
+ response_403 = ApiError.from_dict(response.json())
54
+
55
+ return response_403
56
+
57
+ if client.raise_on_unexpected_status:
58
+ raise errors.UnexpectedStatus(response.status_code, response.content)
59
+ else:
60
+ return None
61
+
62
+
63
+ def _build_response(
64
+ *, client: AuthenticatedClient | Client, response: httpx.Response
65
+ ) -> Response[ApiError | CreatedConsent]:
66
+ return Response(
67
+ status_code=HTTPStatus(response.status_code),
68
+ content=response.content,
69
+ headers=response.headers,
70
+ parsed=_parse_response(client=client, response=response),
71
+ )
72
+
73
+
74
+ def sync_detailed(
75
+ *,
76
+ client: AuthenticatedClient,
77
+ body: ConsentLinkRequest | Unset = UNSET,
78
+ ) -> Response[ApiError | CreatedConsent]:
79
+ """Create a consent
80
+
81
+ Creates a pending consent and its patient link, and returns the consent with `link_url`. Deliver the
82
+ link to the patient, then read the consent with an application access token from POST /api/v1/token
83
+ and `consent=<id>` on /api/v1/fhir. Every field is optional.
84
+
85
+ Args:
86
+ body (ConsentLinkRequest | Unset):
87
+
88
+ Raises:
89
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
90
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
91
+
92
+ Returns:
93
+ Response[ApiError | CreatedConsent]
94
+ """
95
+
96
+ kwargs = _get_kwargs(
97
+ body=body,
98
+ )
99
+
100
+ response = client.get_httpx_client().request(
101
+ **kwargs,
102
+ )
103
+
104
+ return _build_response(client=client, response=response)
105
+
106
+
107
+ def sync(
108
+ *,
109
+ client: AuthenticatedClient,
110
+ body: ConsentLinkRequest | Unset = UNSET,
111
+ ) -> ApiError | CreatedConsent | None:
112
+ """Create a consent
113
+
114
+ Creates a pending consent and its patient link, and returns the consent with `link_url`. Deliver the
115
+ link to the patient, then read the consent with an application access token from POST /api/v1/token
116
+ and `consent=<id>` on /api/v1/fhir. Every field is optional.
117
+
118
+ Args:
119
+ body (ConsentLinkRequest | Unset):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ ApiError | CreatedConsent
127
+ """
128
+
129
+ return sync_detailed(
130
+ client=client,
131
+ body=body,
132
+ ).parsed
133
+
134
+
135
+ async def asyncio_detailed(
136
+ *,
137
+ client: AuthenticatedClient,
138
+ body: ConsentLinkRequest | Unset = UNSET,
139
+ ) -> Response[ApiError | CreatedConsent]:
140
+ """Create a consent
141
+
142
+ Creates a pending consent and its patient link, and returns the consent with `link_url`. Deliver the
143
+ link to the patient, then read the consent with an application access token from POST /api/v1/token
144
+ and `consent=<id>` on /api/v1/fhir. Every field is optional.
145
+
146
+ Args:
147
+ body (ConsentLinkRequest | Unset):
148
+
149
+ Raises:
150
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
151
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
152
+
153
+ Returns:
154
+ Response[ApiError | CreatedConsent]
155
+ """
156
+
157
+ kwargs = _get_kwargs(
158
+ body=body,
159
+ )
160
+
161
+ response = await client.get_async_httpx_client().request(**kwargs)
162
+
163
+ return _build_response(client=client, response=response)
164
+
165
+
166
+ async def asyncio(
167
+ *,
168
+ client: AuthenticatedClient,
169
+ body: ConsentLinkRequest | Unset = UNSET,
170
+ ) -> ApiError | CreatedConsent | None:
171
+ """Create a consent
172
+
173
+ Creates a pending consent and its patient link, and returns the consent with `link_url`. Deliver the
174
+ link to the patient, then read the consent with an application access token from POST /api/v1/token
175
+ and `consent=<id>` on /api/v1/fhir. Every field is optional.
176
+
177
+ Args:
178
+ body (ConsentLinkRequest | Unset):
179
+
180
+ Raises:
181
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
182
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
183
+
184
+ Returns:
185
+ ApiError | CreatedConsent
186
+ """
187
+
188
+ return (
189
+ await asyncio_detailed(
190
+ client=client,
191
+ body=body,
192
+ )
193
+ ).parsed
@@ -77,7 +77,8 @@ def sync_detailed(
77
77
  Mints a pending consent and a one-time patient link. Send the patient to
78
78
  `verification_uri_complete`, then poll the token endpoint with `device_code` until they authorize.
79
79
  Accepts a nested JSON body (recommended) or the flat RFC 8628 form encoding; both prefill the same
80
- consent.
80
+ consent. To read with an application access token instead, create the consent with POST
81
+ /api/v1/consents, which has no device code.
81
82
 
82
83
  Args:
83
84
  body (ConsentLinkRequest | Unset):
@@ -112,7 +113,8 @@ def sync(
112
113
  Mints a pending consent and a one-time patient link. Send the patient to
113
114
  `verification_uri_complete`, then poll the token endpoint with `device_code` until they authorize.
114
115
  Accepts a nested JSON body (recommended) or the flat RFC 8628 form encoding; both prefill the same
115
- consent.
116
+ consent. To read with an application access token instead, create the consent with POST
117
+ /api/v1/consents, which has no device code.
116
118
 
117
119
  Args:
118
120
  body (ConsentLinkRequest | Unset):
@@ -142,7 +144,8 @@ async def asyncio_detailed(
142
144
  Mints a pending consent and a one-time patient link. Send the patient to
143
145
  `verification_uri_complete`, then poll the token endpoint with `device_code` until they authorize.
144
146
  Accepts a nested JSON body (recommended) or the flat RFC 8628 form encoding; both prefill the same
145
- consent.
147
+ consent. To read with an application access token instead, create the consent with POST
148
+ /api/v1/consents, which has no device code.
146
149
 
147
150
  Args:
148
151
  body (ConsentLinkRequest | Unset):
@@ -175,7 +178,8 @@ async def asyncio(
175
178
  Mints a pending consent and a one-time patient link. Send the patient to
176
179
  `verification_uri_complete`, then poll the token endpoint with `device_code` until they authorize.
177
180
  Accepts a nested JSON body (recommended) or the flat RFC 8628 form encoding; both prefill the same
178
- consent.
181
+ consent. To read with an application access token instead, create the consent with POST
182
+ /api/v1/consents, which has no device code.
179
183
 
180
184
  Args:
181
185
  body (ConsentLinkRequest | Unset):
@@ -1,5 +1,6 @@
1
1
  from http import HTTPStatus
2
2
  from typing import Any
3
+ from uuid import UUID
3
4
 
4
5
  import httpx
5
6
 
@@ -14,6 +15,7 @@ from ...types import UNSET, Response, Unset
14
15
 
15
16
  def _get_kwargs(
16
17
  *,
18
+ consent: UUID | Unset = UNSET,
17
19
  field_count: int | Unset = UNSET,
18
20
  field_offset: int | Unset = UNSET,
19
21
  prefer: ExportPatientFhirPrefer | Unset = UNSET,
@@ -24,6 +26,11 @@ def _get_kwargs(
24
26
 
25
27
  params: dict[str, Any] = {}
26
28
 
29
+ json_consent: str | Unset = UNSET
30
+ if not isinstance(consent, Unset):
31
+ json_consent = str(consent)
32
+ params["consent"] = json_consent
33
+
27
34
  params["_count"] = field_count
28
35
 
29
36
  params["_offset"] = field_offset
@@ -103,6 +110,7 @@ def _build_response(
103
110
  def sync_detailed(
104
111
  *,
105
112
  client: AuthenticatedClient,
113
+ consent: UUID | Unset = UNSET,
106
114
  field_count: int | Unset = UNSET,
107
115
  field_offset: int | Unset = UNSET,
108
116
  prefer: ExportPatientFhirPrefer | Unset = UNSET,
@@ -113,11 +121,12 @@ def sync_detailed(
113
121
  query parameters to prepare health-records.json in the background. The file is a FHIR collection
114
122
  Bundle containing the captured provider sources, including each source's Patient and warnings for
115
123
  incomplete sources. It has no paging links, search metadata or total field, and is not a Bulk Data
116
- $export/NDJSON response. Poll Content-Location with the same consent token no sooner than Retry-
117
- After for a 303 download redirect. An organization can hold 20 exports in flight at once; a repeat
118
- request for one already running reuses it. Payer records are not included.
124
+ $export/NDJSON response. Poll Content-Location with the same token no sooner than Retry-After for a
125
+ 303 download redirect. An organization can hold 20 exports in flight at once; a repeat request for
126
+ one already running reuses it. Payer records are not included.
119
127
 
120
128
  Args:
129
+ consent (UUID | Unset):
121
130
  field_count (int | Unset):
122
131
  field_offset (int | Unset):
123
132
  prefer (ExportPatientFhirPrefer | Unset):
@@ -131,6 +140,7 @@ def sync_detailed(
131
140
  """
132
141
 
133
142
  kwargs = _get_kwargs(
143
+ consent=consent,
134
144
  field_count=field_count,
135
145
  field_offset=field_offset,
136
146
  prefer=prefer,
@@ -146,6 +156,7 @@ def sync_detailed(
146
156
  def sync(
147
157
  *,
148
158
  client: AuthenticatedClient,
159
+ consent: UUID | Unset = UNSET,
149
160
  field_count: int | Unset = UNSET,
150
161
  field_offset: int | Unset = UNSET,
151
162
  prefer: ExportPatientFhirPrefer | Unset = UNSET,
@@ -156,11 +167,12 @@ def sync(
156
167
  query parameters to prepare health-records.json in the background. The file is a FHIR collection
157
168
  Bundle containing the captured provider sources, including each source's Patient and warnings for
158
169
  incomplete sources. It has no paging links, search metadata or total field, and is not a Bulk Data
159
- $export/NDJSON response. Poll Content-Location with the same consent token no sooner than Retry-
160
- After for a 303 download redirect. An organization can hold 20 exports in flight at once; a repeat
161
- request for one already running reuses it. Payer records are not included.
170
+ $export/NDJSON response. Poll Content-Location with the same token no sooner than Retry-After for a
171
+ 303 download redirect. An organization can hold 20 exports in flight at once; a repeat request for
172
+ one already running reuses it. Payer records are not included.
162
173
 
163
174
  Args:
175
+ consent (UUID | Unset):
164
176
  field_count (int | Unset):
165
177
  field_offset (int | Unset):
166
178
  prefer (ExportPatientFhirPrefer | Unset):
@@ -175,6 +187,7 @@ def sync(
175
187
 
176
188
  return sync_detailed(
177
189
  client=client,
190
+ consent=consent,
178
191
  field_count=field_count,
179
192
  field_offset=field_offset,
180
193
  prefer=prefer,
@@ -184,6 +197,7 @@ def sync(
184
197
  async def asyncio_detailed(
185
198
  *,
186
199
  client: AuthenticatedClient,
200
+ consent: UUID | Unset = UNSET,
187
201
  field_count: int | Unset = UNSET,
188
202
  field_offset: int | Unset = UNSET,
189
203
  prefer: ExportPatientFhirPrefer | Unset = UNSET,
@@ -194,11 +208,12 @@ async def asyncio_detailed(
194
208
  query parameters to prepare health-records.json in the background. The file is a FHIR collection
195
209
  Bundle containing the captured provider sources, including each source's Patient and warnings for
196
210
  incomplete sources. It has no paging links, search metadata or total field, and is not a Bulk Data
197
- $export/NDJSON response. Poll Content-Location with the same consent token no sooner than Retry-
198
- After for a 303 download redirect. An organization can hold 20 exports in flight at once; a repeat
199
- request for one already running reuses it. Payer records are not included.
211
+ $export/NDJSON response. Poll Content-Location with the same token no sooner than Retry-After for a
212
+ 303 download redirect. An organization can hold 20 exports in flight at once; a repeat request for
213
+ one already running reuses it. Payer records are not included.
200
214
 
201
215
  Args:
216
+ consent (UUID | Unset):
202
217
  field_count (int | Unset):
203
218
  field_offset (int | Unset):
204
219
  prefer (ExportPatientFhirPrefer | Unset):
@@ -212,6 +227,7 @@ async def asyncio_detailed(
212
227
  """
213
228
 
214
229
  kwargs = _get_kwargs(
230
+ consent=consent,
215
231
  field_count=field_count,
216
232
  field_offset=field_offset,
217
233
  prefer=prefer,
@@ -225,6 +241,7 @@ async def asyncio_detailed(
225
241
  async def asyncio(
226
242
  *,
227
243
  client: AuthenticatedClient,
244
+ consent: UUID | Unset = UNSET,
228
245
  field_count: int | Unset = UNSET,
229
246
  field_offset: int | Unset = UNSET,
230
247
  prefer: ExportPatientFhirPrefer | Unset = UNSET,
@@ -235,11 +252,12 @@ async def asyncio(
235
252
  query parameters to prepare health-records.json in the background. The file is a FHIR collection
236
253
  Bundle containing the captured provider sources, including each source's Patient and warnings for
237
254
  incomplete sources. It has no paging links, search metadata or total field, and is not a Bulk Data
238
- $export/NDJSON response. Poll Content-Location with the same consent token no sooner than Retry-
239
- After for a 303 download redirect. An organization can hold 20 exports in flight at once; a repeat
240
- request for one already running reuses it. Payer records are not included.
255
+ $export/NDJSON response. Poll Content-Location with the same token no sooner than Retry-After for a
256
+ 303 download redirect. An organization can hold 20 exports in flight at once; a repeat request for
257
+ one already running reuses it. Payer records are not included.
241
258
 
242
259
  Args:
260
+ consent (UUID | Unset):
243
261
  field_count (int | Unset):
244
262
  field_offset (int | Unset):
245
263
  prefer (ExportPatientFhirPrefer | Unset):
@@ -255,6 +273,7 @@ async def asyncio(
255
273
  return (
256
274
  await asyncio_detailed(
257
275
  client=client,
276
+ consent=consent,
258
277
  field_count=field_count,
259
278
  field_offset=field_offset,
260
279
  prefer=prefer,
@@ -1,5 +1,6 @@
1
1
  from http import HTTPStatus
2
2
  from typing import Any
3
+ from uuid import UUID
3
4
 
4
5
  import httpx
5
6
 
@@ -13,6 +14,7 @@ from ...types import UNSET, Response, Unset
13
14
 
14
15
  def _get_kwargs(
15
16
  *,
17
+ consent: UUID | Unset = UNSET,
16
18
  connection: str | Unset = UNSET,
17
19
  prefer: ExportPatientPdfPrefer | Unset = UNSET,
18
20
  ) -> dict[str, Any]:
@@ -22,6 +24,11 @@ def _get_kwargs(
22
24
 
23
25
  params: dict[str, Any] = {}
24
26
 
27
+ json_consent: str | Unset = UNSET
28
+ if not isinstance(consent, Unset):
29
+ json_consent = str(consent)
30
+ params["consent"] = json_consent
31
+
25
32
  params["connection"] = connection
26
33
 
27
34
  params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
@@ -44,6 +51,11 @@ def _parse_response(
44
51
 
45
52
  return response_202
46
53
 
54
+ if response.status_code == 400:
55
+ response_400 = OperationOutcome.from_dict(response.json())
56
+
57
+ return response_400
58
+
47
59
  if response.status_code == 401:
48
60
  response_401 = OperationOutcome.from_dict(response.json())
49
61
 
@@ -89,6 +101,7 @@ def _build_response(
89
101
  def sync_detailed(
90
102
  *,
91
103
  client: AuthenticatedClient,
104
+ consent: UUID | Unset = UNSET,
92
105
  connection: str | Unset = UNSET,
93
106
  prefer: ExportPatientPdfPrefer | Unset = UNSET,
94
107
  ) -> Response[ExportPatientPdfResponse202 | OperationOutcome]:
@@ -100,11 +113,12 @@ def sync_detailed(
100
113
  `X-Hubble-Sources-Total`, `X-Hubble-Sources-Failed`, and `X-Hubble-Resource-Count` response headers
101
114
  report how many sources were exported, how many were incomplete, and the total resource count. Send
102
115
  Prefer: respond-async to prepare the export in a background worker. Poll Content-Location with the
103
- same consent token no sooner than Retry-After until it returns a 303 redirect to a short-lived
104
- download URL. An organization can hold 20 exports in flight at once; a repeat request for one
105
- already running reuses it. Without Prefer, the synchronous response is unchanged.
116
+ same token no sooner than Retry-After until it returns a 303 redirect to a short-lived download URL.
117
+ An organization can hold 20 exports in flight at once; a repeat request for one already running
118
+ reuses it. Without Prefer, the synchronous response is unchanged.
106
119
 
107
120
  Args:
121
+ consent (UUID | Unset):
108
122
  connection (str | Unset):
109
123
  prefer (ExportPatientPdfPrefer | Unset):
110
124
 
@@ -117,6 +131,7 @@ def sync_detailed(
117
131
  """
118
132
 
119
133
  kwargs = _get_kwargs(
134
+ consent=consent,
120
135
  connection=connection,
121
136
  prefer=prefer,
122
137
  )
@@ -131,6 +146,7 @@ def sync_detailed(
131
146
  def sync(
132
147
  *,
133
148
  client: AuthenticatedClient,
149
+ consent: UUID | Unset = UNSET,
134
150
  connection: str | Unset = UNSET,
135
151
  prefer: ExportPatientPdfPrefer | Unset = UNSET,
136
152
  ) -> ExportPatientPdfResponse202 | OperationOutcome | None:
@@ -142,11 +158,12 @@ def sync(
142
158
  `X-Hubble-Sources-Total`, `X-Hubble-Sources-Failed`, and `X-Hubble-Resource-Count` response headers
143
159
  report how many sources were exported, how many were incomplete, and the total resource count. Send
144
160
  Prefer: respond-async to prepare the export in a background worker. Poll Content-Location with the
145
- same consent token no sooner than Retry-After until it returns a 303 redirect to a short-lived
146
- download URL. An organization can hold 20 exports in flight at once; a repeat request for one
147
- already running reuses it. Without Prefer, the synchronous response is unchanged.
161
+ same token no sooner than Retry-After until it returns a 303 redirect to a short-lived download URL.
162
+ An organization can hold 20 exports in flight at once; a repeat request for one already running
163
+ reuses it. Without Prefer, the synchronous response is unchanged.
148
164
 
149
165
  Args:
166
+ consent (UUID | Unset):
150
167
  connection (str | Unset):
151
168
  prefer (ExportPatientPdfPrefer | Unset):
152
169
 
@@ -160,6 +177,7 @@ def sync(
160
177
 
161
178
  return sync_detailed(
162
179
  client=client,
180
+ consent=consent,
163
181
  connection=connection,
164
182
  prefer=prefer,
165
183
  ).parsed
@@ -168,6 +186,7 @@ def sync(
168
186
  async def asyncio_detailed(
169
187
  *,
170
188
  client: AuthenticatedClient,
189
+ consent: UUID | Unset = UNSET,
171
190
  connection: str | Unset = UNSET,
172
191
  prefer: ExportPatientPdfPrefer | Unset = UNSET,
173
192
  ) -> Response[ExportPatientPdfResponse202 | OperationOutcome]:
@@ -179,11 +198,12 @@ async def asyncio_detailed(
179
198
  `X-Hubble-Sources-Total`, `X-Hubble-Sources-Failed`, and `X-Hubble-Resource-Count` response headers
180
199
  report how many sources were exported, how many were incomplete, and the total resource count. Send
181
200
  Prefer: respond-async to prepare the export in a background worker. Poll Content-Location with the
182
- same consent token no sooner than Retry-After until it returns a 303 redirect to a short-lived
183
- download URL. An organization can hold 20 exports in flight at once; a repeat request for one
184
- already running reuses it. Without Prefer, the synchronous response is unchanged.
201
+ same token no sooner than Retry-After until it returns a 303 redirect to a short-lived download URL.
202
+ An organization can hold 20 exports in flight at once; a repeat request for one already running
203
+ reuses it. Without Prefer, the synchronous response is unchanged.
185
204
 
186
205
  Args:
206
+ consent (UUID | Unset):
187
207
  connection (str | Unset):
188
208
  prefer (ExportPatientPdfPrefer | Unset):
189
209
 
@@ -196,6 +216,7 @@ async def asyncio_detailed(
196
216
  """
197
217
 
198
218
  kwargs = _get_kwargs(
219
+ consent=consent,
199
220
  connection=connection,
200
221
  prefer=prefer,
201
222
  )
@@ -208,6 +229,7 @@ async def asyncio_detailed(
208
229
  async def asyncio(
209
230
  *,
210
231
  client: AuthenticatedClient,
232
+ consent: UUID | Unset = UNSET,
211
233
  connection: str | Unset = UNSET,
212
234
  prefer: ExportPatientPdfPrefer | Unset = UNSET,
213
235
  ) -> ExportPatientPdfResponse202 | OperationOutcome | None:
@@ -219,11 +241,12 @@ async def asyncio(
219
241
  `X-Hubble-Sources-Total`, `X-Hubble-Sources-Failed`, and `X-Hubble-Resource-Count` response headers
220
242
  report how many sources were exported, how many were incomplete, and the total resource count. Send
221
243
  Prefer: respond-async to prepare the export in a background worker. Poll Content-Location with the
222
- same consent token no sooner than Retry-After until it returns a 303 redirect to a short-lived
223
- download URL. An organization can hold 20 exports in flight at once; a repeat request for one
224
- already running reuses it. Without Prefer, the synchronous response is unchanged.
244
+ same token no sooner than Retry-After until it returns a 303 redirect to a short-lived download URL.
245
+ An organization can hold 20 exports in flight at once; a repeat request for one already running
246
+ reuses it. Without Prefer, the synchronous response is unchanged.
225
247
 
226
248
  Args:
249
+ consent (UUID | Unset):
227
250
  connection (str | Unset):
228
251
  prefer (ExportPatientPdfPrefer | Unset):
229
252
 
@@ -238,6 +261,7 @@ async def asyncio(
238
261
  return (
239
262
  await asyncio_detailed(
240
263
  client=client,
264
+ consent=consent,
241
265
  connection=connection,
242
266
  prefer=prefer,
243
267
  )