Stream: shorthand
Topic: Reference to canonical fragments
Elliot Silver (Aug 18 2020 at 07:01):
I am working on an IG, and have defined a logical model (StructureDefinition instance). I have also defined a Questionnaire instance. I'd like items in the Questionnaire to use the logical model, but can't figure out how to specify the canonical fragment. For example, my logical model has
Instance: DataDictionary
InstanceOf: StructureDefinition
Description: "Data Dictionary Logical Model"
Title: "Data Dictionary"
Usage: #definition
* insert PublisherContext
* name = "SurveillanceDataDictionary"
* id = "SurveillanceDataDictionary"
* url = "http://example.org/fhir/cr/StructureDefinition/SurveillanceDataDictionary"
...
* differential.element[1].id = "SurveillanceDataDictionary.report.date"
* differential.element[1].path = "SurveillanceDataDictionary.report.date"
* differential.element[1].short = "Date of reporting"
* differential.element[1].definition = "Date of reporting"
* differential.element[1].type.code = #date
* differential.element[1].min = 0
* differential.element[1].max = "1"
If my Questionnaire contains:
* item[0].linkId = "report_date"
* item[0].text = "Date of reporting to health authority:"
* item[0].type = #date
* item[0].definition = ?????
What should I put in where the question marks are? I can hard code "http://example.org/fhir/cr/StructureDefinition/SurveillanceDataDictionary#SurveillanceDataDictionary.report.date" and that seems to work. I'd rather use Canonical(), but can't figure out how to structure it.
Nick Freiter (Aug 18 2020 at 12:46):
As of right now, you're best option is to hard code this. SUSHI only supports using the Canonical
keyword when the element on the left hand side of the =
is of type canonical. I think we should consider if that should be expanded so that Canonical
can be used on uri elements like you would want in this case. But in this case I'm still not sure Canonical
would work for you even if we could use it on uri elements, because we would need some sort of syntax for selecting a specific ElementDefinition. The Canonical
keyword would only be able to get the "http://example.org/fhir/cr/StructureDefinition/SurveillanceDataDictionary" part, but there isn't a way to express in FSH that you want to append the "#SurveillanceDataDictionary.report.date" part.
Nick Freiter (Aug 18 2020 at 12:53):
I've made an issue to track this: https://github.com/FHIR/sushi/issues/572
Elliot Silver (Aug 18 2020 at 15:12):
Good to know I wasn't missing something. Thank you.
By the way, in the absence of auto-indexing and shorthand for nested elements, doing logical models and questionnaires is a pain in fsh. I'm not sure the logical model was any shorter in fsh than hand writing the JSON.
Chris Moesel (Aug 20 2020 at 20:44):
Thanks for the feedback. We have some ideas about how to make some of these things more succinct in a future version of FSH (via "soft indexing" and "ruleset macros"), so stay tuned! We also hope to update the syntax to support logical models using many of the same constructs as available in profiling -- so that should help in that regard. That said, we're allowing community feedback to help drive the priorities, so I can't promise when that will happen.
Elliot Silver (Aug 20 2020 at 22:00):
As I renumber my 70+ element logical model for the umpteenth time, please consider this as community feedback. :-)
David Hay (Aug 20 2020 at 22:28):
BTW - are you aware of the clinFHIR logical modeller? It can create models (StructureDefinitions) through a graphical interface. Reach out privately if you want to discuss further...
Chris Moesel (Aug 20 2020 at 22:31):
Elliot Silver said:
As I renumber my 70+ element logical model for the umpteenth time, please consider this as community feedback. :-)
Ugh. I feel your pain and I'm sorry. We wanted to solve the array issue on time for 1.0.0, but we couldn't get community agreement on the approach, so we had to push it back.
Elliot Silver (Aug 20 2020 at 22:32):
Hi David, yes I am aware, and I started with it. However, I was aiming for a FSH-only IG, and didn't appreciate the difference in effort. I think I found some limitations too, but don't recall what those are right now.
David Hay (Aug 20 2020 at 22:54):
No worries ...
If you do recall the limitations then it would be good to know them. I am aware that the SD does need tidying before IG publisher will accept them (I have a script for that). Actually, as I write this, I wonder if an 'export to FSH' mightn't be a good idea - or just incorporate the 'tidy script' into the app... - maybe something for connectathon!
Mark Kramer (Aug 26 2020 at 21:38):
@Elliot Silver we are going to take care of you (in a good way) :grinning_face_with_smiling_eyes:
Elliot Silver (Aug 26 2020 at 22:58):
@Mark Kramer thank you.
Last updated: Apr 12 2022 at 19:14 UTC