aidbox-python-sdk 0.1.20__tar.gz → 0.1.22__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.20/aidbox_python_sdk.egg-info → aidbox_python_sdk-0.1.22}/PKG-INFO +1 -1
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/__init__.py +1 -1
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/db_migrations.py +1 -1
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22/aidbox_python_sdk.egg-info}/PKG-INFO +1 -1
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/tests/test_sdk.py +60 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/LICENSE.md +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/MANIFEST.in +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/README.md +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/aidboxpy.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/app_keys.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/db.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/exceptions.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/handlers.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/main.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/py.typed +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/pytest_plugin.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/sdk.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/settings.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk/types.py +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/SOURCES.txt +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/dependency_links.txt +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/not-zip-safe +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/requires.txt +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/top_level.txt +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/pyproject.toml +0 -0
- {aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/setup.cfg +0 -0
|
@@ -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
|
|
30
|
+
WHERE column_name = 'txid' AND table_schema = 'public' AND table_name !~ '_history$'
|
|
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
|
|
File without changes
|
{aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/requires.txt
RENAMED
|
File without changes
|
{aidbox_python_sdk-0.1.20 → aidbox_python_sdk-0.1.22}/aidbox_python_sdk.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|