FHIR Chat · IGPub Error: Models - element.base cannot appear... · IG creation

Stream: IG creation

Topic: IGPub Error: Models - element.base cannot appear...


view this post on Zulip Chris Moesel (Mar 25 2018 at 22:57):

I'm not sure what to make of the following error being reported by the IG Publisher:

Path: StructureDefinition/oncology-StageTimingPrefix-model: StructureDefinition
Severity: error
Message: element.base cannot appear if there is no base on the structure definition [snapshot.exists() implies (snapshot.element.base.exists() = baseDefinition.exists())]

I see that a lot. Above is just an example.

In my structure definition, I declare a baseDefinition:

"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Element"

I don't have any snapshot elements, however, that use base, as none of them are based on a parent element. Is that my problem? Should I be adding a base on my root element that points to Element?

view this post on Zulip Chris Moesel (Mar 25 2018 at 23:02):

I don't know if this is related, but I just noticed that when the IG Publisher processes my logical models, it seems to insert a base on every one of my snapshot elements. For example, in the example above (StructureDefinition/oncology-StageTimingPrefix-model), although I didn't put any base properties in the elements, the JSON in my IG now has:

"base" : {
  "path" : "oncology-StageTimingPrefix-model",
  "min" : 0,
  "max" : "*"
}

and

"base" : {
  "path" : "oncology-StageTimingPrefix-model.value",
  "min" : 1,
  "max" : "1"
}

Is this expected? And is it related to my post above?

view this post on Zulip Grahame Grieve (Mar 26 2018 at 03:34):

umm. I'm not sure what the right solution to this one is. For r4, all the base elements must be populated

view this post on Zulip Grahame Grieve (Mar 26 2018 at 03:34):

so this appears to be an R4 issue, and you should populate base on the snapshot properly

view this post on Zulip Chris Moesel (Mar 26 2018 at 12:42):

OK. So when I'm creating a new logical model and declaring a brand new element not based on anything, just set the base to itself (e.g., copy its own path and cardinality)? Is that what you're suggesting?

view this post on Zulip Michel Rutten (Mar 26 2018 at 12:52):

In STU3, logical model element definitions don't have a base at all. Forge for STU3 generates logical models w/o any base component. According to the spec, ElementDefinition.base is still optional in R4:
http://build.fhir.org/elementdefinition-definitions.html#ElementDefinition.base
However the R4 spec now also states: "For tooling simplicity, the base information must always be populated in element definitions in snap shots, even if it is the same."
So I guess we should clarify the use of .base specifically for logical models.

view this post on Zulip Michel Rutten (Mar 26 2018 at 12:55):

Also see GF#12295

view this post on Zulip Chris Moesel (Mar 26 2018 at 14:08):

Thanks for the extra information, @Michel Rutten. I now understand what Grahame meant by "it's an R4 issue"... So even though I'm publishing a STU3 IG, the publisher is enforcing an R4 rule in this case. Assuming that it's not outright wrong to generate an STU3 element with itself as a base, and since the publisher is inserting a base at publish-time anyway, I'll probably go ahead and add it to my STU3 models. One less thing to do when we eventually move to R4!

view this post on Zulip Michel Rutten (Mar 26 2018 at 14:21):

Hi @Chris Moesel, If I recall correctly, Chris Grenz (submitter of GF#12295) proposed that in R4, the .base property of newly introduced elements (allowed in resource definitions and logical model definitions) should simply refer to the element itself (empty in STU3). So your approach conforms to Chris' proposal for R4.

view this post on Zulip Grahame Grieve (Mar 26 2018 at 19:00):

I

view this post on Zulip Grahame Grieve (Mar 26 2018 at 19:01):

I'm not quite sure why that's being applied to an R3 logical model.


Last updated: Apr 12 2022 at 19:14 UTC