FHIR Chat · Reusable RuleSets · shorthand

Stream: shorthand

Topic: Reusable RuleSets


view this post on Zulip Jose Costa Teixeira (Jan 17 2022 at 11:01):

Is there a way to reuse a fsh file across IGs yet? For example for rulesets and common conventions/aliases...

view this post on Zulip David Pyke (Jan 18 2022 at 13:37):

Only by copying the files into the fsh directory...

view this post on Zulip Chris Moesel (Jan 18 2022 at 14:03):

@David Pyke is correct. We don't have any more sophisticated mechanisms for sharing FSH entities at this point. It is something we've thought about as a future improvement, but we haven't done much more than think about it at this point.

view this post on Zulip Elliot Silver (Jan 22 2022 at 22:02):

@Jose Costa Teixeira , see J#28949. I requested this a while ago.

view this post on Zulip Jose Costa Teixeira (Jan 22 2022 at 22:14):

I was probably having this as an influence. In fact I only thought of this because you taught me how to separate those common functions.

view this post on Zulip Jose Costa Teixeira (Jan 22 2022 at 22:15):

@Chris Moesel FWIW, I'd upvote this

view this post on Zulip Elliot Silver (Jan 22 2022 at 22:16):

David Pyke said:

Only by copying the files into the fsh directory...

Symlink for the win!

view this post on Zulip Jose Costa Teixeira (Jan 22 2022 at 23:31):

or package and DependsOn

view this post on Zulip Chris Moesel (Jan 24 2022 at 13:50):

If you're comfortable with git submodules (or willing to learn), that could be an effective way of sharing common FSH files across multiple projects.

view this post on Zulip Jose Costa Teixeira (Feb 02 2022 at 11:25):

I had considered trying that. The problem with git submodules is that i don't think we can put that on a commit, can we?

view this post on Zulip Chris Moesel (Feb 02 2022 at 14:02):

Ah, yeah. I forgot that submodules need to be explicitly managed (e.g., you need to use git clone --recursive when cloning, git submodule update, etc.). Good point, @Jose Costa Teixeira. It might not work in the current FHIR ecosystem, and even if it did, it would be difficult to appropriately version it.

view this post on Zulip Chris Moesel (Feb 02 2022 at 14:06):

Let's explore what it would look like to have shareable FSH... I see a few options:

  1. Add FSH files to FHIR packages so they have the final FHIR artifacts, but also the FSH source.
  2. Create FSH-only packages and publish them somewhere (but where? NPM registry?).
  3. Specify GitHub project URLs as dependencies and SUSHI finds FSH files there.
  4. Something else?

Thoughts?

view this post on Zulip Ward Weistra (Feb 03 2022 at 10:13):

Theoretically you could make a /fsh folder in your package and share whatever you want. Be careful not to bloat packages too much though :smile:

view this post on Zulip Jose Costa Teixeira (Feb 03 2022 at 17:46):

adding a fsh folder would mean using dependsOn, right?

view this post on Zulip Jose Costa Teixeira (Feb 03 2022 at 17:47):

(btw dragging @Carl Leitner @Luke Duncan into this)

view this post on Zulip Jose Costa Teixeira (Feb 03 2022 at 17:47):

and if that is the case, we'd end up having an entire IG as a repository of common functions, right?

view this post on Zulip Jose Costa Teixeira (Feb 03 2022 at 17:49):

  • yay points: It's an IG and we know how to manage that lifecycle
  • nay points: it's an entire IG (and will the IG build without any artifact, just the fsh functions?)

view this post on Zulip Richard Stanley (Feb 04 2022 at 19:20):

The idea to add FSH files to FHIR packages appeals to me though I'm not sure how that would work as an end user of FSH.

view this post on Zulip Jose Costa Teixeira (Feb 06 2022 at 18:48):

@Chris Moesel it may be the best option. Worth a try?

view this post on Zulip Jose Costa Teixeira (Feb 06 2022 at 18:49):

@Richard Stanley as a end user of fsh you would just add a dependsOn in your sushi.yaml and you'd get the fsh declarations in that dependency.

view this post on Zulip Jose Costa Teixeira (Feb 06 2022 at 18:50):

Tricky thing is that sushi should not save the dependencies as fhir resources for the IG. It would need to use them but not publish them

view this post on Zulip Chris Moesel (Feb 07 2022 at 14:46):

@Jose Costa Teixeira -- we have a few things on our plate right now, so this will probably stay in "idea phase" for a little while. I just wanted to get people's thoughts on things. Regarding using the standard FHIR packages to share FSH, there are a few points to consider:

  • The IGP would need to be updated to include the FSH code when it creates a package (I don't think it does that right now).
  • Should we support identifying if a dependency package is just needed for the FSH or also for formal dependencies? In the former case, it would not need to be listed in the generated IG JSON.
  • Similar to above, should authors have to say that they WANT to use the FSH in a dependency (we could run into some weird unintentional situations otherwise).
  • What things can be shared as FSH? Just RuleSets? Aliases? Everything?

view this post on Zulip Jose Costa Teixeira (Feb 07 2022 at 15:00):

right. That may be the longest path then. Perhaps we do need to consider alternatives only from the sushi / fsh side

view this post on Zulip Jose Costa Teixeira (Feb 07 2022 at 15:01):

e.g. a special line of sushi for includes??

view this post on Zulip Elliot Silver (Feb 07 2022 at 18:31):

Personally, I think going the package route is over-engineering the problem, and likely to create as many issues as it solves. Go with some simple include directories.


Last updated: Apr 12 2022 at 19:14 UTC