Open lmsurpre opened 1 year ago
Here is a JIRA issue I opened for the dicrepency between the FHIRPath as
definition and its usage in FHIR: https://jira.hl7.org/browse/FHIR-25188
Although you can see that they are also starting to fix some of the expressions to favor ofType
over as
:
https://github.com/HL7/fhir/pull/2395/files
https://github.com/HL7/fhir/pull/2549/files
I'm wondering if we should also introduce
ofTypeEqual
and use that in our generated expressions instead ofasTypeEqual
.The background on this one is pretty interesting: many of the fhirpath expressions in the base spec (and a few of the constraints) use the fhirpath
as
function to convert a list of input items to a filtered list of output items of a given type (or subtypes).However, the official
as
documentation says this about it:Furthermore, the spec lists the
as
function as deprecated, although I think its more to favor theas
operator instead (which is not retired).Anyway, I think most of those expressions and FHIRPath constraints should probably be using the
ofType
function instead ofas
.I think its too much of a breaking change to make our
as
function spec compliant at this point, however I do think that we could introduceofTypeEqual
and use that instead ofasTypeEqual
in our generated constraints.Originally posted by @lmsurpre in https://github.com/LinuxForHealth/FHIR/issues/3974#issuecomment-1276971570