diff --git a/fhirpathpy/engine/nodes.py b/fhirpathpy/engine/nodes.py index fa1045c..fe4e32b 100644 --- a/fhirpathpy/engine/nodes.py +++ b/fhirpathpy/engine/nodes.py @@ -179,6 +179,14 @@ def conv_unit_to(fromUnit, value, toUnit): if from_year_month_magnitude and to_year_month_magnitude: return FP_Quantity(from_year_month_magnitude * value / to_year_month_magnitude, toUnit) + elif ( + fromUnit in FP_Quantity._weeks_days_and_time + and toUnit in FP_Quantity._weeks_days_and_time + ): + value_in_seconds = value * FP_Quantity.datetime_multipliers.get(fromUnit) + new_value = value_in_seconds / FP_Quantity.datetime_multipliers.get(toUnit) + return FP_Quantity(new_value, toUnit) + return None