Stream: questionnaire
Topic: fhir evaluation
Sravanti Cherukuri (May 26 2021 at 15:43):
How to write expression to check if list with multiple values contains another list of values
Brian Postlethwaite (May 26 2021 at 15:44):
As in checking are all values in something?
Brian Postlethwaite (May 26 2021 at 15:52):
Is this what you're looking for?
image.png
image.png
Sravanti Cherukuri (May 26 2021 at 15:53):
["Peter","James"] in ["Peter","John"] should evaluate to true
["Peter","James"] in ["Peter","John","James"] should evaluate to true
["Peter","James"] not in ["Peter","John"] should evaluate to false
["Peter","James"] not in ["John"] should evaluate to true
these scenarios Brian
Brian Postlethwaite (May 26 2021 at 15:57):
https://build.fhir.org/ig/HL7/FHIRPath/#symbols
the [
isn't a part of the fhirpath syntax (it is the array indexer only - not set/collection definition characters).
('a' | 'b' | 'c')
is a list of strings
Brian Postlethwaite (May 26 2021 at 16:04):
('a' | 'b' | 'c').any($this in ('a' | 'b' | 'c')).not()
Sravanti Cherukuri (May 26 2021 at 17:11):
thanks much Brian
Sravanti Cherukuri (May 31 2021 at 16:54):
('a' | 'b' | 'c').any($this in ('a' | 'b' | 'c')).not()
image.png
Lloyd McKenzie (May 31 2021 at 21:51):
@Paul Lynch
Paul Lynch (Jun 01 2021 at 14:19):
I don't see a definition of "any" in the FHIRPath specification. Maybe you want "where"?
Brian Postlethwaite (Jun 01 2021 at 22:22):
Looks like I made a mistake on the function name there. Check the fhirpath spec there are a few set based operators too
Last updated: Apr 12 2022 at 19:14 UTC