Stream: shorthand
Topic: Setting canonical values
Brian Kaney (May 10 2020 at 18:28):
There are many cases where I need to specify canonical URLs, especially building Instances. I was seeing if there is something I could do with Alias, but there isn't a way to concat or interpolate. And I don't see a Canonical()
helper/rule (like Reference()
). Any suggestions?
Chris Moesel (May 11 2020 at 13:33):
So you want to be able to do something like: * system = Canonical(MyCodeSystem)
? Is that right? I think we have a (not yet started) feature request to convert named types to canonicals when the target type is a canonical... Would that do it for you or do you have other use cases?
Brian Kaney (May 11 2020 at 19:08):
Yep, that would do it!
John Grimes (May 22 2020 at 00:25):
I think this is along the lines of what I need, also.
John Grimes (May 22 2020 at 00:28):
What I am trying to do is refer to a ValueSet from a canonical-typed element in a resource instance (in this case, Questionnaire.item.answerValueSet
.
I can do it like this, but it's not ideal as the tool doesn't really recognise it as an internal reference, so the generated links go to the canonical URI rather that linking to the page within the IG that defines the ValueSet:
Alias: SCT = http://snomed.info/sct
ValueSet: MedicalHistoryOptions
Id: MedicalHistoryOptions
* ^url = "https://csiro.au/fhir/ValueSet/MedicalHistoryOptions"
* SCT#373067005 "No"
* SCT#373066001 "Yes"
* SCT#261665006 "Unknown"
* SCT#443390004 "Refused"
Instance: MedicalHistory
InstanceOf: Questionnaire
Usage: #definition
* url = "https://csiro.au/fhir/Questionnaire/MedicalHistory"
* version = "0.0.0"
* status = #draft
* experimental = true
* subjectType = #Patient
* item[0].linkId = "1"
* item[0].type = #group
* item[0].text = "Have you ever been told by a doctor or health professional that you have any of the following conditions?"
* item[0].item[0].linkId = "1.1"
* item[0].item[0].type = #choice
* item[0].item[0].code = SCT#301095005 "Cardiac finding"
* item[0].item[0].text = "Heart Condition"
* item[0].item[0].answerValueSet = "https://csiro.au/fhir/ValueSet/MedicalHistoryOptions"
Nick Freiter (May 22 2020 at 12:26):
It's clear this is definitely a feature people need, so we are working on adding this in the next two weeks.
One additional thing to note though, is that I don't think you should need the line:
* ^url = "https://csiro.au/fhir/ValueSet/MedicalHistoryOptions"
in your ValueSet. Assuming that "https://csiro.au/fhir/" is your canonical URL that you are giving SUSHI in your configuration, that url should be automatically added to the ValueSet.
John Moehrke (Jul 10 2020 at 13:07):
every one of my resources has a canonical url mismatch. so I clearly am not understanding how to tell sushi and build the same canonical url.
Chris Moesel (Jul 10 2020 at 15:12):
@John Moehrke -- is your FSH source available publicly somewhere?
Nick Freiter (Jul 10 2020 at 15:13):
Posted in a different thread: https://github.com/JohnMoehrke/MHD-fsh
John Moehrke (Jul 10 2020 at 15:15):
yup, just updated that repo with the config.yaml update
John Moehrke (Jul 10 2020 at 15:16):
I am trying to use sushi purely to process the FSH tank creating the resources for me. Everything else I want to manage in normal build tool ways. I get that there will be some overlap on things like the IG, ig.ini, etc.. so I just want to understand how that dance is intended.
John Moehrke (Jul 10 2020 at 15:17):
im willing to dance.. just don't know the toon... learned of the config.yaml this morning.
Chris Moesel (Jul 10 2020 at 15:23):
@John Moehrke -- if you want SUSHI to only create the resources and examples for you, then you want to add a FSHOnly: true
property to your config.yaml
. If you do that, you're in charge of managing everything else (including the IG.xml/IG.json resource).
David Hay (Jul 10 2020 at 19:55):
Hey John: You do know you can set the url in the fsh file? eg:
Marc de Graauw (Jun 17 2021 at 09:53):
Has this feature been implemented yet? If so, is something like this possible: * action.definition[x] only Canonical(PlanDefinition)
("this PlanDefinition only contains sub-PlanDefinitions")? Tried a lot of variants w/o succes. This works * action.definition[x] = Canonical(PlanDefinition)
but is not what I want.
Chris Moesel (Jun 17 2021 at 12:07):
Hi @Marc de Graauw. You shouldn't need the Canonical
keyword there at all. You should be able to just say: * action.definition[x] only PlanDefinition
.
Marc de Graauw (Jun 17 2021 at 12:17):
Mmm, then I get this error: "The type "PlanDefinition" does not match any of the allowed types: canonical or uri"
image.png
Chris Moesel (Jun 17 2021 at 12:25):
Oh, I see. I should have looked at the FHIR definition. I forgot that action.definition[x]
is a canonical
-- sorry! I think you are correct; this is a bug! You should be able to say * action.definition[x] only Canonical(PlanDefinition)
since one of the choices of action.definition[x]
is a canonical. We will try to fix this!
Chris Moesel (Jun 17 2021 at 12:31):
Logged as SUSHI#846.
Marc de Graauw (Jun 17 2021 at 14:37):
:+1:
Last updated: Apr 12 2022 at 19:14 UTC