Stream: shorthand
Topic: Example/Instance for section of custom elements in a Composi
Peter Robinson (Jul 15 2021 at 15:20):
#shorthand
Hi everybody,
I am trying to construct an example (instance) for our new Phenopacket IG. I have defined the Phenopacket as a profile of a Composition:
http://phenopackets.org/core-ig/StructureDefinition-Phenopacket.html
I would now like to add a list of PhenotypicFeatures
http://phenopackets.org/core-ig/StructureDefinition-PhenotypicFeature.html
In the corresponding FHS code I have
-
section contains
phenotypic_features 0..1 and
measurements 0..* and
biosamples 0..* and
//interpretations 0..* and
diseases 0..1 -
section[phenotypic_features].title = "phenotypic_features" (exactly)
- section[phenotypic_features].code = $SectionType#phenotypic_features
- section[phenotypic_features].entry only Reference(PhenotypicFeature)
(See https://github.com/phenopackets/core-ig/blob/master/input/fsh/phenopacketProfile.fsh)
I am not sure how to add this to an example
(See line 11 in https://github.com/phenopackets/core-ig/blob/master/input/fsh/EX_RD_Phenopacket.fsh)
I have tried various alternatives. I could not find anything about this in https://build.fhir.org/ig/HL7/fhir-shorthand/reference.html
-- If I should have found something there, please let me know what I am not understanding!
Any help appreciated, thanks, Peter
Corey Spears (Jul 15 2021 at 16:10):
There does not seem to be a problem with your reference, but rather the element you are trying to assign it to. You need to include the element section
and the slice name "phenotypic_features" in brackets [] along with the entry
element and index (in brackets).
Instead of this:
* phenotypic_features = Reference(longPhiltrum)
I think you are looking for this:
* section[phenotypic_features].entry[0] = Reference(longPhiltrum)
Peter Robinson (Jul 15 2021 at 16:17):
thanks, perfect, that was it!
Corey Spears (Jul 15 2021 at 16:45):
BTW, if you end up with a lot of entries, you may want to look up FSH soft indexing: https://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#soft-indexing
That way you won't have to keep track of index numbers and it makes it a lot easier to move entries around without having to completely re-index.
Last updated: Apr 12 2022 at 19:14 UTC