FHIR Chat · When to use slicing/discriminators in profiles · implementers

Stream: implementers

Topic: When to use slicing/discriminators in profiles


view this post on Zulip Brian Reinhold (Jun 23 2017 at 18:10):

I may be making life difficult for myself by trying to slice a field when it may not be necessary. In my profile I have two types of Observation resources that need to be referenced in an Observation in certain cases. One is a what I call a CoincidentTimeStamp Observation and the second is an Observation that is pointed to when the measurement being mapped contains a source-handle-reference. So without discussing the nitty-gritty details of what these thing are, how should I do this?
1. Slice the related element into a CoincidentTimeStampRelated, SourceHandleReferenceRelated, and applicationRelated cases or
2. Simply state that when a CoincidentTimeStamp Observation needs to be referenced it goes here and likewise with any source handle reference observations.

"1" appears cleaner and more concise but then I am somewhat at a loss as to a way of providing a discriminator.Proper use of discriminators in profiling is not always clear. THe Forge tool allows the use of the element id but I was told this is not good. However, it seems a great way of doing it because I would simply set the id to the name of the slice like coincidentTimeStampRelated. Thoughts from profiling experts?

view this post on Zulip Grahame Grieve (Jun 23 2017 at 21:55):

why are you trying to have a discriminator? what is your purpose to achieve?

view this post on Zulip Eric Haas (Jun 24 2017 at 00:19):

sounds like you have invariants that dictate which Observation is used.

if condition A then used .related.target --> Observation Profile A
if condition B then used .related.target --> Observation Profile B

Not sure slicing is needed here.


Last updated: Apr 12 2022 at 19:14 UTC