FHIR Chat · StructureDefinition.type for Logical Models/Custom Resources · conformance

Stream: conformance

Topic: StructureDefinition.type for Logical Models/Custom Resources


view this post on Zulip Chris Moesel (May 24 2021 at 22:38):

I'm trying to determine rules for StructureDefinition.type as it pertains to specializations. The definition of StructureDefinition.type includes the following:

References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. "string" is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.

  1. This says that when type is relative, it is relative to http://hl7.org/fhir/StructureDefinition, and since (I think) the tail end of the canonical URL is supposed to be the SD's id, that seems to imply that type == id. Is that implication correct or am I reading too much into it?

  2. I've seen some logical models where the type does not match the id, but it does match the name. Is this expected? Is that even a sensible question? Am I just wrong in thinking that type somehow relates to id or name for specializations?

  3. Since custom resources are not logical models, and logical models are the only ones allowed to use absolute URLs for type, does that imply that custom resources should have a url starting with http://hl7.org/fhir/StructureDefinition/? Or does the implied URL of the type and the canonical URL of the custom resource not have to be the same?

  4. Similarly, my experience has been that many logical model definitions do not use absolute URLs for their type value. Does this also imply that their URLs should start with http://hl7.org/fhir/StructureDefinition/ and should be unique in that namespace (which seems not to be feasible to me)? Or are those logical models just wrong to specify a type that is not an absolute URL?

  5. Do these questions even make sense? ;-)

view this post on Zulip Grahame Grieve (May 24 2021 at 22:58):

#1 type = id for HL7 defined StructureDefinitions when published by HL7. But that may not be true as soon as they are hosted on any other server, since id is under local control

#2 technically, name is the name of the definition of the type, and type is the name of the type. But those are hardly ever different

#3 I'm not sure I understand this question. There is no implied URL of the type except for hl7.org/fhir/StructureDefinition, and we're the only ones allowed to publish in that space

#4 "many logical model definitions do not use absolute URLs for their type value" - should be corrected

view this post on Zulip Chris Moesel (May 27 2021 at 15:48):

@Grahame Grieve -- just to ensure we're on the same page... Re: #4, are you saying that logical models should always use an absolute URL as their StructureDefinition.type? In other words, for logical models, is using an absolute URL as the StructureDefinition.type (a) required, (b) best practice, or (c) totally optional?

view this post on Zulip Grahame Grieve (May 27 2021 at 16:06):

(a) required.

view this post on Zulip Grahame Grieve (May 27 2021 at 16:06):

unless HL7 publishes them.

view this post on Zulip Chris Moesel (May 27 2021 at 16:14):

Did you recently fix something related to this in the IG Publisher? We are implementing this and it seems that some people running an older version of the publisher (1.1.64) ran into issues, but it seemed to work fine for me (using 1.1.72).

view this post on Zulip Chris Moesel (May 27 2021 at 16:15):

Not positive we can attribute the differences to the publisher (needs more investigation), but if you confirm there was a recent fix, then that would solve the mystery.

view this post on Zulip Alexander Zautke (May 27 2021 at 16:17):

Having discussed this before, I think that we should clarify in a tracker item if "For logical models, where the type is a URL, the type name SHOULD start with the tail of the type URL where required." implies a SHALL requirement for StructureDefinition.type to be an absolute url. See description for StructureDefiniton.type.

view this post on Zulip Alexander Zautke (May 27 2021 at 16:19):

Forge for example does not enforce an absolute url here, it will just give the user a warning

view this post on Zulip Grahame Grieve (May 27 2021 at 16:20):

yes i changed something recently

view this post on Zulip Grahame Grieve (May 27 2021 at 16:20):

@Alexander Zautke is there a task for this?

view this post on Zulip Chris Moesel (May 27 2021 at 16:20):

Right, we have seen some confusion where people interpreted "absolute URLs are only allowed in logical models" as being optional ("allowed" vs "required"). If you consider the preceding statements (that relative URLs are relative to "http://hl7.org/fhir/StructureDefinition/") it kind of makes sense, but I think we could be more explicit to reduce confusion.

view this post on Zulip Alexander Zautke (May 27 2021 at 16:25):

Grahame Grieve said:

Alexander Zautke is there a task for this?

No, just a proposal from my side. The only exception that Forge relies on is the ones specified in sdf-15 and sdf-8, it'll use only the tail of the canonical as the type in the diff or snapshot, not the full url.

view this post on Zulip Chris Moesel (May 27 2021 at 16:36):

Also, just to clarify. If I have a logical model w/ "type": "http://foo.org/StructureDefinition/Bar" and another logical model defines an element that has that model as its element type, then the element that is defined to be that type should have:

"type": [{
  "code": "http://foo.org/StructureDefinition/Bar"
}]

right?

view this post on Zulip Grahame Grieve (May 27 2021 at 16:42):

yes

view this post on Zulip Grahame Grieve (May 27 2021 at 16:42):

the tools haven't been good at getting that right until recently

view this post on Zulip Alexander Henket (Aug 18 2021 at 09:49):

Is this something that needs updating in the CDA R2.0 LoMo then? https://github.com/HL7/cda-core-2.0/blob/master/input/resources/ClinicalDocument.xml

view this post on Zulip Alexander Zautke (Aug 30 2021 at 20:04):

@Alexander Henket As discussed in todays FHIR-I call, those logical models need to be updated. See resolution of FHIR-33065.


Last updated: Apr 12 2022 at 19:14 UTC