Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ofTypeEqual and use in generated constraints #4020

Open
lmsurpre opened this issue Oct 13, 2022 · 1 comment
Open

Introduce ofTypeEqual and use in generated constraints #4020

lmsurpre opened this issue Oct 13, 2022 · 1 comment
Labels
P3 Priority 3 - Nice To Have

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Oct 13, 2022

I'm wondering if we should also introduce ofTypeEqual and use that in our generated expressions instead of asTypeEqual.

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:

If there is more than one item in the input collection, the evaluator will throw an error.

Furthermore, the spec lists the as function as deprecated, although I think its more to favor the as operator instead (which is not retired).

Anyway, I think most of those expressions and FHIRPath constraints should probably be using the ofType function instead of as.

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 introduce ofTypeEqual and use that instead of asTypeEqual in our generated constraints.

Originally posted by @lmsurpre in #3974 (comment)

@lmsurpre
Copy link
Member Author

lmsurpre commented Oct 13, 2022

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

@lmsurpre lmsurpre added the P3 Priority 3 - Nice To Have label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Priority 3 - Nice To Have
Projects
None yet
Development

No branches or pull requests

1 participant