ovok-sdk 0.2.0.dev30__tar.gz → 0.2.0.dev31__tar.gz
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.
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/PKG-INFO +3 -1
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/README.md +2 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/pyproject.toml +1 -1
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/pyproject.toml.orig +1 -1
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/ovok.py +4 -0
- ovok_sdk-0.2.0.dev31/src/ovok_sdk/resources/omnichannel_alerts.py +68 -0
- ovok_sdk-0.2.0.dev31/src/ovok_sdk/resources/push.py +110 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/LICENSE +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/__init__.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/__init__.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/access_token.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/client_credentials.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/credentials.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/pkce.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/session.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/session_store.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/single_flight.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/token_endpoint.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/auth/user_session.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/clock.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/config.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/errors.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/http/__init__.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/http/client.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/http/error_response.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/http/request.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/http/retry.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/http/transport.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/http/url.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/paging.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/py.typed +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/__init__.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/ai.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/auth.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/auth_sessions.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/bots.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/cms.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/consent.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/content.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/documents.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/fhir.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/health.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/invites.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/measurement_builder.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/measurements.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/patient.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/platform.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/questionnaires.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/registration.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/sharing.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/signals.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/slim.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/video_calls.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/resources/wearables.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/storage.py +0 -0
- {ovok_sdk-0.2.0.dev30 → ovok_sdk-0.2.0.dev31}/src/ovok_sdk/values.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ovok-sdk
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev31
|
|
4
4
|
Summary: Python SDK for integrating Ovok Core healthcare services.
|
|
5
5
|
Author: Actimi
|
|
6
6
|
Author-email: Actimi <info@actimi.com>
|
|
@@ -185,6 +185,8 @@ input)` runs a bot.
|
|
|
185
185
|
- `ovok.locales.retrieve()` and `update()` manage project locales. `ovok.localizations` supports `list`,
|
|
186
186
|
`retrieve`, `update` and `delete`; `localizations.i18next` reads and writes the translation document.
|
|
187
187
|
- `ovok.email.templates.list()` reads the available email templates.
|
|
188
|
+
- `ovok.push` exposes `devices.register` / `list` / `unregister` and `provider.retrieve` / `create` / `update` /
|
|
189
|
+
`remove`. `ovok.omnichannel_alerts` exposes `rules.retrieve` / `update` / `remove` and `preview`.
|
|
188
190
|
- `ovok.invites` exposes `record_shares`, `care`, `practitioners` and `patients` flows, each with `create` and
|
|
189
191
|
`accept`. `invites.accept(body)` selects the record-share or care flow from the signed-in profile.
|
|
190
192
|
- `ovok.sharing` exposes `invites.create` / `redeem`, `shares.list` / `revoke`, and `settings.retrieve` /
|
|
@@ -172,6 +172,8 @@ input)` runs a bot.
|
|
|
172
172
|
- `ovok.locales.retrieve()` and `update()` manage project locales. `ovok.localizations` supports `list`,
|
|
173
173
|
`retrieve`, `update` and `delete`; `localizations.i18next` reads and writes the translation document.
|
|
174
174
|
- `ovok.email.templates.list()` reads the available email templates.
|
|
175
|
+
- `ovok.push` exposes `devices.register` / `list` / `unregister` and `provider.retrieve` / `create` / `update` /
|
|
176
|
+
`remove`. `ovok.omnichannel_alerts` exposes `rules.retrieve` / `update` / `remove` and `preview`.
|
|
175
177
|
- `ovok.invites` exposes `record_shares`, `care`, `practitioners` and `patients` flows, each with `create` and
|
|
176
178
|
`accept`. `invites.accept(body)` selects the record-share or care flow from the signed-in profile.
|
|
177
179
|
- `ovok.sharing` exposes `invites.create` / `redeem`, `shares.list` / `revoke`, and `settings.retrieve` /
|
|
@@ -28,6 +28,7 @@ from ovok_sdk.resources.fhir import FhirResource
|
|
|
28
28
|
from ovok_sdk.resources.health import HealthResource
|
|
29
29
|
from ovok_sdk.resources.invites import InvitesResource
|
|
30
30
|
from ovok_sdk.resources.measurements import MeasurementsResource
|
|
31
|
+
from ovok_sdk.resources.omnichannel_alerts import OmnichannelAlertsResource
|
|
31
32
|
from ovok_sdk.resources.patient import PatientResource
|
|
32
33
|
from ovok_sdk.resources.platform import (
|
|
33
34
|
AccountsResource,
|
|
@@ -36,6 +37,7 @@ from ovok_sdk.resources.platform import (
|
|
|
36
37
|
LocalizationsResource,
|
|
37
38
|
ProjectsResource,
|
|
38
39
|
)
|
|
40
|
+
from ovok_sdk.resources.push import PushResource
|
|
39
41
|
from ovok_sdk.resources.questionnaires import (
|
|
40
42
|
QuestionnaireResponsesResource,
|
|
41
43
|
QuestionnairesResource,
|
|
@@ -136,6 +138,8 @@ class Ovok:
|
|
|
136
138
|
self.ai = AiResource(http)
|
|
137
139
|
self.wearables = WearablesResource(http)
|
|
138
140
|
self.bots = BotsResource(http)
|
|
141
|
+
self.push = PushResource(http)
|
|
142
|
+
self.omnichannel_alerts = OmnichannelAlertsResource(http)
|
|
139
143
|
self.questionnaires = QuestionnairesResource(http)
|
|
140
144
|
self.questionnaire_responses = QuestionnaireResponsesResource(http, self.fhir)
|
|
141
145
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Omni-channel alerts: the rule that decides who hears of each Signals alert, and its preview."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from ovok_sdk.http.client import HttpClient
|
|
9
|
+
|
|
10
|
+
JsonObject = Mapping[str, Any]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class NotificationsRulesResource:
|
|
14
|
+
"""The project's alert notifications rule; access it as `ovok.omnichannel_alerts.rules`.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
http: The HTTP client scoped to the omni-channel alerts routes.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
PATH = "rules"
|
|
21
|
+
|
|
22
|
+
def __init__(self, http: HttpClient) -> None:
|
|
23
|
+
self._http = http
|
|
24
|
+
|
|
25
|
+
def retrieve(self) -> Any:
|
|
26
|
+
"""Read the rule.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
The rule under `notifications`, None when the project has none.
|
|
30
|
+
"""
|
|
31
|
+
return self._http.get(self.PATH)
|
|
32
|
+
|
|
33
|
+
def update(self, rule: JsonObject) -> Any:
|
|
34
|
+
"""Set the rule; Ovok checks its channels and recipients, then Signals checks its steps.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
rule: The rule, with its JSON Logic under `logic`.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
The rule as Signals now runs it.
|
|
41
|
+
"""
|
|
42
|
+
return self._http.put(self.PATH, rule)
|
|
43
|
+
|
|
44
|
+
def remove(self) -> None:
|
|
45
|
+
"""Remove the rule, so nobody is told of a new alert."""
|
|
46
|
+
self._http.delete(self.PATH)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class OmnichannelAlertsResource:
|
|
50
|
+
"""Signals generates each alert's notification steps from the project's rule; Ovok delivers them.
|
|
51
|
+
|
|
52
|
+
For project admins. Created by `Ovok`; access it as `ovok.omnichannel_alerts`.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def __init__(self, http: HttpClient) -> None:
|
|
56
|
+
self._http = http.under("v1/omnichannel-alerts")
|
|
57
|
+
self.rules = NotificationsRulesResource(self._http)
|
|
58
|
+
|
|
59
|
+
def preview(self, preview: JsonObject) -> Any:
|
|
60
|
+
"""Preview who a sample alert's notifications reach, step by step; nothing is sent.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
preview: The `patientId`, an optional sample `alert` and an optional `notifications` rule to try.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
The planned steps, under `steps`.
|
|
67
|
+
"""
|
|
68
|
+
return self._http.post("preview", preview)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""Push devices and the project's push provider."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from ovok_sdk.http.client import HttpClient
|
|
9
|
+
from ovok_sdk.http.url import path_segment
|
|
10
|
+
|
|
11
|
+
JsonObject = Mapping[str, Any]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PushDevicesResource:
|
|
15
|
+
"""The devices the signed-in person receives push on; access it as `ovok.push.devices`.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
http: The HTTP client scoped to the push routes.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
PATH = "devices"
|
|
22
|
+
|
|
23
|
+
def __init__(self, http: HttpClient) -> None:
|
|
24
|
+
self._http = http
|
|
25
|
+
|
|
26
|
+
def register(self, device: JsonObject) -> Any:
|
|
27
|
+
"""Register a device token to the signed-in person; the same token again answers the same device.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
device: The `token`, the `platform` (`ios`, `android` or `web`) and an optional `appId`.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
The device, never with its token.
|
|
34
|
+
"""
|
|
35
|
+
return self._http.post(self.PATH, device)
|
|
36
|
+
|
|
37
|
+
def list(self) -> Any:
|
|
38
|
+
"""List the signed-in person's devices.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
The devices, under `devices`.
|
|
42
|
+
"""
|
|
43
|
+
return self._http.get(self.PATH)
|
|
44
|
+
|
|
45
|
+
def unregister(self, device_id: str) -> None:
|
|
46
|
+
"""Remove a device, which then gets no more push.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
device_id: The device id.
|
|
50
|
+
"""
|
|
51
|
+
self._http.delete(f"{self.PATH}/{path_segment(device_id)}")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class PushProviderResource:
|
|
55
|
+
"""The provider the project's push goes through, for project admins; access it as `ovok.push.provider`.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
http: The HTTP client scoped to the push routes.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
PATH = "provider"
|
|
62
|
+
|
|
63
|
+
def __init__(self, http: HttpClient) -> None:
|
|
64
|
+
self._http = http
|
|
65
|
+
|
|
66
|
+
def retrieve(self) -> Any:
|
|
67
|
+
"""Read the push provider and its settings, never a secret.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
The provider.
|
|
71
|
+
"""
|
|
72
|
+
return self._http.get(self.PATH)
|
|
73
|
+
|
|
74
|
+
def create(self, provider: JsonObject) -> Any:
|
|
75
|
+
"""Set up the push provider; a relay's signing secret is answered this once.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
provider: The `provider` name (`fcm`, `apns`, `expo` or `relay`) and its credentials.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
The provider as set up.
|
|
82
|
+
"""
|
|
83
|
+
return self._http.post(self.PATH, provider)
|
|
84
|
+
|
|
85
|
+
def update(self, changes: JsonObject) -> Any:
|
|
86
|
+
"""Change the push provider.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
changes: The `provider` set up, and the fields to change.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
The provider after the change.
|
|
93
|
+
"""
|
|
94
|
+
return self._http.patch(self.PATH, changes)
|
|
95
|
+
|
|
96
|
+
def remove(self) -> None:
|
|
97
|
+
"""Remove the push provider; no push is sent until one is set up again."""
|
|
98
|
+
self._http.delete(self.PATH)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class PushResource:
|
|
102
|
+
"""Push devices and the project's push provider.
|
|
103
|
+
|
|
104
|
+
Created by `Ovok`; access it as `ovok.push`.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
def __init__(self, http: HttpClient) -> None:
|
|
108
|
+
push = http.under("v1/push")
|
|
109
|
+
self.devices = PushDevicesResource(push)
|
|
110
|
+
self.provider = PushProviderResource(push)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|