Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/backend/env_tests/aidbox
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PGUSER=postgres
PGPASSWORD=postgres

BOX_PROJECT_GIT_TARGET__PATH=/aidbox-project
AIDBOX_ZEN_PATHS=path:package-zip:/aidbox-project/zen-package.zip
AIDBOX_ZEN_PATHS=path:package-dir:/aidbox-project
AIDBOX_ZEN_ENTRYPOINT=main/box
AIDBOX_DEV_MODE=true
AIDBOX_ZEN_DEV_MODE=true
Expand Down
12 changes: 6 additions & 6 deletions example/backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package-mode = false

[tool.poetry.dependencies]
python = "^3.12"
aidbox-python-sdk = "^0.1.17"
aidbox-python-sdk = "^0.1.21"
gunicorn = "^23.0.0"
fhirpy = "^2.0.15"
fhirpy-types-r4b = "^0.1.1"
Expand Down
58 changes: 58 additions & 0 deletions example/backend/tests/test_db_isolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,61 @@ async def test_database_isolation__2(fhir_client: AsyncFHIRClient, safe_db: Safe

patients = await fhir_client.resources(r4b.Patient).fetch_all()
assert len(patients) == 2 # noqa: PLR2004


async def test_database_isolation_with_history_in_name__1(aidbox_client, safe_db):
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
assert len(resources) == 0

resource = aidbox_client.resource(
"FamilyMemberHistory",
status="completed",
patient={
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-1"}
},
relationship={
"coding": [
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "FTH"}
]
},
)
await resource.save()

resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
assert len(resources) == 1


async def test_database_isolation_with_history_in_name__2(aidbox_client, safe_db):
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
assert len(resources) == 0

resource1 = aidbox_client.resource(
"FamilyMemberHistory",
status="completed",
patient={
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-1"}
},
relationship={
"coding": [
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "FTH"}
]
},
)
await resource1.save()

resource2 = aidbox_client.resource(
"FamilyMemberHistory",
status="completed",
patient={
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-2"}
},
relationship={
"coding": [
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "MTH"}
]
},
)
await resource2.save()

resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
assert len(resources) == 2
Loading