FHIR / sushi

SUSHI (aka "SUSHI Unshortens Short Hand Inputs") is a reference implementation command-line interpreter/compiler for FHIR Shorthand (FSH).
Apache License 2.0
147 stars 43 forks source link

Trying to create association Cannot set property 'fixedUri' of undefined #387

Closed bwalsh closed 4 years ago

bwalsh commented 4 years ago

Input

Profile:        AnvilResearchStudy
Parent:         ResearchStudy
Id:             anvil-research-study
Title:          "AnVIL ResearchStudy"
Description:    "An AnVIL ResearchStudy."
* extension contains 
    AnvilDocumentReference named documents 0..*

Extension:      AnvilDocumentReference
Parent:         DocumentReference
Id:             anvil-document-reference
Title:          "AnVIL document reference"
Description:    "An association to a document."

Output

error Cannot set property 'fixedUri' of undefined
  File: /src/AnVIL.fsh
  Line: 9 - 13
cmoesel commented 4 years ago

This is happening because you declared AnvilDocumentReference as an Extension, but you also declared its parent as DocumentReference, which is not an Extension. This is not valid as a parent of an Extension must also be an Extension. We should update SUSHI to report an error when it detects this type of use.

I think you're probably wanting something more like this:

Extension:      AnvilDocumentReference
Id:             anvil-document-reference
Title:          "AnVIL document reference"
Description:    "An association to a document."
* value[x] only Reference(DocumentReference)
bwalsh commented 4 years ago

Thanks very much.