Stream: implementers
Topic: XML produced by forge when creating custom profiles/extensio
Chris Munro (Feb 17 2017 at 09:29):
I am looking to do the following
1) Create profiles in forge
2) Put the profiles/exts in simplifier
3) Retrieve the profile from simplifier using the C# FHIR API in an object with information about the profile and extensions, e.g. which valueset the extension is bound to, data types etc.
all the above works fine if I try with an existing (non custom) profile in simplifier, such as https://simplifier.net/Profile/AllergyIntolerance
However if I create custom profiles and extensions, based on my findings, there seems to be a difference in the way that Forge produces XML when using custom profiles and extensions, compared to the XML in the existing ones. For example an existing profile (https://simplifier.net/Profile/AllergyIntolerance) contains a link to a value set:
<element>
<path value="AllergyIntolerance.reaction.severity" />
<short value="mild | moderate | severe (of event as a whole)" />
<definition value="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." />
<comments value="It is acknowledged that this assessment is very subjective. There may be some some specific practice domains where objective scales have been applied. Objective scales can be included in this model as extensions." />
<min value="0" />
<max value="1" />
<type>
<code value="code" />
</type>
<isSummary value="true" />
<binding>
<strength value="required" />
<description value="Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations." />
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/reaction-event-severity" />
</valueSetReference>
</binding>
</element>
but when I make a profile, referencing an extension bound to a valueset with forge it produces
<element>
<path value="Basic.extension" />
<name value="SomeValueSetExtension" />
<short value="Base for all elements" />
<definition value="Optional Extensions Element - found in all resources." />
<min value="1" />
<max value="1" />
<type>
<code value="Extension" />
<profile value="http://StructureDefinition/SomeValueSetExtension" />
</type>
<binding>
<strength value="example" />
<valueSetUri value="http://hl7.org/fhir/ValueSet/allergyintolerance-substance-code" />
</binding>
</element>
using <valueSetUri> instead of <valueSetReference>
If I manually reformat the XML in profiles created by forge then I can pull the profile using the C# API using
location = new Uri( <endpoint of profile>)
StructureDefinition stdef = client.Read<StructureDefinition>(location);
but if I just create the profiles with forge, upload to simlifer and retrieve using the same approach, then field such as which valueset the extension in the profile is restricted to are missing, meaning that I can't really use it like this without some extra XML reformatting, as this information is missing.
Mirjam Baltus (Feb 17 2017 at 09:58):
Just below the field where you fill in the URL to the valueset, you can check a box to indicate this is a reference. If the box stays unchecked, Forge will make it a valueSetUri.
Michel Rutten (Feb 17 2017 at 11:08):
@Chris Munro Note that ElementDefinition.valueSet is a choice type element. The C# FHIR API maps such properties to a generic "Element" datatype. A client application has to cast that to a specific datatype in order to access the underlying value via a strongly-typed property. For binding.valueSet, you could try to cast to either a FhirUri or a ResourceReference. This is how Forge reads a profile, so the information is definitely not dropped; you just have to do a bit of extra effort to get to it.
Chris Munro (Feb 17 2017 at 12:03):
Thanks @Mirjam Baltus and @Michel Rutten
Are there any example on simplifier, of custom profiles using custom extensions that are correct? It would help a lot to have an example as a reference
Michel Rutten (Feb 17 2017 at 12:08):
@Chris Munro You could e.g. take a look at the profiles that are published onto Simplifier by Nictiz, a Dutch standards organization:
https://simplifier.net/NL-BasicComponents
Katie Wheatley (Mar 09 2017 at 09:22):
This question is related more to the implementation of valuesets generally in Forge, but I felt it might be appropriate as part of this thread.
I would like more information on this as I'm not totally clear. In Forge for a MessageHeader, I have a valueset bound as attached with the IsResourceReference checkbox ticked. This produces xml as follows:-
<binding>
<strength value="preferred" />
<description value="One of the message events defined as part of FHIR." />
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/message-events" />
</valueSetReference>
</binding>
However, when I untick the IsResourceReference checkbox, the xml output is no different.
What would be a valid reason for ticking this checkbox?
What would be a valid reason for unchecking this tickbox and what impact should it have in the xml output from Forge? I am currently using the Orlando 2016 DSTU2 1.0 Version 0.9.3.5 Forge version. valueset.png
Michel Rutten (Mar 09 2017 at 12:10):
Hi @Katie Wheatley the IsResourceReference checkbox controls the datatype of the binding.value[x] element.
Checked = ResourceReference - serialized to a valueSetReference node
Unchecked = Uri - serialized to a valueSetUri node
Also see:
https://www.hl7.org/fhir/elementdefinition-definitions.html#ElementDefinition.binding.valueSet_x_
Last updated: Apr 12 2022 at 19:14 UTC