FHIR Chat · FSH Syntax question · shorthand

Stream: shorthand

Topic: FSH Syntax question


view this post on Zulip Richard Kavanagh (Feb 20 2020 at 21:59):

I have recently discovered FSH it looks like a great project.

A few questions:

I used the following in an instance:

  • extension[FishSpecies].valueCodeableConcept = SCT#47978005 "Carpiodes cyprinus (organism)"

The display is not generated (reported already), but I then added the line again so it was duplicated.
I was assuming that I would either get two instances of the extension or two codings in my CodeableConcept. I got neither the second instance overwrote the first.

So how would I create an instance with two instances of the same extension and also how do I put multiple codings in one CodeableConcept.

view this post on Zulip Jose Costa Teixeira (Feb 20 2020 at 22:16):

repeatable elements would be in an array-like syntax, if I understand the question.

view this post on Zulip Jose Costa Teixeira (Feb 20 2020 at 22:17):

just add a [0] and a [1]

view this post on Zulip Richard Kavanagh (Feb 20 2020 at 22:32):

Ah, so to add multiple Codings you have to change the shorthand to

  • extension[FishSpecies].valueCodeableConcept.coding[0] = SCT#47978005 "Carpiodes cyprinus (organism)"
  • extension[FishSpecies].valueCodeableConcept.coding[1] = SCT#47978006 "Carpiodes cyprinus (organism)"

Not sure that it works for multiple extensions though

I tried (and failed) with the following

  • extension[0][FishSpecies].....
  • extension[FishSpecies][0].....

view this post on Zulip Chris Moesel (Feb 20 2020 at 22:35):

In theory, extension[FishSpecies][0].valueCodeableConcept = SCT#47978005 "Carpiodes cyprinus (organism)" should work (if that extension is defined in the profile as 0..*). If it's not working, that may be a bug.

view this post on Zulip Andy Richardson (Mar 25 2021 at 12:54):

I'm new to FHIR FSH... and still getting to grips with the syntax.. could someone be so kind and advise how to define a valueRange? ... many thanks


Last updated: Apr 12 2022 at 19:14 UTC