cqframework / cqframework/cqf-tooling

Additional implicit conversions in FHIRHelpers

Open
#370 2 comments 0 reactions 1 assignee View on GitHub

@brynrhodes is already working on this.

Since Jun 17, 2022.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.