Adding a UCUM 'mo' or 'a' to a Date or DateTime returns a value instead of an error
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- backend
调研方向
The bug is in how cql-execution adds and subtracts definite-duration UCUM units ('mo', 'a') to Date and DateTime values; the spec requires an error there while 'wk' is allowed. Start by finding the date/time Add and Subtract implementations in the library's source and the Quantity-to-duration conversion they call, then reproduce the three table rows in a small script. Done when the 'mo' and 'a' cases throw an error and 'wk' still returns the expected date, with tests covering both.
由索引模型根据 Issue 内容生成。
描述
Summary
Add for date and time values (1.5.3 and 2.0):
However, to avoid the potential confusion of calendar-based date and time arithmetic with definite-duration date and time arithmetic, it is an error to attempt to add a definite-duration time-valued unit above days (and weeks), a calendar duration must be used.
UCUM 'mo' and 'a' are definite-duration units. The calendar units are month and year. Subtract says the same.
| Expression | cql-execution | Spec | Java engine 5.8.0 |
|---|---|---|---|
@2014-01-01 + 1 'mo' |
@2014-02-01 |
error | error |
@2014-01-01T10:00 + 1 'a' |
@2015-01-01T10:00 |
error | error |
@2014-01-01 + 1 'wk' |
@2014-01-08 |
@2014-01-08 (allowed) |
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 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cqframework/cql-execution 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
cqframework/cql-execution#410 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
cqframework/cql-execution#407 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
cqframework/cql-execution#406 ·
-
难度 3/5 1-2 天 新手友好度 68/100
cqframework/cql-execution#414 ·
-
难度 3/5 1-2 天 新手友好度 72/100
cqframework/cql-execution#413 ·
查看 cqframework/cql-execution 的全部 Issue
相似的 Issue
-
Mend: dependency security vulnerability
难度 2/5 1-3 小时 新手友好度 65/100
ManageIQ/manageiq-ui-service#2259 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
sagemathinc/sagebrush-agent#230 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
electerious/Ackee#411 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
babalae/bettergi-scripts-list#3905 · 1 条评论 ·
维护者通常 1 天内回复