ewoutkramer / strucdefdoc

Documenting HL7 FHIR StructureDefinition
0 stars 0 forks source link

ElementDefintion.Base useless - determining base #1

Open chrisgrenz opened 8 years ago

chrisgrenz commented 8 years ago

Hi Ewout - thought this might be a good place for a sidebar...

Working on out snapshot generator/modeling tool and trying to figure out what the base of an element is (for merging differentials to build up a snapshot). Where I'm at, base is the first of:

  1. If type.Profile is set (for a non-Reference type) for this element or a parent, then the base will come from that profile if available.
  2. Match by element.name to any base profile (any parent via StructureDefinition.base).
  3. Match by element.path to any base profile.
  4. If element is a new slice, then match to the un-sliced element in any base profile.

After that, in my tool, I search the potential children of the parent's base element.

The DAF profiles have been good test cases for this - especially if you define a constraint profile based on a DAF profile and specify elements "deep" into the profile, e.g. change the label for Patient.extension(race).valueCodeableConcept.coding.display. This causes you to navigate:

  1. A slice with a profiled type (race).
  2. An variable type element (value[x]).
  3. A type within a type within a type.
chrisgrenz commented 8 years ago

Correct base elements (I think) in a DAF-Patient based SD with element Patient.extension(race).valueCodeableConcept.coding.display: