FHIR Chat · define a default value for an extension in a profile · implementers

Stream: implementers

Topic: define a default value for an extension in a profile


view this post on Zulip Jean Duteau (Aug 04 2016 at 23:22):

I'm trying to define a default value in a profile for an extension element. I'm defining the value as:
<extension url="blah"><valueCode value="Blah"/></extension>
and it passes validation. But I get an error when it appears to be creating the profile:
[java] ...Profile medicationorder-drugproduct-canadaerx 0.194 331sec 1485MB
[java] Exception in thread "main" java.lang.Error: Unhandled type
[java] at org.hl7.fhir.dstu3.formats.XmlParser.composeType(XmlParser.java:30236)
[java] at org.hl7.fhir.dstu3.formats.XmlParser.composeElementDefinition(XmlParser.java:15747)
[java] at org.hl7.fhir.dstu3.formats.XmlParser.composeStructureDefinitionStructureDefinitionSnapshotComponent(XmlParser.java:28083)
[java] at org.hl7.fhir.dstu3.formats.XmlParser.composeStructureDefinition(XmlParser.java:28027)
[java] at org.hl7.fhir.dstu3.formats.XmlParser.composeResource(XmlParser.java:29882)

I tried looking through the source to see if anyone else had defined a fixed value but I couldn't find it (with admittedly limited grepping).

view this post on Zulip Grahame Grieve (Aug 04 2016 at 23:23):

are you talking about fixed or default value, and what do you mean 'creating the profile'?

view this post on Zulip Jean Duteau (Aug 04 2016 at 23:24):

a) i want to create a fixed value. I'm setting the value in the profile spreadsheet in the Value column.
b) I was assuming that the build was in the creating the profile step. There were a bunch of "...Profile blah" messages when it failed.

view this post on Zulip Grahame Grieve (Aug 04 2016 at 23:25):

which build are you using? You should be using the IG publisher

view this post on Zulip Jean Duteau (Aug 04 2016 at 23:25):

2016may-buildcorrected. and the IG publisher wasn't ready when I started.

view this post on Zulip Grahame Grieve (Aug 04 2016 at 23:26):

oh. that fork.

view this post on Zulip Jean Duteau (Aug 04 2016 at 23:27):

yes, that one. do you know why I'd be getting that error? am I not defining the fixed value for the extension properly?

view this post on Zulip Grahame Grieve (Aug 04 2016 at 23:33):

well, the first thing to go and do is fix something in that fork. THe Unhandled type
exception should say what type is not handled. That would help a lot. If you fix that in the java code and try again, you'll get more information

view this post on Zulip Jean Duteau (Aug 04 2016 at 23:44):

Unhandled type:Extension

view this post on Zulip Jean Duteau (Aug 04 2016 at 23:44):

which is what I expected. in that bit of code (XMLParser.composeType) there is no block that handles extensions.

view this post on Zulip Grahame Grieve (Aug 04 2016 at 23:55):

which makes sense, since "Extension" is not an allowable type for default value

view this post on Zulip Jean Duteau (Aug 05 2016 at 03:46):

hmm, why? I've defined an extension for my MedicationOrders and I'm creating a profile where I want to fix the value of the code in the extension

view this post on Zulip Grahame Grieve (Aug 05 2016 at 03:52):

because more generally, the type list allowed for "*" does not - and should not - include extension

view this post on Zulip Grahame Grieve (Aug 05 2016 at 03:52):

and so you need to walk into the extension and fix the value

view this post on Zulip Jean Duteau (Aug 05 2016 at 03:52):

ah, okay. i'll look into doing that. thanks.


Last updated: Apr 12 2022 at 19:14 UTC