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

What to do with equality/comparisons etc. #2936

Open
ewoutkramer opened this issue Oct 18, 2024 · 2 comments
Open

What to do with equality/comparisons etc. #2936

ewoutkramer opened this issue Oct 18, 2024 · 2 comments
Assignees

Comments

@ewoutkramer
Copy link
Member

We have tons of comparison operations, duplicated between operations on the POCOs and on the CQL types. Can we make up our mind and implement them on one or the other?

  • We can convert any primitive FHIR type to the CQL type, and the CQL type have the comparison operations
  • We could assume all IScopedNode trees end in a standard FHIR POCO datatype, and then we can call the operators on those types.
@ewoutkramer
Copy link
Member Author

One way of looking at it, is that the FHIR spec does not define equality and comparisons on the datatypes, it only talks about it for some very specific applications:

  • When comparing a fixed/pattern value in an ElementDefinition while doing validation. The description is very unspecific and cannot be interpreted as the definition of equality for all the datatypes.
  • When doing a search (see date for an example) - this is clearly specific to matching while doing a search, since it is described in terms of search token types, not FHIR datatypes.

So, the only sources for equality are those of FhirPath and CQL, which are aligned, and for which the CQL spec is the more elaborate. We have implemented those equalities in the System/Cql/FhirPath (;-)) types.

This suggests that we might not pretend to have equality/comparisons for the FHIR types themselves at all, so we should remove those (I think we have them only for dates anyway). We may still assume fixed/pattern matching is done using the corresponding IsExactly and Matches on the POCO's since those methods were written for exactly that purpose.

@ewoutkramer
Copy link
Member Author

Ok, after a few hours of thinking, I think we should upgrade the type of Value for Date/Time/DateTIme to the CQL types (that's already done internally, but we couldn't change the Value prop) and ditch the operators.

Work on #2781 may influence what this means for Value/ObjectValue in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant