Time arithmetic that crosses midnight returns null instead of wrapping

未关闭
#409 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
backend

调研方向

Start by reproducing the three rows of the table in the issue against cql-execution's test-server build, since the payload does not name the source file. Locate where Time addition and subtraction are implemented and find why they return null instead of wrapping past midnight. Done when @T23:30:00 + 1 hour, @T23:30:00 + 30 minutes and @T00:30:00 - 1 hour return the expected wrapped Time values, with a test covering the midnight crossing.

由索引模型根据 Issue 内容生成。

描述

Summary

Add (2.0):

As Time is cyclic, the result of overflowing the time value will be wrapped around the beginning of the day, so that adding 1 hour to @T23:30:00 will result in @T00:30:00 of the previous day, which is consistent with the behavior of DateTime values

(The 2.0 text says "of the previous day". It presumably means the following day. That's a typo in the spec and doesn't change the expected Time.) This sentence is new in 2.0. 1.5.3 doesn't say what happens.

Expression cql-execution Spec (2.0) Java engine 5.8.0
@T23:30:00 + 1 hour null @T00:30:00 @T00:30:00
@T23:30:00 + 30 minutes null @T00:00:00
@T00:30:00 - 1 hour null @T23:30:00 @T23:30:00

Environment

cql-execution master e8096c6, through test-server (the build has two unrelated Quantity modulo commits on top). The Java engine column is HAPI FHIR 9.0.0 with clinical-reasoning 4.17.0, through $cql.

主要语言
JavaScript
星标
86
派生
40
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cqframework/cql-execution 的其他 Issue

查看 cqframework/cql-execution 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。