FHIR Chat · How to represent if-and-only-if and check against profiles · fhirpath

Stream: fhirpath

Topic: How to represent if-and-only-if and check against profiles


view this post on Zulip Jean Duteau (Aug 21 2020 at 07:36):

I have a constraint where I want to say: Bundle.entry.resource is of profile X if-and-only-if there is another Bundle.entry.resource of profile Y
I think I can do this as:
(Bundle.entry.exists(resource is X) implies Bundle.entry.exists(resource is Y)) and (Bundle.entry.exists(resource is Y) implies Bundle.entry.exists(resource is X))

When I use that as a constraint, it appears to always return true. I think my propositional logic is correct, so maybe resource is X doesn't work for profiles? I'm still reading the FHIRPath spec, so I may find my answer but I thought I'd ask here as well.

view this post on Zulip Jean Duteau (Aug 21 2020 at 07:42):

okay, i think my problem is that you can't do "Resource is X" where X is the name of a profile. That would explain why my constraint always returns true since there resource is X always returns an empty collection. Back to the drawing board for me!

view this post on Zulip Richard Townley-O'Neill (Aug 24 2020 at 04:59):

conformsTo(structure : string) : Boolean

view this post on Zulip Brian Postlethwaite (Sep 06 2020 at 12:54):

(Bundle.entry.exists(resource is X) = Bundle.entry.exists(resource is Y)


Last updated: Apr 12 2022 at 19:14 UTC