Stream: implementers
Topic: Example of conditional elements
Sean McIlvenna (Feb 27 2019 at 19:02):
I'm looking for an example on how to use a slice to say "either X or Y". I believe this is done using ElementDefinition.condition, but I'm not seeing any documentation explaining how to use .condition. Can someone point me in the right direction?
Lloyd McKenzie (Feb 27 2019 at 19:12):
Not sure why you need a slice at all. You want ElementDefinition.constraint. ElementDefinition.condition allows children of the element that has the constraint to indicate that they're impacted by the constraint. For example, if you put a constraint on the Patient node saying "there must either be a name or birthDate", you would put a condition on the name and birthDate elements that points back to the constraint as a flag that says "there are special rules about whether I'm allowed to/must appear"
Sean McIlvenna (Feb 27 2019 at 21:06):
Do you have an example of what you're describing?
Lloyd McKenzie (Feb 27 2019 at 22:08):
Look at the constraints on Patient.contact (they didn't put 'condition' everywhere that they should, but they did put it on organization)
Last updated: Apr 12 2022 at 19:14 UTC