FHIR Chat · slicing · conformance

Stream: conformance

Topic: slicing


view this post on Zulip Keith Boone (May 17 2016 at 06:16):

How does one slice a value[x] by data type? What discriminator would you use?

view this post on Zulip Keith Boone (May 17 2016 at 08:22):

I'm trying to slice something by type, but cannot seem to get it to work on observation. Anyone here have any words of wisdom. The error I'm getting is: Attempt to a slice an element that does not repeat: Observation.value[x]/null from http://hl7.org/fhir/StructureDefinition/CodeableConcept but my use of value[x] only includes Quantity | string.

view this post on Zulip Grahame Grieve (May 17 2016 at 09:57):

discriminator should be @type per the profiling page in the spec

view this post on Zulip Keith Boone (May 17 2016 at 13:45):

Yep, set that, still getting the above error.

view this post on Zulip Keith Boone (May 17 2016 at 13:45):

 [java] Caused by: org.hl7.fhir.dstu3.exceptions.DefinitionException: Attempt to a slice an element that does not repeat: Observation.value[x]/null from http://hl7.org/fhir/StructureDefinition/CodeableConcept
 [java]     at org.hl7.fhir.dstu3.utils.ProfileUtilities.processPaths(ProfileUtilities.java:402)
 [java]     at org.hl7.fhir.dstu3.utils.ProfileUtilities.generateSnapshot(ProfileUtilities.java:309)
 [java]     at org.hl7.fhir.definitions.generators.specification.ProfileGenerator.generate(ProfileGenerator.java:793)
 [java]     at org.hl7.fhir.definitions.generators.specification.ProfileGenerator.generate(ProfileGenerator.java:714)

view this post on Zulip Keith Boone (May 17 2016 at 13:46):

What is confusing is that CodeableConcept ISN'T one of the data types I've profiled Observation.value[x] to.

view this post on Zulip Grahame Grieve (May 17 2016 at 19:30):

I'll try and look it tomorrow

view this post on Zulip Keith Boone (May 17 2016 at 23:27):

Cannot slice by type when base cardinality is 0..1, although I can see where it might be useful to look at those as slices. I worked around it elsewhere.

view this post on Zulip Grahame Grieve (May 17 2016 at 23:42):

I've done it elsewhere - sliced by type

view this post on Zulip Grahame Grieve (May 17 2016 at 23:43):

have alook at the DAF profile on condition

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:02):

[apologies if this is the wrong stream; happy to re-post elsewhere]
In the BP slicing example http://build.fhir.org/profiling-examples.html#blood-pressure , could i then extend it with a PosturedBP a la:?

  <element> <!-- 8 -->
    <path value="Observation.component"/>
    <name value="diastolic"/> <!-- mandatory - gives the slice a name -->
    <min value="1"/>
    <max value="1"/>
  </element>
  <element> <!-- 9 -->
    <path value="Observation.component.code"/>
    <min value="1"/>
    <fixedCodeableConcept>
      <coding>
        <system value="http://snomed.info/sct" />
        <code value="9851009" />
        <display value="Body position" />
      </coding>
    </fixedCodeableConcept>
  </element>
  <element> <!-- 10 -->
    <path value="Observation.component.valueQuantity"/>
    <min value="1"/>
  </element>

view this post on Zulip Grahame Grieve (Nov 21 2017 at 09:09):

yes, because the slicing rules do not say that the slices are closed

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:12):

Also in the BP slicing example http://build.fhir.org/profiling-examples.html#blood-pressure , there are seven <element/> decls (using regex {} notation for cardinalities):
1. discriminator="code" {2,}
2. name="systolic" {1,1}
3. fixedCodeableConcept/coding/code="8480-6" {1,}
4. valueQuantity {1,}
5. name="diastolic" {1,1}
6. fixedCodeableConcept/coding/code="8462-4" {1,}
7. valueQuantity {1,}
(I assume 1. is in the FHIR Observation core resource and 2-7 are in a profile that extends it)
What associates e.g. 3 and 4 with 2? Is is just that they come in threes?

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:28):

is there a better stream for validation stuff?

view this post on Zulip Grahame Grieve (Nov 21 2017 at 09:32):

no this is the place- I just haven't had time to think about that one yet

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:33):

I'm examining this 'cause I'm working on the inheritance model for ShEx. I'm modeling it on XML Schema's separation of extension vs. restriction.

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:35):

1 seems like a base constraint. (2-4) and (5-7) seem like restrictions on that and my proposed PosturedBP seems like an extension of BP.

view this post on Zulip Grahame Grieve (Nov 21 2017 at 09:35):

we don't have that in FHIR - everything is additional.

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:37):

does that mean that (2-4) and (5-7) don't have to comply with (1), i.e. they needn't have a code if they didn't happen to mention one?

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:39):

or maybe discriminator= is sort of a special case that infects everything with the same path (but that smells a lot like restriction)

view this post on Zulip Grahame Grieve (Nov 21 2017 at 09:39):

discriminator is special. It's orthogonal to the constraint model - an extra layer of rules. What that says is that each of the slices must be distinguished by the fixed value(s) for code

view this post on Zulip Grahame Grieve (Nov 21 2017 at 09:40):

so yes, a special case, and yes, a restriction of sorts, but actually a meta-restriction, if you want to be precise - a constraint on the model, not the instances

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:43):

and that can be applied by a core resource or any in a chain of derivative profiles?

view this post on Zulip Grahame Grieve (Nov 21 2017 at 09:45):

it could, though the only discriminator we would ever apply in the base resource is on extension, which are always at least discriminated by url

view this post on Zulip Grahame Grieve (Nov 21 2017 at 09:45):

derivative profiles must also observe the rules of anything they derive from

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:49):

the prob i'm having with the "all are extensions" notion is that (1) seems like it's saying that anything derived must have two or more components and (2-4), (5-7) must be talking about those same components or we'd have have to create BP instances with a systolic, a diastolic and two more components.

view this post on Zulip Eric Prud'hommeaux (Nov 21 2017 at 09:57):

so it seems like the (8-10) i uttered first (PostureBP) are extending the package of (2-4),(5-7) while they in turn are constraining (1) (and probably (0) if we assume a fhir:Observation provides a minimalistic constraint on component {0,})

view this post on Zulip Grahame Grieve (Nov 21 2017 at 10:00):

you can add slices in derived profiles. Whether they extend 2-4 or 5-7 or are new depends on the slice names

view this post on Zulip Richard Townley-O'Neill (Nov 24 2017 at 01:34):

Is it that 3 and 4 are associated with 2 because of the values of pathidentify a hierarchy?
1 - <path value="Observation.component"/>
2 - <path value="Observation.component"/>
3 - <path value="Observation.component.code"/>
4 - <path value="Observation.component.valueQuantity"/>
5 - <path value="Observation.component"/>
6 - <path value="Observation.component.code"/>
7 - <path value="Observation.component.valueQuantity"/>

view this post on Zulip Ewout Kramer (Nov 28 2017 at 09:57):

Yes, indeed. The hierarchy get a bit hidden by the flat representation, but mentally I consider 2-4 children of 1 and 3-4 children of 2.


Last updated: Apr 12 2022 at 19:14 UTC