aidbox-python-sdk 0.1.19__tar.gz → 0.1.21__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.
- {aidbox_python_sdk-0.1.19/aidbox_python_sdk.egg-info → aidbox_python_sdk-0.1.21}/PKG-INFO +1 -1
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/__init__.py +1 -1
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/aidboxpy.py +11 -5
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/db_migrations.py +1 -1
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21/aidbox_python_sdk.egg-info}/PKG-INFO +1 -1
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/tests/test_sdk.py +60 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/LICENSE.md +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/MANIFEST.in +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/README.md +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/app_keys.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/db.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/exceptions.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/handlers.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/main.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/py.typed +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/pytest_plugin.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/sdk.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/settings.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk/types.py +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/SOURCES.txt +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/dependency_links.txt +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/not-zip-safe +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/requires.txt +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/top_level.txt +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/pyproject.toml +0 -0
- {aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/setup.cfg +0 -0
|
@@ -109,9 +109,12 @@ class AsyncAidboxReference(BaseAidboxReference, AsyncReference):
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
class SyncAidboxClient(SyncClient):
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
def resource(self, resource_type, **kwargs):
|
|
113
|
+
return SyncAidboxResource(self, resource_type, **kwargs)
|
|
114
|
+
|
|
115
|
+
def resources(self, resource_type):
|
|
116
|
+
return SyncAidboxSearchSet(self, resource_type)
|
|
117
|
+
|
|
115
118
|
def reference(self, resource_type=None, id=None, reference=None, **kwargs): # noqa: A002
|
|
116
119
|
resource_type = kwargs.pop("resourceType", resource_type)
|
|
117
120
|
if reference:
|
|
@@ -124,8 +127,11 @@ class SyncAidboxClient(SyncClient):
|
|
|
124
127
|
|
|
125
128
|
|
|
126
129
|
class AsyncAidboxClient(AsyncClient):
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
def resource(self, resource_type, **kwargs):
|
|
131
|
+
return AsyncAidboxResource(self, resource_type, **kwargs)
|
|
132
|
+
|
|
133
|
+
def resources(self, resource_type):
|
|
134
|
+
return AsyncAidboxSearchSet(self, resource_type)
|
|
129
135
|
|
|
130
136
|
def reference(self, resource_type=None, id=None, reference=None, **kwargs): # noqa: A002
|
|
131
137
|
resource_type = kwargs.pop("resourceType", resource_type)
|
|
@@ -27,7 +27,7 @@ BEGIN
|
|
|
27
27
|
FOR e IN (
|
|
28
28
|
SELECT table_name
|
|
29
29
|
FROM information_schema.columns
|
|
30
|
-
WHERE column_name = 'txid' AND table_schema = 'public' AND table_name NOT LIKE '
|
|
30
|
+
WHERE column_name = 'txid' AND table_schema = 'public' AND table_name NOT LIKE '%\\_history' ESCAPE '\\'
|
|
31
31
|
) LOOP
|
|
32
32
|
EXECUTE 'DELETE FROM "' || e.table_name || '" WHERE txid > ' || $1 ;
|
|
33
33
|
END LOOP;
|
|
@@ -118,3 +118,63 @@ async def test_database_isolation__2(aidbox_client, safe_db):
|
|
|
118
118
|
|
|
119
119
|
patients = await aidbox_client.resources("Patient").fetch_all()
|
|
120
120
|
assert len(patients) == 4
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@pytest.mark.asyncio()
|
|
124
|
+
async def test_database_isolation_with_history_in_name__1(aidbox_client, safe_db):
|
|
125
|
+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
|
|
126
|
+
assert len(resources) == 0
|
|
127
|
+
|
|
128
|
+
resource = aidbox_client.resource(
|
|
129
|
+
"FamilyMemberHistory",
|
|
130
|
+
status="completed",
|
|
131
|
+
patient={
|
|
132
|
+
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-1"}
|
|
133
|
+
},
|
|
134
|
+
relationship={
|
|
135
|
+
"coding": [
|
|
136
|
+
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "FTH"}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
)
|
|
140
|
+
await resource.save()
|
|
141
|
+
|
|
142
|
+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
|
|
143
|
+
assert len(resources) == 1
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@pytest.mark.asyncio()
|
|
147
|
+
async def test_database_isolation_with_history_in_name__2(aidbox_client, safe_db):
|
|
148
|
+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
|
|
149
|
+
assert len(resources) == 0
|
|
150
|
+
|
|
151
|
+
resource1 = aidbox_client.resource(
|
|
152
|
+
"FamilyMemberHistory",
|
|
153
|
+
status="completed",
|
|
154
|
+
patient={
|
|
155
|
+
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-1"}
|
|
156
|
+
},
|
|
157
|
+
relationship={
|
|
158
|
+
"coding": [
|
|
159
|
+
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "FTH"}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
)
|
|
163
|
+
await resource1.save()
|
|
164
|
+
|
|
165
|
+
resource2 = aidbox_client.resource(
|
|
166
|
+
"FamilyMemberHistory",
|
|
167
|
+
status="completed",
|
|
168
|
+
patient={
|
|
169
|
+
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-2"}
|
|
170
|
+
},
|
|
171
|
+
relationship={
|
|
172
|
+
"coding": [
|
|
173
|
+
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "MTH"}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
)
|
|
177
|
+
await resource2.save()
|
|
178
|
+
|
|
179
|
+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
|
|
180
|
+
assert len(resources) == 2
|
|
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
|
{aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/requires.txt
RENAMED
|
File without changes
|
{aidbox_python_sdk-0.1.19 → aidbox_python_sdk-0.1.21}/aidbox_python_sdk.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|