From 83f8dd6fceea3086ab7b2f39ae4c711d7f3230f6 Mon Sep 17 00:00:00 2001 From: Nikita Tretyakov Date: Fri, 12 Jul 2024 18:07:11 +0200 Subject: [PATCH] Reset system time constant between expression evaluations --- fhirpathpy/engine/invocations/constants.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fhirpathpy/engine/invocations/constants.py b/fhirpathpy/engine/invocations/constants.py index 6643d5d..7ecb798 100644 --- a/fhirpathpy/engine/invocations/constants.py +++ b/fhirpathpy/engine/invocations/constants.py @@ -7,11 +7,15 @@ class SystemTime: expression. It remains the same for the entire expression evaluation. """ - expressionExecutionDateTime = datetime.now() + def __init__(self) -> None: + self.expressionExecutionDateTime = datetime.now() def now(self): return self.expressionExecutionDateTime + def reset(self): + self.expressionExecutionDateTime = datetime.now() + class Constants: """ @@ -30,6 +34,7 @@ def reset(self): self.now = None self.timeOfDay = None self.localTimezoneOffset = None + systemtime.reset() constants = Constants()