Stream: shorthand
Topic: GoFSH 1.0.0 (!!!)
Chris Moesel (Feb 10 2021 at 21:24):
We're really excited to introduce the official 1.0 release of GoFSH, a FHIR Shorthand (FSH) decompiler. GoFSH can convert a set of JSON and/or XML FHIR R4 definitions into a working FHIR Shorthand project!
GoFSH 1.0 comes with the following features:
- Supports
.json
and.xml
FHIR R4 definitions as input - Produces
.fsh
files in several configurable layouts - Produces a simple FSH-only
sushi-config.yaml
file - Follows best-practice FSH authoring practices (as much as possible)
- Optionally "round-trips" results to compare exported definitions with original definitions
- Provides a simple API for programmatically invoking GoFSH
- Is fully compliant with FHIR Shorthand 1.0 and SUSHI 1.2.0
For more information, check out the GoFSH 1.0.0 release notes and GoFSH documentation in the FSH School!
David Hay (Feb 10 2021 at 21:46):
Cool! (especially the API)...
David Hay (Feb 11 2021 at 00:11):
So what are the Dolphins in the output summary? (I have 38 irritated ones)...
David Hay (Feb 11 2021 at 00:20):
and it seems to have skipped a number of the ValueSets (could this be related to the irritated dolphins?)
David Hay (Feb 11 2021 at 02:39):
I see that dolphins have gone, leaving me with 25 cuddled cuttlefish. I do appreciate the humour - but would like to know the meaning :)
Chris Moesel (Feb 11 2021 at 13:23):
Hi @David Hay. When we built the summary table, we had too many things to report in a single row, so we decided to make it two rows. But the number of things to report was an odd number, leaving one cell empty. Well, we couldn't have that -- so we decided to make up fun statistics instead! Basically, we pick a random number, random species, and random action -- resulting in something like you saw: 25 cuttlefish cuddled. If you have no errors or warnings, you get a happy action, but if you have warnings or errors, you get an unhappy action (as in your first run with 38 irritated dolphins).
Chris Moesel (Feb 11 2021 at 13:26):
But if you're missing ValueSets in the output, I'd like to take a look if the source is available. One thing that maybe could go wrong is if you have a ValueSet.name
that has spaces in it (which it shouldn't). If so, then GoFSH might output FSH w/ that name -- which would then cause the SUSHI parser to choke and stop reading the file when it hits that grammar error? But I'm just guessing now. Seeing the actual project would help.
David Hay (Feb 11 2021 at 16:43):
Ah - I should have guessed that! (I got confused as only about a third of the ValueSets in the input folders seemed to result in fsh instances). But I'll look into it further - the VS instances came from elsewhere...
David Hay (Feb 11 2021 at 17:18):
Just for anyone else - turned out that my resources didn't have unique id's which confused goFSH. Next release will allow for that. Many thanks to @Chris Moesel for the rapid response!
Chris Moesel (Feb 11 2021 at 17:22):
And to further clarify -- when GoFSH encounters a resource with the same resourceType
and id
it saw from a previous resource, it will ignore it (i.e., it requires the combination of resourceType
and id
to be unique). That will likely not change (at least not now). What was happening in this case, however, is that many of the resources had no id
at all -- so GoFSH treated them as if they had the same (blank) id
. We will update GoFSH so that if a resource does not have an id
, it will synthesize one using the name
and/or a counter.
John Silva (Feb 12 2021 at 18:24):
(Haven't been following along so sorry if this is a repeat question)
Does the JSON to FSH support FHIR instances, e.g. FHIR Observation to FSH version of it? This would be helpful in taking existing sample data and creating base FSH files from it.
ryan moehrke (Feb 12 2021 at 18:27):
and an add-on question for my own purposes, does goFSH understand parameterized rulesets and can you give it a set to use to auto-magically compress repeated structures? (or is/will this be considered for next releases of goFSH)
Chris Moesel (Feb 12 2021 at 18:45):
@John Silva -- GoFSH will create FSH for pretty much any FHIR thing you give it. So, sure, it can be used to transform a set of examples into FSH. The one caveat is that the FSH instances will have the rules to explicitly set fixed values, even though that technically is not required (since SUSHI automatically applies fixed values to instances). So the GoFSH-produced FSH is not wrong, but it may be more verbose than necessary.
Chris Moesel (Feb 12 2021 at 18:48):
@ryan moehrke -- that would be super cool, but no, it does not do that today. I think there is probably quite a bit of work required by that one little word "auto-magically", so I'm not sure if this will ever be a feature. But I like the idea! (And we do accept contributions! :wink:)
Last updated: Apr 12 2022 at 19:14 UTC