FHIR Chat · What is the different between Matches() and IsExactly() · dotnet

Stream: dotnet

Topic: What is the different between Matches() and IsExactly()


view this post on Zulip Yunwei Wang (Oct 23 2018 at 04:34):

From reading the code, I think these two methods do the same thing. Is that correct?

view this post on Zulip Brian Postlethwaite (Oct 23 2018 at 08:19):

One is like an equLs, where the other is a pattern match.

view this post on Zulip Yunwei Wang (Oct 23 2018 at 13:13):

@Brian Postlethwaite What does the pattern match mean? Can you give an example

view this post on Zulip Brian Postlethwaite (Oct 24 2018 at 00:52):

A.IsEqual(B) implies that B.isEqual(A)
However A Matches B does not imply that B Matches A

view this post on Zulip Ewout Kramer (Oct 24 2018 at 09:04):

@Brian Postlethwaite What does the pattern match mean? Can you give an example

It's the kind of matching done by pattern[x] in ElementDefinition: http://hl7.org/fhir/elementdefinition-definitions.html#ElementDefinition.pattern_x_

Though I can see the description there lacks detail too. In general, the difference is that if your pattern contains e.g. a CodeableConcept with just one code, it would match a CodeableConcept with multiple (as long as your code matches one of those codes), and it would also match a CodeableConcept that in addition has "text", even when your pattern does not have text. Much like "Query by Example" (https://en.wikipedia.org/wiki/Query_by_Example)


Last updated: Apr 12 2022 at 19:14 UTC