FHIR Chat · example of a FSH Bundle Profile · shorthand

Stream: shorthand

Topic: example of a FSH Bundle Profile


view this post on Zulip John Moehrke (Nov 24 2020 at 17:16):

I am looking to profile Bundle in FSH. Would like to understand by way of an example. Is there someone who has done this for an Operation? or a FHIR-Document?

view this post on Zulip John Moehrke (Nov 24 2020 at 19:49):

How do I profile the contents of the bundle? How do I indicate that the Bundle.entry.resource must be of Profile XYZ?

view this post on Zulip Chris Moesel (Nov 24 2020 at 20:29):

You might want to take a look at mCODE's mCODE Patient Bundle as an example. Relevant FSH here and here.

view this post on Zulip John Moehrke (Nov 24 2020 at 21:01):

I think that took me further, but not far enough
"

  • entry ^slicing.discriminator.type = #profile
  • entry ^slicing.discriminator.path = "resource"
  • entry ^slicing.rules = #open
  • entry ^slicing.description = "Slicing based on the profile conformance of the entry"
  • entry and entry.resource MS
  • entry contains Patient 1..1 MS and MHVcompositionBluebutton 1..1 MS
  • entry[MHVcompositionBlueButton].resource only MHVcompositionBluebutton
  • entry[Patient].resource only Patient
    "
    gives me a sushi error

    Sushi: error No element found at path entry[MHVcompositionBlueButton].resource for MHVbluebutton, skipping rule (00:02.0488)

view this post on Zulip David Pyke (Nov 24 2020 at 21:09):

Where have you defned the Profile names?

view this post on Zulip Elliot Silver (Nov 24 2020 at 21:10):

You're using MHVcompositionBlueButton, as well as MHVcompositionBluebutton. Is that intentional? ("B" in button).

view this post on Zulip John Moehrke (Nov 24 2020 at 21:15):

I just saw that... sorry

view this post on Zulip Elliot Silver (Nov 24 2020 at 21:17):

Is that the issue?

view this post on Zulip John Moehrke (Nov 24 2020 at 21:18):

yes that was that issue

view this post on Zulip John Moehrke (Nov 24 2020 at 21:18):

next problem is that my example is not validating

view this post on Zulip John Moehrke (Nov 24 2020 at 21:18):

well, sushi doesn't like my example
'''
Sushi: error Element Bundle.entry:Patient has minimum cardinality 1 but occurs 0 time(s). (00:05.0182)
Sushi: File: C:\Users\john.moehrke\Git\MHV-PGHD\input\fsh\ex-MHV-bluebutton.fsh (00:05.0183)
Sushi: Line: 1 - 12 (00:05.0184)
Sushi: error Element Bundle.entry:MHVcompositionBluebutton has minimum cardinality 1 but occurs 0 time(s). (00:05.0185)
Sushi: File: C:\Users\john.moehrke\Git\MHV-PGHD\input\fsh\ex-MHV-bluebutton.fsh (00:05.0186)
Sushi: Line: 1 - 12 (00:05.0188)
'''

view this post on Zulip David Pyke (Nov 24 2020 at 21:21):

Where can we see the code?

view this post on Zulip Chris Moesel (Nov 24 2020 at 23:04):

@John Moehrke -- SUSHI is a little opinionated about how it wants you to author the example. In order to keep it happy, you should always reference the sliced entries by their names. E.g.,

* entry[Patient].fullUrl = "http://foo.org/bar/Patient/123"

SUSHI isn't very sophisticated, so it only knows you used a slice if you used it by name.

view this post on Zulip John Moehrke (Nov 25 2020 at 00:20):

Thanks. Dave helped me with that too


Last updated: Apr 12 2022 at 19:14 UTC