1

From here I have this:

If differential constraints are specified in this structure, they are applied to the base in a "differential" fashion. If there is no base, then the differential constraints cannot be provided (snapshot only). Differential structures are useful for the editing perspective, and snapshot structures are suitable for operational use. The FHIR Project provides a number of tools/services to populate snapshots from differential constraints. Logical Models have a base of "Element" or another logical model.

and there is this question In FHIR StructureDefinitions (profiles) how do elements aggregate into a snapshot? which covers a very technical description of the transformation, but I'm still lost.

What is the practical implication as an implementer? Can I just take the snapshot and ignore the differential?

and are there practical examples of where there is difference?

Community
  • 1
  • 1
ErichBSchulz
  • 15,047
  • 5
  • 57
  • 61

1 Answers1

4

Implementers typically care about the snapshot - "what is actually allowed". Designers care about the differential - "how are the constraints here different from the parent". Given the base, you can generate one from the other, but it's computationally expensive and systems won't necessarily have the base. So we transmit both perspectives to ensure that the instance can be consumed by both design/rendering tools and by software.

From a "read" perspective, feel free to determine which of the two your system needs to care about and ignore the other. If you're creating instances though, you'll need to populate both. (On the positive side, most of the reference implementations have the logic to generate one from the others, so you can still focus on the one you care about and largely ignore the other.)

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • 1
    ah, ok - so effectively the "snapshot" is the real definition after all the parent properties have been inherited. – ErichBSchulz May 17 '16 at 01:22
  • That is correct. It's also useful when you're not sure you have access to the base (e.g. the base profile is only available at an endpoint you do not manage). – Ewout Kramer May 17 '16 at 10:07
  • What products implement the snapshot generation? – Bert Dec 28 '18 at 11:25
  • I found the answer: FHIR defines the [operation $snapshot on StructureDefinition](http://hl7.org/fhir/structuredefinition-operation-snapshot.html). – Bert Dec 28 '18 at 15:40
  • Validators and most other tools tend to use the snapshot view. Differential is primarily for authoring and rendering - authors document what the differences are and when publsihing it's useful to be able to see what the differences are. But for processing, you need the complete set of rules - which is what the snapshot provides. – Lloyd McKenzie Dec 28 '18 at 16:30