Skip to content

Commit

Permalink
Update equality
Browse files Browse the repository at this point in the history
  • Loading branch information
atuonufure committed Jan 15, 2024
1 parent 1f08f79 commit 305f714
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fhirpathpy/engine/invocations/equality.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ def equality(ctx, x, y):
a = util.parse_value(x[0])
b = util.parse_value(y[0])

if isinstance(a, nodes.FP_Quantity) and isinstance(b, nodes.FP_Quantity):
y_unit = getattr(b, 'unit', None)
if y_unit in nodes.FP_Quantity.mapUCUMCodeToTimeUnits.values():
return a.deep_equal(b)
if (
isinstance(a, nodes.FP_Quantity)
and isinstance(b, nodes.FP_Quantity)
and getattr(b, "unit", None) in nodes.FP_Quantity.mapUCUMCodeToTimeUnits.values()
):
return a.deep_equal(b)

return a == b

Expand Down

0 comments on commit 305f714

Please sign in to comment.