FHIR Chat · example generator · shorthand

Stream: shorthand

Topic: example generator


view this post on Zulip Catherine Hosage Norman (Mar 04 2022 at 23:02):

Has the SUSHI team ever thought about pulling out the instance generation feature of SUSHI to make example files for testing? It is a heavy work load to create files for processing in connect-a-thons of some of the more complicated IGs. How complicated would it be? I know you would need the IG, but is there a way to parameterize the sushi command to refer to the IG validator then generate the instances to a specified folder?

view this post on Zulip Chris Moesel (Mar 07 2022 at 17:26):

Hi @Catherine Hosage Norman. Are you asking about the possibility of SUSHI automatically generating examples based on the profile definitions? If so, it's something we've very briefly thought about but haven't really pursued -- as SUSHI is more focused on the use case of intentional examples authored by humans.

I do recall people talking about creating scripts that would generate FSH files w/ examples (perhaps driven by spreadsheet input) and then having SUSHI process those files -- but that's a bit different since it's a separate script doing all the hard work (not SUSHI).

I've also heard people talk about potentially extending Synthea to support generating examples from IGs -- although I don't know if anyone has yet done it.

view this post on Zulip Catherine Hosage Norman (Mar 07 2022 at 18:37):

I am asking about the possibility of SUSHI generating examples based on the Instance syntax, except you do not have to generate the output for the whole IG, just fork the examples to a designated folder. I am thinking of the instance files in a desinated folder outside of the fsh folder and the IG structure. Especially if the IG is already generated, pointing to the validator created by the build. The target user is someone testing the data structures of the IG without a lot of FHIR knowelege. I did create an Excel basic code for a prototype a couple of years ago that used xslt to output FHIR from the values in the datasheet cells. I will have so many of these to do in the comming year, I am looking for a faster method. For one connectathon I hand built files in Altova. This is not something that we can expect end useres to do.

view this post on Zulip Catherine Hosage Norman (Mar 07 2022 at 18:48):

This use case has its roots in there being no software industry that is supporting regulatory FHIR. The health care software industry is tuned into FHIR and is extending current software. The regulatory arena does not have a comparable software industry that will develop at risk prior to notice that the standards being required. Since this is all brand new, it would be prudent to not only kick the tires, but test drive on an interstate.

view this post on Zulip Chris Moesel (Mar 09 2022 at 20:46):

Hi @Catherine Hosage Norman. If I understand you correctly, I think that what you're looking for could be fairly easily built using the SUSHI API.

view this post on Zulip Catherine Hosage Norman (Mar 09 2022 at 23:46):

This looks promising. I am under time constraints now to get this IG done. Will look into this soon.

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:49):

  1. Ping @Richard Stanley

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:50):

  1. We should really get this standardized @Lloyd McKenzie

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:54):

'This' could be 'test data expression', one that contains an expression of some type, like date(random) or val(colX) or lookup(random,colX)...

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:55):

(meaning: a random date, the current value of ColX - eg in a lookup file, and lookup a random row in ColX)

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:55):

Or anything else really

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:57):

My idea is that we should have a standard extension. Then fsh can create its own syntax (e.g. with handlebars) and parse that and create the extension

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:58):

This extension would be in a definition resource (usually structuredef).
And when requested, sushi/publisher(?) Can actually run the creation of instances from the definition

view this post on Zulip Jose Costa Teixeira (Mar 10 2022 at 04:59):

This should be aligned with synthea and with TestScript

view this post on Zulip Elliot Silver (Mar 10 2022 at 16:00):

Jose Costa Teixeira said:

This should be aligned with synthea and with TestScript

I'm not sure how much is inherited from Testscript, but Touchstone has some nice capabilities for generating test instances from text configuration. It would be good if this used a similar solution/syntax. (@Richard Ettema)

view this post on Zulip John Silva (Mar 11 2022 at 11:43):

One that might be useful for dates is date.Now() or date("Now") as well as relative dates, e.g when you need the test data to be consistently relative to a certain date. Maybe date.Now(-{offsetIn}) where {offset} could be specified with a date type identifier, e.g. date.Now(-20d) or date.Now(-36h), etc. The use case for this is if you wanted to have certain test data generated within and outside of the time window for inclusion in some criteria (CQL look-back window?)
(I've done this for a completely different project because we needed control of the relative dates, e.g. or Observations, for our testing.)

view this post on Zulip Richard Ettema (Mar 11 2022 at 17:54):

We have a Touchstone Testing IG that defines TestScript extensions and additional functionality where date generation can be performed. We follow the TestScript variable format; for example, "${CURRENTDATETIME}". Date arithmetic can be added in the form of addition arguments that defines date formatted offsets. So, if you wanted to generate a date 10 days before the current date, you would use "${CURRENTDATE,d,-10}".

Here's the link to our IG that defines this functionality - https://touchstone.aegis.net/touchstone/fhir/testing/1.5.0/guidance.html#functions-for-dynamic-data-generation.

view this post on Zulip Jason Walonoski (Mar 18 2022 at 17:14):

The Synthea team is looking at ways to generate data given an arbitrary IG. Data that meets our modest standards (meaning it goes beyond just random noise). Progress is slow. Having built-in hints and expressions in an IG -- whether in the profile StructureDefinitions directly, or in example resources -- would be helpful.

view this post on Zulip Jose Costa Teixeira (Mar 20 2022 at 22:44):

IMO we'd end up with a standard extension like "DataGenerationExpression" to apply in StructureDefs (and other) resources, on each element.
It should be a FHIR thing (i.e. not sushi).
I can put some thoughts together, but ideally there would be some discussion on this. But where?


Last updated: Apr 12 2022 at 19:14 UTC