Open brynrhodes opened 2 years ago
Note that this issue arises in the context of addressing this issue: https://github.com/cqframework/clinical_quality_language/issues/761
The fix for the FHIRModelInfo and FHIRHelpers.cql is already applied as part of the fix for that.
This issue is to track to make sure that these additional conversions get added to the FHIRModelInfo generation logic.
On second thought, don't do this. It introduces ambiguities with other conversions, consider:
Patient.birthDate + 1 day
If the FHIR.date value can be converted to both a System.Date and a System.DateTime, the date arithmetic becomes ambiguous with Add(Date, Quantity)
and Add(DateTime, Quantity
.
Consider the following expression:
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:
These need to be reflected in the ModelInfo as ConversionInfo as well: