FHIR Chat · Differential to Snapshot code · implementers

Stream: implementers

Topic: Differential to Snapshot code


view this post on Zulip Jonny Rylands (Mar 09 2016 at 13:41):

Does anyone know if there is any open source code available to generate a StructureDefinition snapshot from a differential (and its base differentials)? (C# preferably)

view this post on Zulip Marten Smits (Mar 09 2016 at 13:44):

Hi Jonny, yes there is code that does that here: https://github.com/ewoutkramer/fhir-net-api/tree/develop/src/Hl7.Fhir.Specification/Specification/Snapshot

view this post on Zulip Jonny Rylands (Mar 09 2016 at 13:45):

Excellent thanks :-)

view this post on Zulip Marten Smits (Mar 09 2016 at 13:45):

It is still under development I think, but it's come a long way. @Ewout Kramer knows the current status.

view this post on Zulip Jonny Rylands (Mar 09 2016 at 14:48):

Do you use Ewout's Snapshot generator in Forge?

view this post on Zulip Jonny Rylands (Mar 09 2016 at 16:18):

@Marten Smits @Ewout Kramer I think there might be a bug in the Snapshot generator - I'm trying to generate a snapshot of an Organization profile. When the generator looks for the boolean base type for the "Organization.active" element, the following line passes in "Boolean" to ArtifactResolver:

var coreType = resolver.GetStructureDefinitionForCoreType(defn.Type[0].Code.ToString());

The ArtifactResolver can't find the definition for "Boolean" because it is defined "boolean".

Apologies if I'm doing something stupid, but it looks like it could be a bug, as other base resources such as "ContactPoint", "Identifier" as being resolved fine.

view this post on Zulip Marten Smits (Mar 09 2016 at 16:39):

Thanks that is a bug indeed. I'll fix it right away.

view this post on Zulip Jonny Rylands (Mar 09 2016 at 16:43):

Great - I'll pull an update when you're done.

view this post on Zulip Marten Smits (Mar 09 2016 at 16:46):

Should be available now

view this post on Zulip Jonny Rylands (Mar 09 2016 at 16:47):

is it the master branch in this repo?
https://github.com/ewoutkramer/fhir-net-api

view this post on Zulip Marten Smits (Mar 09 2016 at 16:47):

it's in the develop branch

view this post on Zulip Jonny Rylands (Mar 09 2016 at 16:47):

ok

view this post on Zulip Jonny Rylands (Mar 09 2016 at 16:58):

that's working great now thanks :-)

view this post on Zulip Marten Smits (Mar 09 2016 at 16:58):

No problem :-)

view this post on Zulip Grahame Grieve (Mar 09 2016 at 20:42):

Jonny - the java reference implementation also does this too, and it's open source. In addition, my server also does this, and it's also open source too

view this post on Zulip Michel Rutten (Mar 10 2016 at 10:18):

@Jonny, Forge still performs snapshot expansion using custom application logic. So the results might slightly differ from other tools that also perform expansion. We are planning to deprecate the custom Forge expansion logic and leverage the new FHIR API snapshot generation in a future release, in order to have a uniform implementation across different tools.

view this post on Zulip Jonny Rylands (Mar 10 2016 at 10:45):

Ok thanks.

view this post on Zulip Ewout Kramer (Mar 14 2016 at 08:04):

Yeah. That looks like an incorrect fix for when we updated the model generation to C#: the Type[x].Code went from a string to an enum, and I did a quickfix by putting ToString() there, but that's obviously wrong. This really should be ModelInfo.FhirTypeToFhirTypeName(defn.Type[0].Code). Can you try that?

view this post on Zulip Ewout Kramer (Mar 14 2016 at 08:30):

Oops, just noticed Marten has already fixed that. Still have to get used to Zulip, sorry ;-)


Last updated: Apr 12 2022 at 19:14 UTC