Skip to content

Instantly share code, notes, and snippets.

@bkaney
Created August 23, 2023 14:56
Show Gist options
  • Save bkaney/49485fb5316db4868af4fab9eddd56f6 to your computer and use it in GitHub Desktop.
Save bkaney/49485fb5316db4868af4fab9eddd56f6 to your computer and use it in GitHub Desktop.
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"
info Running SUSHI v3.2.0 (implements FHIR Shorthand specification v3.0.0-ballot (partial))
info Arguments:
info /Users/bkaney/projects/sql-on-fhir-v2
info No output path specified. Output to .
info Using configuration file: /Users/bkaney/projects/sql-on-fhir-v2/sushi-config.yaml
info Importing FSH text...
info Preprocessed 2 documents with 0 aliases.
info Imported 0 definitions and 1 instances.
info Checking /Users/bkaney/.fhir/packages for hl7.fhir.uv.tools#current...
info Found hl7.fhir.uv.tools#current in /Users/bkaney/.fhir/packages.
info Loaded package hl7.fhir.uv.tools#current
info Checking /Users/bkaney/.fhir/packages for hl7.terminology.r4#5.0.0...
info Found hl7.terminology.r4#5.0.0 in /Users/bkaney/.fhir/packages.
info Loaded package hl7.terminology.r4#5.0.0
info Checking /Users/bkaney/.fhir/packages for hl7.fhir.r4.core#4.0.1...
info Found hl7.fhir.r4.core#4.0.1 in /Users/bkaney/.fhir/packages.
info Loaded package hl7.fhir.r4.core#4.0.1
info Converting FSH to FHIR resources...
info Converted 3 FHIR StructureDefinitions.
error Cannot read properties of undefined (reading '0')
File: /Users/bkaney/projects/sql-on-fhir-v2/input/fsh/examples.fsh
Line: 23
error Cannot read properties of undefined (reading '0')
File: /Users/bkaney/projects/sql-on-fhir-v2/input/fsh/examples.fsh
Line: 24
info Converted 1 FHIR instances.
info Exporting FHIR resources as JSON...
info Exported 4 FHIR resources as JSON.
info Assembling Implementation Guide sources...
info Generated ImplementationGuide-hl7.fhir.uv.sql-on-fhir.json
info Assembled Implementation Guide sources; ready for IG Publisher.
╔════════════════════════ SUSHI RESULTS ══════════════════════════╗
║ ╭───────────────┬──────────────┬──────────────┬───────────────╮ ║
║ │ Profiles │ Extensions │ Logicals │ Resources │ ║
║ ├───────────────┼──────────────┼──────────────┼───────────────┤ ║
║ │ 0 │ 0 │ 3 │ 0 │ ║
║ ╰───────────────┴──────────────┴──────────────┴───────────────╯ ║
║ ╭────────────────────┬───────────────────┬────────────────────╮ ║
║ │ ValueSets │ CodeSystems │ Instances │ ║
║ ├────────────────────┼───────────────────┼────────────────────┤ ║
║ │ 0 │ 0 │ 1 │ ║
║ ╰────────────────────┴───────────────────┴────────────────────╯ ║
║ ║
╠═════════════════════════════════════════════════════════════════╣
║ This was a turtle disaster. 2 Errors 0 Warnings ║
╠═════════════════════════════════════════════════════════════════╣
║ You are using SUSHI version 3.2.0, but the latest stable ║
║ release is version 3.3.2. To install the latest release, run: ║
║ npm install -g fsh-sushi ║
╚═════════════════════════════════════════════════════════════════╝
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment