Stream: shorthand
Topic: Error Generating Narrative on Publish
Stuart Cox (Mar 09 2021 at 16:55):
I am attempting to create an extension. The extensions is a bit unusual for me, in that this is the first time I have created an extension that uses a metadata type instead of a primitive or general-purpose type. In this case the ParameterDefinition profile. I am attempting to add a measure-parameter-definition extension to the my measure profile.
This appears to work, sushi compiles successfully, and IG is produced. However when I create an example, it throws an error when the profiler is Generating Narratives for the example.
Error I'm getting is:
Generating Narratives
org.apache.commons.lang3.NotImplementedException: type org.hl7.fhir.r5.model.ParameterDefinition not handled - should not be here
The IG publishes with the error, but does have a nice red section on the example html page where the narrative is normally displayed. Not so much worried about that, but more concerned about other consequences we might encounter later.
A few questions on this:
1) Is there anything wrong with my approach? Is there any problem with using meta-data types as an extension value in this way?
2) Am I doing it correctly?
3) Will the narrative error result in any other issues when using this profile, or is it just a bug with the narrative generation?
Here is my stripped down fsh code to reproduce the error:
Extension: MeasureParameterDefinition
Id: measure-parameter-definition
Title: "Measure Parameter Definition"
* value[x] only ParameterDefinition
Profile: QualityMeasure
Parent: Measure
Id: quality-measure
Title: "Quality Measure"
* extension contains MeasureParameterDefinition named measureParameterDefinition 0..*
Instance: QualityMeasureExample
InstanceOf: QualityMeasure
Usage: #example
Title: "Quality Measure Example"
* status = #active
* extension[measureParameterDefinition].valueParameterDefinition.name = #measurePeriod
* extension[measureParameterDefinition].valueParameterDefinition.use = #out
* extension[measureParameterDefinition].valueParameterDefinition.type = #Period
Thank you!
Chris Moesel (Mar 09 2021 at 17:47):
Hi @Stuart Cox. To answer your questions:
1) I don't see anything wrong with your approach. The definition of Extension shows that value[x]
is an open type element, which allows ParameterDefinition
-- so I don't see any reason why you shouldn't be able to use it. In fact, that extension definition (previously linked) even lists valueParameterDefinition
as a valid instantiated value name.
2) I think you are doing it correctly. The FSH looks valid and the FHIR it produces looks valid too (at least to me).
3) This seems like it is just a bug with narrative generation, but I'm not an expert in the inner workings of the IG Publisher, so I'd want @Grahame Grieve to confirm that. Grahame -- if you want to see the resulting FHIR definitions, click this link to view it in FSH Online and then click the "Run" button.
Stuart Cox (Mar 09 2021 at 18:44):
Thank you @Chris Moesel for your quick response. Love the FSH online tool!
Last updated: Apr 12 2022 at 19:14 UTC