Stream: implementers
Topic: best approach to programmatically generate snapshot?
Sean McIlvenna (Sep 30 2020 at 16:31):
Any suggestion on what the best approach would be to generate a snapshot for a profile that has a complex hierarchy? i.e. has a baseDefinition of X, which has a baseDefinition of Y, which has a baseDefinition of Z?
Sean McIlvenna (Sep 30 2020 at 16:32):
Hoping there's a solution where I can pass a bundle of all associated base definitions to something and have it generate snapshots for each
Jens Villadsen (Sep 30 2020 at 20:45):
doesn't the IG publisher do so? I mean if you fit all your profiles within the same IG, shouldn't that then be an option?
Jens Villadsen (Sep 30 2020 at 20:45):
then afterwards have a look at the code in the igpub
Chris Moesel (Sep 30 2020 at 20:51):
Snapshot generation is very complex and (as far as I understand) fraught with edge cases, complexities, and unwritten rules. As @Jens Villadsen suggests, I'd highly recommend trying to leverage existing tooling if possible. In addition to the IG Publisher, I believe Firely tools also support snapshot generation (although I'm not sure if it is open source or not).
Grahame Grieve (Oct 01 2020 at 00:07):
right. all the hard stuff is moved to there. I don't think that I've packaged up a simple way to do this, but the logic is all in the java code
Oliver Egger (Oct 01 2020 at 06:01):
@Sean McIlvenna if you are working with the java core classes the functionality is exposed with the java validator , you can use the -snapshot parameter. if you are working with hapi-fhir, see example code here https://hapifhir.io/hapi-fhir/docs/validation/examples.html. You would need to feed the base structuredefinitions first.
Jens Villadsen (Oct 01 2020 at 07:12):
@Sean McIlvenna will be sitting like this :rolling_on_the_floor_laughing: :
image.png
Ward Weistra (Oct 01 2020 at 14:23):
@Sean McIlvenna Indeed, as @Chris Moesel suggests Torinox (soon to be Firely Terminal) can do this quite easily: https://simplifier.net/docs/torinox/SnapshotGeneration. Or you could upload to your project in Simplifier and download including snapshot. Not open source, but all free.
But not sure if that fits in the workflow you have in mind.
Jens Villadsen (Oct 01 2020 at 14:47):
and torinox can be wrapped in docker if you don't like installs: https://github.com/jkiddo/torinox-in-docker
Sean McIlvenna (Oct 01 2020 at 21:44):
appreciate all the feedback... unfortunately, I don't think very many of these solutions fit very nicely with a javascript/node app
Sean McIlvenna (Oct 01 2020 at 21:45):
I can't invoke java code directly... I'd have to execute the java
command with a jar.
The best I can think of is to use $snapshot in the REST API to generate the snapshot
Sean McIlvenna (Oct 01 2020 at 21:46):
but that will depend on the support for the FHIR server's $snapshot
Sean McIlvenna (Oct 01 2020 at 21:46):
at best, all of the profiles will have to be loaded on the FHIR server where $snapshot is called
Last updated: Apr 12 2022 at 19:14 UTC