In FHIR StructureDefinitions (profiles) how do elements aggregate into a snapshot?

独自空忆成欢 提交于 2020-01-15 20:29:41

问题


How does one "roll up" or aggregate differential elements with "base" elements to create a snapshot?


回答1:


Snapshot generation combines attributes from base elements (elements defined in the base profiles) with the differential elements in the constraint profile. Matching of elements from constraint to base is by name (if present in both) and path. A slice in a constraint ("homePhone") uses the bare path ("Patient.telecom") as the base element. Re-slices use the most complete slice from the base that matches.

Base elements can be sourced from either:

  1. A snapshot of the StructureDefinition identified by the constraint profiles's StructureDefinition.base value.
  2. A recursive application of these rules up the StructureDefinition "tree" (base to base to base ad nauseam).

IF the constraint profile includes elements from within a complex type (e.g. path=Patient.telecom.system), the base element will be found in the first of:

  • The profile identified in type.profile for the element (if any).
  • The HL7 provide datatype profile for the type (e.g. ContactPoint in this example).

Elements are brought into the snapshot using one of these methods:

  • K - matching keys that must be present in both base and constraint profiles for matching the element
  • F - fixed from the base and cannot be overriden. If present in the differential this value must match the base exactly
  • I - inherited from the base if not present in the constraint
  • N - not inherited and can be set in the constraint. If blank/missing in the differential, will be blank/missing in the snapshot.
  • F/N - if present in the base, the constraint must match. If not, a value may be set.
  • A - aggregated from the base - base instances are added to differential instances
  • R - restricted from base - the differential must be some subset of the base instances

Element by element:

  • path (K) - required in both base and constraint for matching.
  • representation (F)
  • name (K) - required in both base and constraint if appropriate
  • label (I)
  • code (A)
  • slicing (F/N) - if the base is sliced, the constraint must match. If not, a slicing can be introduced. Also see reslicing.
  • short (I)
  • definition (I)
  • comments (I)
  • alias (A)
  • min (I) - min in constraint must be greater or equal to base. Slices are relieved from this constraint (a slice may be min=0 when base is min=1 due to the possibility of other slices satisfying the base's min constraint).
  • max (I) - similar to min.
  • base (F)
  • type (R) - types must have a code present in the base element. They can add profiles and/or specify type code multiple times with different profiles.
  • nameReference (F)
  • defaultValue[x] (F)
  • meaningWhenMissing (F)
  • fixed[x] (F/N)
  • pattern[x] (F/N) - exception is that pattern can be refined to fixed.
  • example[x] (I)
  • minValue[x] (I)
  • maxValue[x] (I)
  • condition (A)
  • constraint (A)
  • mustSupport (F/N)
  • isModifier (F)
  • isSummary (F)
  • binding (A)
  • mapping (A)



回答2:


Chris, I have started working on this, but this is really work in progress. Would love to cooperate with you:

https://github.com/ewoutkramer/strucdefdoc/wiki/SD's-expressing-constraints

(it's part of a wiki describing the StructureDefinition more in full)



来源:https://stackoverflow.com/questions/34183525/in-fhir-structuredefinitions-profiles-how-do-elements-aggregate-into-a-snapsho

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!