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
145 stars 44 forks source link

Can't resolve contentReference on Logical model #1328

Closed mint-thompson closed 1 year ago

mint-thompson commented 1 year ago

https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/LogicalModels.20with.20nested.20properties.20.28followup.29

When resolving a contentReference in ElementDefinition.unfold, the only type that is fished for is Type.Resource. Thus, a Logical model will not be found. The following FSH is an example that will produce errors:

Logical: ViewDefinition
Title: "View Definition"
* select 0..* BackboneElement "The select stanza defines the actual content of the view itself"
  * name 1..1 string "Name of field produced in the output."
  * expression 1..1 string "FHIRPath expression, can include %constant"
  * forEach 0..1 BackboneElement "Expression unnest a new row for each item in the specified FHIRPath expression."
    * expression 1..1 string "FHIRPath expression for the parent path to select values from"
    * select 0..* contentReference #ViewDefinition.select "See select" "Nested select"

Instance:   PatientAddresses
InstanceOf: ViewDefinition
Usage:  #example
* select[+]
  * name = "patient_id"
  * expression = "id"
  * forEach[+]
    * expression = "address"
    * select[+]
      * name = "city"
      * expression = "city"
mint-thompson commented 1 year ago

Added to backlog as CIMPL-1155