Skip to content

Commit ab068e0

Browse files
committed
update example project
1 parent ba99399 commit ab068e0

File tree

4 files changed

+66
-8
lines changed

4 files changed

+66
-8
lines changed

example/backend/env_tests/aidbox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PGUSER=postgres
1212
PGPASSWORD=postgres
1313

1414
BOX_PROJECT_GIT_TARGET__PATH=/aidbox-project
15-
AIDBOX_ZEN_PATHS=path:package-zip:/aidbox-project/zen-package.zip
15+
AIDBOX_ZEN_PATHS=path:package-dir:/aidbox-project
1616
AIDBOX_ZEN_ENTRYPOINT=main/box
1717
AIDBOX_DEV_MODE=true
1818
AIDBOX_ZEN_DEV_MODE=true

example/backend/poetry.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package-mode = false
88

99
[tool.poetry.dependencies]
1010
python = "^3.12"
11-
aidbox-python-sdk = "^0.1.17"
11+
aidbox-python-sdk = "^0.1.21"
1212
gunicorn = "^23.0.0"
1313
fhirpy = "^2.0.15"
1414
fhirpy-types-r4b = "^0.1.1"

example/backend/tests/test_db_isolation.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,61 @@ async def test_database_isolation__2(fhir_client: AsyncFHIRClient, safe_db: Safe
2323

2424
patients = await fhir_client.resources(r4b.Patient).fetch_all()
2525
assert len(patients) == 2 # noqa: PLR2004
26+
27+
28+
async def test_database_isolation_with_history_in_name__1(aidbox_client, safe_db):
29+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
30+
assert len(resources) == 0
31+
32+
resource = aidbox_client.resource(
33+
"FamilyMemberHistory",
34+
status="completed",
35+
patient={
36+
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-1"}
37+
},
38+
relationship={
39+
"coding": [
40+
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "FTH"}
41+
]
42+
},
43+
)
44+
await resource.save()
45+
46+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
47+
assert len(resources) == 1
48+
49+
50+
async def test_database_isolation_with_history_in_name__2(aidbox_client, safe_db):
51+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
52+
assert len(resources) == 0
53+
54+
resource1 = aidbox_client.resource(
55+
"FamilyMemberHistory",
56+
status="completed",
57+
patient={
58+
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-1"}
59+
},
60+
relationship={
61+
"coding": [
62+
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "FTH"}
63+
]
64+
},
65+
)
66+
await resource1.save()
67+
68+
resource2 = aidbox_client.resource(
69+
"FamilyMemberHistory",
70+
status="completed",
71+
patient={
72+
"identifier": {"system": "http://example.org/test-patients", "value": "test-patient-2"}
73+
},
74+
relationship={
75+
"coding": [
76+
{"system": "http://terminology.hl7.org/CodeSystem/v3-RoleCode", "code": "MTH"}
77+
]
78+
},
79+
)
80+
await resource2.save()
81+
82+
resources = await aidbox_client.resources("FamilyMemberHistory").fetch_all()
83+
assert len(resources) == 2

0 commit comments

Comments
 (0)