Skip to content

Commit

Permalink
Filter out intenal representation of primitive extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ir4y committed Jan 8, 2024
1 parent 8dec2f5 commit 96e9799
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fhirpathpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@ def visit(node):
data = get_data(node)

if isinstance(node, list):
return [visit(item) for item in data]
res = []
for item in data:
# Filter out intenal representation of primitive extensions
i = visit(item)
if isinstance(i, dict):
keys = list(i.keys())
if keys == ["extension"]:
continue
res.append(i)
return res

if isinstance(data, dict) and not isinstance(data, FP_Type):
for key, value in data.items():
Expand Down

0 comments on commit 96e9799

Please sign in to comment.