cqframework / cqframework/cqf-tooling
Additional implicit conversions in FHIRHelpers
@brynrhodes is already working on this.
Since Jun 17, 2022.
- Dominant language
- Java
- Stars
- 22
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following expression:
Patient.birthDate < Now()
There are two implicit conversions happening here, one from the birthDate to a System.Date and one from a System.Date to a System.DateTime. CQL intentionally does not support transitive implicit conversion, and so this expression fails. However, the FHIRPath engines already do this because they are handling the conversions at run-time.
Define additional implicit conversions in FHIR helpers to account for implicit conversions defined in CQL types as well:
define function ToDateTime(value date): ToDateTime(value.value)
define function ToDecimal(value integer): ToDecimal(value.value)
These need to be reflected in the ModelInfo as ConversionInfo as well:
<conversionInfo functionName="FHIRHelpers.ToDateTime" fromType="FHIR.date" toType="System.DateTime"/>
<conversionInfo functionName="FHIRHelpers.ToDecimal" fromType="FHIR.integer" toType="System.Decimal"/>
Contributor 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.
Assessment
This issue has not been assessed yet.