Stream: implementers
Topic: profile path
Brian Reinhold (Jul 14 2017 at 11:07):
When making a slice on a choice element what is the correct path (for example on an effective[x] which has an effectiveDateTime or effectivePeriod)?
Should it be for the effectiveDateTime slice of effective[x]?
<path value="Observation.effective[x]" />
or
<path value="Observation.effectiveDateTime" />
then
<path value="Observation.effective[x]" />
or
<path value="Observation.effectivePeriod" />
Thus is this correct (the element ids are just for me to keep track of where I am and there values are not relevant):
<element id="Observation.effective[x]"> <path value="Observation.effective[x]" /> <slicing> <discriminator> <type value="exists" /> <path value="start" /> </discriminator> <rules value="open" /> </slicing> <definition value="The time or time-period the observed value is asserted as being true. It is a time period if a Measurement-Duration attribute is part of the metric measurement sent by the PHD. Otherwise it is the time stamp sent by the PHD or the time of reception by the PHG if the PHD sent no time stamp." /> <min value="1" /> </element> <element id="Observation.effective[x]:dateTimeEffective"> <path value="Observation.effective[x]" /> <sliceName value="dateTimeEffective" /> <comment value="A date and time shall always be present." /> <type> <code value="dateTime" /> </type> </element> <element> <path value="Observation.effective[x]" /> <sliceName value="periodEffective" /> <type> <code value="Period" /> </type> </element> <element id="Observation.effective[x]:periodEffective.start"> <path value="Observation.effective[x].start" /> <min value="1" /> </element> <element id="Observation.effective[x]:periodEffective.end"> <path value="Observation.effective[x].end" /> <min value="1" /> </element>
or is this correct
<element id="Observation.effective[x]"> <path value="Observation.effective[x]" /> <slicing> <discriminator> <type value="exists" /> <path value="start" /> </discriminator> <rules value="open" /> </slicing> <definition value="The time or time-period the observed value is asserted as being true. It is a time period if a Measurement-Duration attribute is part of the metric measurement sent by the PHD. Otherwise it is the time stamp sent by the PHD or the time of reception by the PHG if the PHD sent no time stamp." /> <min value="1" /> </element> <element id="Observation.effective[x]:dateTimeEffective"> <path value="Observation.effectiveDateTime" /> <sliceName value="dateTimeEffective" /> <comment value="A date and time shall always be present." /> <type> <code value="dateTime" /> </type> </element> <element> <path value="Observation.effectivePeriod" /> <sliceName value="periodEffective" /> <type> <code value="Period" /> </type> </element> <element id="Observation.effective[x]:periodEffective.start"> <path value="Observation.effectivePeriod.start" /> <min value="1" /> </element> <element id="Observation.effective[x]:periodEffective.end"> <path value="Observation.effectivePeriod.end" /> <min value="1" /> </element>
Michel Rutten (Jul 14 2017 at 13:38):
Hi @Brian Reinhold, if you constrain a choice type (such as value[x]) to a single datatype, then you should rename the element (e.g. to valueInteger) by updating the element path.
Michel Rutten (Jul 14 2017 at 13:38):
However the element id should always refer to the original element name (ending with "[x]").
Michel Rutten (Jul 14 2017 at 13:39):
So your 2nd example is correct.
Brian Reinhold (Jul 14 2017 at 18:15):
@Michel Rutten Many times the element has no id. Does that matter? Forge doesn't seem to care.
Michel Rutten (Jul 17 2017 at 09:12):
Hi @Brian Reinhold, in FHIR STU3, element ids are mandatory on all element definitions in both differential and snapshot.
Forge can open profiles with missing element ids, as the tool itself does not depend on this information. Forge will automatically generate/complete all missing element ids.
Brian Reinhold (Jul 17 2017 at 10:56):
Hi @Brian Reinhold, in FHIR STU3, element ids are mandatory on all element definitions in both differential and snapshot.
Forge can open profiles with missing element ids, as the tool itself does not depend on this information. Forge will automatically generate/complete all missing element ids.
Actually, that was one of the bugs on saving; the element ids were deleted. I've been editing them by hand but I wasn't sure of the exact format and Forge did not seem to care on loading.
Michel Rutten (Jul 17 2017 at 11:12):
Hi @Brian Reinhold, indeed, the current Forge release has a bug concerning the generation of element ids. This will be fixed in the next release.
Brian Reinhold (Jul 17 2017 at 13:12):
So your 2nd example is correct.
Forge gives me an error on this
<element id="Observation.effective[x]:periodEffective"> <path value="Observation.effectivePeriod"/> <sliceName value="periodEffective"/> <type> <code value="Period"/> </type> <definition value="The time period when there is a Measurement-Duration attribute. The difference between the end and start fields is the value of the Measurement-Duration."/> </element> <element id="Observation.effective[x]:periodEffective.start"> <path value="Observation.effectivePeriod.start"/> <min value="1"/> </element>
but not on this
<element id="Observation.effective[x]:periodEffective"> <path value="Observation.effective[x]" /> <sliceName value="periodEffective" /> <type> <code value="Period"/> </type> <definition value="The time period when there is a Measurement-Duration attribute. The difference between the end and start fields is the value of the Measurement-Duration."/> </element> <element id="Observation.effective[x]:periodEffective.start"> <path value="Observation.effective[x].start" /> <min value="1" /> </element>
is that a bug?
Michel Rutten (Jul 18 2017 at 08:17):
Hi @Brian Reinhold, I'm aware of the reported issues concerning type slicing, haven't had time to investigate yet. But it's high on my TODO list. I'm planning to work on this for the upcoming new release.
Last updated: Apr 12 2022 at 19:14 UTC