Skip to content

Commit 0afa071

Browse files
committed
updated fhir results structure
1 parent 4a11ef5 commit 0afa071

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

jupyterhealth_client/_client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,8 @@ def _fhir_list_api_request(
159159
while True:
160160
new_records = False
161161
requests += 1
162-
for entry in r:
163-
# entry seems to always be a dict with one key?
164-
if isinstance(entry, dict) and len(entry) == 1:
165-
# return entry['resource'] which is ~always the only thing
166-
# in the list
167-
entry = list(entry.values())[0]
162+
for result in r["results"]:
163+
entry = result["resource"]
168164
if entry["id"] in seen_ids:
169165
# FIXME: skip duplicate records
170166
# returned by server-side pagination bugs

0 commit comments

Comments
 (0)