Stream: implementers
Topic: FixedValue of an extension value
Michael van der Zel (Jan 22 2021 at 14:41):
How can I set a fixed value of an element of an extension in a profile using that extension.
For example I have an extension of type "Coding" and in a profile I am using that extension but I want to set a fixedUri for the system used in that coding. How can I do that? One option is to set it in the extension, but the challenge is that it is not 1 fixex value for all the uses of that Extension.
ryan moehrke (Jan 22 2021 at 14:54):
In the structureDefinition that uses the extension you should be able to use the fixed[x] or pattern[x] just like if you were making a fixed code for any other element.
Chris Moesel (Jan 22 2021 at 15:21):
To expand on @ryan moehrke's answer, here is an example (or two) of how to do this in FSH: https://fshschool.org/FSHOnline/#/share/399fxs6
NOTE: If you don't care about FSH, you can still click the "Run" button if you want to see what such a thing looks like in a StructureDefinition.
Chris Moesel (Jan 22 2021 at 15:21):
Also, thanks for presenting the opportunity for me to use FSH Online's brand new SHARE feature for the first time in Zulip!
Michael van der Zel (Jan 27 2021 at 09:56):
ryan moehrke said:
In the structureDefinition that uses the extension you should be able to use the fixed[x] or pattern[x] just like if you were making a fixed code for any other element.
That doesnot work since in the structuredefinition the type is "Extension", so the fixed[x] is about setting a fixed value for that type. I want to set a fixed value for the value in the Extension.
Lloyd McKenzie (Jan 27 2021 at 15:18):
The extension reference in your profile is a slice. Just walk into the slice and specify the value[x] element, then walk into the value[x]:sometype slice and assert your fixed value
Michael van der Zel (Jan 27 2021 at 22:53):
@Lloyd McKenzie Can you point me to an example. I tried this, but get errors on validation. Not existing path or wrong name and things like that. Shall try to reproduce.
Lloyd McKenzie (Jan 28 2021 at 00:30):
Your id ought to be foo.extension:extensionSliceName.value[x]:valueSomeType
and would have a fixedSomeType value. I don't actually have a full example I can copy from handy. If you try the above and get an error, share what you're getting and I may be able to help further.
Michael van der Zel (Jan 28 2021 at 12:45):
use of a simple Coding type extension on Provenance.whoReference.extension
{
"id": "Provenance..agent.whoReference.extension",
"path": "Provenance.agent.whoReference.extension",
"sliceName": "signatureMode",
"type": [
{
"code": "Extension",
"profile": "http://example.com/fhir/StructureDefinition/signatureMode"
}
]
},
{
"id": "Provenance.agent.who[x].extension:signatureMode.value[x]:valueCoding.system",
"path": "Provenance.agent.who[x].extension.valueCoding.system",
"sliceName": "signatureMode",
"fixedUri": "http://example.com/Terminology/DefinedTerms"
}
The extension itself "works" and created the expected result in an IG.
The fixed value part I don't get to work.
java validator output
*FAILURE*: 2 errors, 0 warnings, 0 notes
Error @ StructureDefinition.differential.element.where(path = 'Provenance.agent.who[x].extension:signatureMode.value[x]:valueCoding.system') : No match found in the generated snapshot: check that the path and definitions are legal in the differential (including order)
Error @ StructureDefinition : The profile http://example.com/fhir/StructureDefinition/ProgressNoteSignature has 1 element in the differential (id: Provenance.agent.who[x].extension:signatureMode.value[x]:valueCoding.system) that don't have a matching element in the snapshot: check that the path and definitions are legal in the differential (including order)
Lloyd McKenzie (Jan 29 2021 at 05:13):
Your id needs to contain your slicename. Also looks like it's got double-periods. Should be "Provenance.agent.who[x]:whoReference.extension:signatureMode
Second one "Provenance.agent.who[x]:whoReference.extension:signatureMode.value[x]:valueCoding.system"
Michael van der Zel (Jan 29 2021 at 15:07):
And what are the associated paths with those id's?
#1: Provenance.agent.whoReference.extension
#2: Provenance.agent.whoReference.extension.valueCoding.system
I keep getting errors on no 2
*FAILURE*: 2 errors, 0 warnings, 0 notes
Error @ StructureDefinition.differential.element.where(path = 'Provenance.agent.who[x]:whoReference.extension:signatureMode.value[x]:valueCoding.system') : No match found in the generated snapshot: check that the path and definitions are legal in the differential (including order)
Error @ StructureDefinition : The profile http://example.com/fhir/StructureDefinition/ProgressNoteSignature has 1 element in the differential (id: Provenance.agent.who[x]:whoReference.extension:signatureMode.value[x]:valueCoding.system) that don't have a matching element in the snapshot: check that the path and definitions are legal in the differential (including order)
Lloyd McKenzie (Jan 29 2021 at 21:55):
Paths should be Provenance.agent.who[x].extension and Provenance.agent.who[x].extension.value[x].system
Michael van der Zel (Jan 29 2021 at 23:19):
Still not working :-(
Provenance.agent.who[x].extension : Extension[0..*] (slicing by url)
Provenance.agent.who[x].extension:signatureMode : Extension([CanonicalType[http://example.com/fhir/StructureDefinition/signatureMode]])[0..*] (slicename = signatureMode)
Provenance.agent.who[x].extension:signatureMode.id : string[0..1]
Provenance.agent.who[x].extension:signatureMode.extension : Extension[0..*] (slicing by url)
Provenance.agent.who[x].extension:signatureMode.url : uri[1..1] fixed=uri
Provenance.agent.who[x].extension:signatureMode.value[x] : Coding[0..1] (slicing by $this)
Provenance.agent.who[x].extension:signatureMode.value[x]:valueCoding : Coding[0..1] (slicename = valueCoding)
...
Error @ StructureDefinition.differential.element.where(path = 'Provenance.agent.who[x]:whoReference.extension:signatureMode.value[x]:valueCoding.system') : No match found in the generated snapshot: check that the path and definitions are legal in the differential (including order)
Error @ StructureDefinition : The profile http://example.com/fhir/StructureDefinition/ProgressNoteSignature has 1 element in the differential (id: Provenance.agent.who[x]:whoReference.extension:signatureMode.value[x]:valueCoding.system) that don't have a matching element in the snapshot: check that the path and definitions are legal in the differential (including order)
Michael van der Zel (Jan 29 2021 at 23:20):
Don't know if it makes any difference, but I am doing this in FHIR version 3.0.2
Lloyd McKenzie (Jan 30 2021 at 14:46):
Are you using the most recent publisher/validator? It's possible there's a snapshot generation error. What you have looks right to me. @Mark Iantorno, thoughts?
Mark Iantorno (Jan 30 2021 at 15:04):
Ah, away from my computer right now. I will look later today
Michael van der Zel (Feb 01 2021 at 09:21):
I have "FHIR Validation tool Version 5.2.16 (Git# f815bc8fb8f0). Built 2021-01-14T22:39:23.297Z (15 days old)" now, will update and run again.
Michael van der Zel (Feb 01 2021 at 09:24):
Same result for "FHIR Validation tool Version 5.2.20 (Git# af05868a82bf). Built 2021-01-25T15:02:44.742Z (6 days old)"
Michael van der Zel (Feb 17 2021 at 10:54):
Mark Iantorno said:
Ah, away from my computer right now. I will look later today
Sorry to keep bugging you. Hope you get a change to look at this issue. Thanks!
Last updated: Apr 12 2022 at 19:14 UTC