FHIR Chat · Liquid syntax / variables in fsh · shorthand

Stream: shorthand

Topic: Liquid syntax / variables in fsh


view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:23):

Can we add to discussion backlog: using liquid syntax or other mechanism to include external variables in a fsh file?

view this post on Zulip David Pyke (Sep 11 2020 at 17:23):

What would be the use case?

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:25):

As a fsh editor, I want to create dozens of example resources that are very similar to each other by providing one template in fsh and having sushi populate the variable values.

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:25):

Similar to word mail merge

view this post on Zulip David Pyke (Sep 11 2020 at 17:26):

Then you start needing if and other structures and things get difficult

view this post on Zulip David Pyke (Sep 11 2020 at 17:27):

mFSH can do what you want, mostly

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:27):

Variables would be like {{random*10}} or {{sequence(1,10)}} or some fancy lookup

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:27):

Why do I need an if?

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:27):

And what is mFSH?

view this post on Zulip David Pyke (Sep 11 2020 at 17:28):

macro FSH. Let you do simple substitutions

view this post on Zulip David Pyke (Sep 11 2020 at 17:28):

Most of the time I"m doing batch examples, they're conditional to some extent

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:29):

Typical scenario: create a CSV with 200 lines of the variables that change (takes a few minutes); create the fsh template; sushi it

view this post on Zulip David Pyke (Sep 11 2020 at 17:31):

I create the fsh in excel, that lets me use various lookups and transforms

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:31):

Whenever I have to create more than a few example instances, I need a XLS to see and edit the different values, and I create a fsh from that.

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 17:33):

Yes, and I wonder how it would be simpler to do that with variables instead of creating fsh content in excel

view this post on Zulip David Pyke (Sep 11 2020 at 17:45):

Just need to poke the sushi team to get macros brought back onto the front burner

view this post on Zulip Chris Moesel (Sep 11 2020 at 18:05):

See the Wicked FSH presentation we've been giving at the Connectathon. There are some slides on "Parameterized RuleSets" which introduce the idea of macros -- although they don't yet consider the possibility of feeding macros data from external sources.

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 19:58):

So will macros support the use case above?

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 20:03):

From what I read, it seems orthogonal - macros and templates with variables for serialized instance creation

view this post on Zulip Jose Costa Teixeira (Sep 11 2020 at 20:05):

I don't think we should put those together

view this post on Zulip Chris Moesel (Sep 11 2020 at 21:25):

From what I read, it seems orthogonal - macros and templates with variables for serialized instance creation
I don't think we should put those together

I think I agree with you.

view this post on Zulip David Pyke (Sep 11 2020 at 21:27):

I think it works well, I create a ruleset with variables that acts as a template, I use a macro to populate it

view this post on Zulip Grahame Grieve (Sep 14 2020 at 00:07):

the core build includes all the functionality to do this, but I never got around to making it a part of the IG publisher. I should do that


Last updated: Apr 12 2022 at 19:14 UTC