Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime function should use time zone of the evaluation request #1420

Closed
brynrhodes opened this issue Oct 3, 2024 · 1 comment · Fixed by #1423
Closed

DateTime function should use time zone of the evaluation request #1420

brynrhodes opened this issue Oct 3, 2024 · 1 comment · Fixed by #1423
Assignees
Labels

Comments

@brynrhodes
Copy link
Member

The following expression:

DateTime(2024, 10, 3, 15, 54, 0, 0)

should result in a DateTime value with the timezone offset of the evaluation request: https://cql.hl7.org/09-b-cqlreference.html#datetime-1

However, looking at the code, the local timezone is always used:

https://github.com/cqframework/clinical_quality_language/blob/master/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/runtime/DateTime.java#L94

@antvaset
Copy link
Contributor

antvaset commented Oct 8, 2024

Hi @brynrhodes, I've added tests for this here: #1423

It looks like it picks up the timezone offset of the evaluation request as per the spec.

When you call engine.expression(...) or engine.evaluate(...) you have to pass in the evaluation date time explicitly every time, otherwise it gets reset to ZonedDateTime.now().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants