Allow uncertainty arguments for various type casting operations

Aperta
#225 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
backend

Direzione di ricerca

Inizia esaminando il comportamento del traduttore CQL-to-ELM che inserisce chiamate a ToDecimal con incertezze, quindi confronta i casi elencati di ToBoolean, ToDate, ToDateTime, ToQuantity e ToInteger con la specifica. Il lavoro è completato quando le conversioni supportate e il relativo comportamento con le incertezze sono definiti e verificati, senza estendere ToString.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This is an interesting one. Looking at the spec, ToDecimal only accepts a Boolean or a String, neither of which can be expressed as an uncertainty. But I see that the test cases you created cause the CQL-to-ELM translator to automatically insert a ToDecimal call, passing in an uncertainty -- so it seems the translator may invoke things technically not in the spec!

I guess we probably should support something like this for some of the other ToXXX functions, particularly those that can take an argument that can be represented by an Uncertainty. That would be:

ToBoolean(argument Decimal) Boolean
ToBoolean(argument Integer) Boolean
ToDate(argument DateTime) Date
ToDateTime(argument Date) DateTime
ToQuantity(argument Decimal) Quantity
ToQuantity(argument Integer) Quantity

I think I would also add ToInteger, because I think the translator maybe would use something like that to try to convert a Decimal to an Integer.

I left toString off the list because the spec does not define how to translate and uncertainty to a String and it also says that the string must be "round-trippable" back to its original type.

All the said, I think it's outside the scope of this task. So I'd suggest we create another bug to track it.

Originally posted by @cmoesel in https://github.com/cqframework/cql-execution/pull/222#discussion_r577873597

Lingua principale
JavaScript
Stelle
84
Fork
41
Merge medio
5g 4h
PR unite (30g)
3

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cqframework/cql-execution

Tutte le issue di cqframework/cql-execution

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.