Stream: conformance
Topic: StructureDefinition.type for Logical Models/Custom Resources
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.
-
This says that when
type
is relative, it is relative tohttp://hl7.org/fhir/StructureDefinition
, and since (I think) the tail end of the canonical URL is supposed to be the SD'sid
, that seems to imply thattype
==id
. Is that implication correct or am I reading too much into it? -
I've seen some logical models where the
type
does not match theid
, but it does match thename
. Is this expected? Is that even a sensible question? Am I just wrong in thinking thattype
somehow relates toid
orname
for specializations? -
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 aurl
starting withhttp://hl7.org/fhir/StructureDefinition/
? Or does the implied URL of thetype
and the canonical URL of the custom resource not have to be the same? -
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 withhttp://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? -
Do these questions even make sense? ;-)
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
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?
Grahame Grieve (May 27 2021 at 16:06):
(a) required.
Grahame Grieve (May 27 2021 at 16:06):
unless HL7 publishes them.
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).
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.
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.
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
Grahame Grieve (May 27 2021 at 16:20):
yes i changed something recently
Grahame Grieve (May 27 2021 at 16:20):
@Alexander Zautke is there a task for this?
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.
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.
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?
Grahame Grieve (May 27 2021 at 16:42):
yes
Grahame Grieve (May 27 2021 at 16:42):
the tools haven't been good at getting that right until recently
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
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