FHIR Chat · Error in SUSHI with extensions? · shorthand

Stream: shorthand

Topic: Error in SUSHI with extensions?


view this post on Zulip John Silva (Aug 19 2020 at 15:00):

I'm trying to use SUSHI/FSH to define an extension and even took, verbatim. the example from the FHIR FSH reference page:

  • extension contains
    ombCategory 0..5 MS
    detailed 0..*
    text 1..1 MS
    // rules defining the inline extensions would typically follow:

  • extension[ombCategory].value[x] only Coding

  • extension[ombCategory].valueCoding from http://hl7.org/fhir/us/core/ValueSet/omb-race-category (required)
  • extension[text].value[x] only string

SUSHI returns this error: (I've tried this with 0.12.7 and 0.15.1 and get the same error)

error mismatched input 'contains' expecting {'units', '='}
File: /Users/john/Vermonster/rule-engine-content/fsh/ACR-Headache.fsh
Line: 39
error mismatched input 'only' expecting {'units', '='}

view this post on Zulip Jean Duteau (Aug 19 2020 at 15:15):

can you share your actual file because what you posted above has an error that aren't related to the error you're showing, but I suspect that's just because we're not seeing the raw file (you are missing 'and' between the three extension names).

view this post on Zulip David Pyke (Aug 19 2020 at 15:27):

Not having the "and" will cause that error. I know from experience

view this post on Zulip John Silva (Aug 19 2020 at 15:46):

Thanks David; I'll check that. If that's the case then this page, which is where I got this example, needs to be fixed:

https://build.fhir.org/ig/HL7/fhir-shorthand/reference.html#contains-rules-for-extensions. (it;'s the last example just before sectin 3.5.5)

I cut-and-pasted that code exactly. However, I also got the same error if I only had one lineL

view this post on Zulip John Silva (Aug 19 2020 at 15:47):

I also tried this simple example and got the same error:

// Define extension inline for now

  • extension contains display 0..1
  • extension[display].value[x] only string

view this post on Zulip Jean Duteau (Aug 19 2020 at 15:53):

Here is what I tried and it succeeded:

Profile: TestOrganization
Parent: Organization
* extension contains display 0..1
* extension[display].value[x] only string

NOTE: I think there is something else wrong in your file because when I copy and paste the example that is missing the 'and's, I get the following error:

error extraneous input 'detailed' expecting {<EOF>, KW_ALIAS, KW_PROFILE, KW_EXTENSION, KW_INSTANCE, KW_INVARIANT, KW_VALUESET, KW_CODESYSTEM, KW_RULESET, KW_MAPPING}
  File: /Users/jeanduteau/Documents/DDIWork/IBM-BEST/datastandards/fsh/MessageOrganization.fsh
  Line: 76

view this post on Zulip Nick Freiter (Aug 19 2020 at 17:03):

Thanks for noticing that @John Silva , we will update that documentation to correctly include the "and"

view this post on Zulip John Silva (Aug 19 2020 at 22:04):

Thanks @Nick Freiter , thanks @Jean Duteau . A team member showed me how to do this but using an external extension not an inline one. At least we were able to get it to work with external (which is actually better, because I need to reuse this on multiple PlanDefinition FSH files, in the action[].input[] structure.


Last updated: Apr 12 2022 at 19:14 UTC