FHIR Chat · Forge example to slice element inside datatype · implementers

Stream: implementers

Topic: Forge example to slice element inside datatype


view this post on Zulip Joel Francis (Feb 13 2018 at 15:51):

Hi.

I am using the Forge editor 16.5.1 to create a profile for the Patient resource. I would like to create an extension for the "line" element in the Address datatype.
The extension would have a cardinality of 0...9 and will be sliced based on the uri. I've attached a sample of what I'm trying to achieve

I am able to create an extension but unable to slice the extension to create the 9 slices based on the uri. The slice button seems to be grayed out.

It would be helpful to get some clarity on the "kind", "context:" and "derivation" elements and when it is appropriate to use a certain value from the drop down.

Any help or advice is appreciated.

Sample.png

Thanks,

Joel

view this post on Zulip Lloyd McKenzie (Feb 13 2018 at 18:14):

@Michel Rutten ?

view this post on Zulip Simone Heckmann (Feb 13 2018 at 18:37):

Why the slicing? Why not just add 9 optional extensions to Address.line?

view this post on Zulip Simone Heckmann (Feb 13 2018 at 18:37):

You need to be able to use them in any order, I guess?

view this post on Zulip Lloyd McKenzie (Feb 13 2018 at 19:26):

Extensions are unordered

view this post on Zulip Grahame Grieve (Feb 13 2018 at 20:10):

extensions are implicitly sliced?

view this post on Zulip Joel Francis (Feb 13 2018 at 20:41):

@Lloyd McKenzie , @Simone Heckmann , @Grahame Grieve , though order is important and I can see easily visualize Simone's suggestion to just add 9 extensions to Address.line, if an extension is implicitly sliced and in regards to what I am trying to achieve, does this mean we are leaning towards extension of an extension and if so how would that look?

I cannot see to wrap my head around slicing by uri since the extension also needs its own uri as opposed to creating 9 different extensions (each having distinct uris) or is this not possible? Any visual example would greatly help.

view this post on Zulip Simone Heckmann (Feb 13 2018 at 22:06):

Maybe this helps: We've added multiple extensions to HumanName.family:
https://simplifier.net/BasisprofilDE/humanname-de-basis

view this post on Zulip Simone Heckmann (Feb 13 2018 at 22:12):

...come to think of it ... maybe our profile of Address is much closer to your use case :)
https://simplifier.net/BasisprofilDE/address-de-basis

view this post on Zulip Joel Francis (Feb 14 2018 at 13:22):

...come to think of it ... maybe our profile of Address is much closer to your use case :)
https://simplifier.net/BasisprofilDE/address-de-basis

@Simone Heckmann this is perfect. This is what I needed to visualize. Thank you very much. Now if I can just figure it out on Forge or if @Michel Rutten could share some wisdom. I can do it by hand worst case :)

view this post on Zulip Simone Heckmann (Feb 14 2018 at 14:27):

Forge is pretty straightforward here. you just select the element, e.g. Address.line and add one Extension after another. It's the same process... nine times :)

view this post on Zulip Patrick Werner (Feb 14 2018 at 14:34):

if you want to slice it it works like this:
slice_1.png

view this post on Zulip Patrick Werner (Feb 14 2018 at 14:34):

You slice on the profile, then in the individual slices you specify the profile of the Slice:
slice_2.png

view this post on Zulip Patrick Werner (Feb 14 2018 at 14:35):

In order to have this option in the GUI the needed profiles have to be opened in the Forge Session

view this post on Zulip Patrick Werner (Feb 14 2018 at 14:36):

in your usecase it is even easier as you aren't slicing an item[x] element
edit: sorry i didn't see that you need to add extensions, my example is about profiles

view this post on Zulip Joel Francis (Feb 14 2018 at 14:56):

in your usecase it is even easier as you aren't slicing an item[x] element

Thanks @Simone Heckmann and @Patrick Werner , if you take a look at the attached, I'm following Simone's suggestion mentioned earlier of adding extension elements 9 times. All I need is to change the url but can't find the place in the editor to do that (see attached).
Once I do that I will just repeat it for the other address fields.Setting_URI_on_slice.png

view this post on Zulip Simone Heckmann (Feb 14 2018 at 15:05):

You just download the extension to your current Forge project folden, then open the extension in Forge. When you add a new extension to Address, the open extensions should appear in the drop down menu...

view this post on Zulip Simone Heckmann (Feb 14 2018 at 15:07):

pasted image

view this post on Zulip Simone Heckmann (Feb 14 2018 at 15:08):

The urls are defined in the extension's StructureDefinition

view this post on Zulip Patrick Werner (Feb 14 2018 at 15:16):

i would also suggest to load the extensions into the Forge session, it is also possible to do it without loading them, then after extending an element -> select other and enter the Extension.url in the Textfield directly under the selected "other"
This textfield isn't labeled, maybe this could be added in a future Forge version @Michel Rutten

view this post on Zulip Joel Francis (Feb 14 2018 at 15:39):

pasted image

@Simone Heckmann , @Patrick Werner , I think I misunderstood the add "extension 9 time" which is why I was finding it hard to change the uri. Simone I see from the screen shot you created each individual extension, as opposed to what I was trying to do in the screen shot (attached). Sigh. Which is adding extension elements to one extension if that makes sense.

what_I_was_doing.png

view this post on Zulip Simone Heckmann (Feb 14 2018 at 15:53):

Well, alternatively you could create a complex extension which holds all the extensions you need and then add just the complex one to the Element... But in terms on interoperability I'd think you're better off using single extensions, especially for the ISO-stuff wich might be understood by a large number of systems, whereas your complex extension is not.

view this post on Zulip Michel Rutten (Feb 15 2018 at 10:06):

@Simone Heckmann and @Patrick Werner thank you for helping out!
Indeed, FHIR internally uses slicing to define extensions. However Forge tries to hide the underlying complexity of the extension slice. Instead, Forge allows users to simply add/move/delete extensions to any element via the UI. Forge will then automatically generate the appropriate extension slicing definitions.


Last updated: Apr 12 2022 at 19:14 UTC