Allow uncertainty arguments for various type casting operations
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- backend
Research direction
Start by reviewing the CQL-to-ELM translator behavior that inserts ToDecimal calls with uncertainties, then compare the listed ToBoolean, ToDate, ToDateTime, ToQuantity, and ToInteger cases with the specification. Done means the supported conversions and their uncertainty behavior are defined and verified without extending ToString.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- JavaScript
- Stars
- 86
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cqframework/cql-execution
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cqframework/cql-execution#410 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cqframework/cql-execution#407 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cqframework/cql-execution#406 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
cqframework/cql-execution#414 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
cqframework/cql-execution#413 ·
All issues in cqframework/cql-execution
Similar issues
-
Mend: dependency security vulnerability
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ManageIQ/manageiq-ui-service#2259 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
sagemathinc/sagebrush-agent#230 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
electerious/Ackee#411 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
babalae/bettergi-scripts-list#3905 · 1 comment ·
Maintainers usually reply within 1 day