Adding a UCUM 'mo' or 'a' to a Date or DateTime returns a value instead of an error

Abierto
#408 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
86
Forks
40
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cqframework/cql-execution

Todos los issues de cqframework/cql-execution

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.