Stream: terminology
Topic: CodeSystem $lookup
Richard Kavanagh (Feb 13 2020 at 12:38):
I'm trying to retrieve the definition of a concept from a code system
{{url}}/CodeSystem/$lookup?system=http://acme.co.uk/data1&code=T1636
does not return it, nor does
{{url}}/CodeSystem/$lookup?system=http://acme.co.uk/data1&code=T1636&property=definition
How should I request this?
Grahame Grieve (Feb 13 2020 at 12:38):
those look ok but the server has to know the code system. you don't say what the response actually is
Richard Kavanagh (Feb 13 2020 at 12:40):
The response is an empty parameter resource pasted image
Grahame Grieve (Feb 13 2020 at 12:40):
wooah. which server? I sure hope it's not mine ;-)
Richard Kavanagh (Feb 13 2020 at 12:41):
Nope - not yours. :-)
Grahame Grieve (Feb 13 2020 at 12:42):
well, whichever one it is, it has a bug, because that's not a valid response
Yunwei Wang (Feb 13 2020 at 14:28):
Should we require Parameters resource having at least one parameter in it? Empty Parameters resource does not make any sense.
Lloyd McKenzie (Feb 13 2020 at 15:02):
There's a base constraint that an empty resource of any type is not permitted. You always have to have at least one element that has a value
Yunwei Wang (Feb 13 2020 at 18:41):
@Lloyd McKenzie where is that defined? I don't find it in Resource page.
Lloyd McKenzie (Feb 13 2020 at 20:35):
It's defined on Element (holds for Resource and everything in it. Look here and search for ele-1: view-source:hl7.org/fhir/element.html
Richard Kavanagh (Feb 13 2020 at 22:22):
In this case, it appears to be a defect. It has been logged and I'm sure it will be addressed in due course.
Grahame Grieve (Feb 13 2020 at 22:32):
defined on element doesn't mean defined on Resource
Michael Lawley (Feb 13 2020 at 22:32):
Interesting. I'm wondering what a server should return in the case that only a single property has been requested and the code does not have a value for that property. I don't believe a 400-series error is warranted , so what should the Parameters contain? (I know an OperationOutcome is a possibility, but I expect many (most?) clients are not written to expect that option.)
Grahame Grieve (Feb 13 2020 at 22:32):
I think a not found is warranted
Lloyd McKenzie (Feb 13 2020 at 23:24):
@Grahame Grieve you're right. So it seems we don't have any rule that prohibits having a totally empty resource. Shouldn't we? Should ele-1 get moved up to 'Base'?
Michael Lawley (Feb 14 2020 at 01:33):
Looking at @Grahame Grieve 's server with this example: {{url}}/CodeSystem/$lookup?system=http://hl7.org/fhir/CodeSystem/example&code=chol-mmol&_format=json&property=definition
it appears to not support the property definition
and instead returns just the code system name and version.
Grahame Grieve (Feb 14 2020 at 02:08):
Shouldn't we? Should ele-1 get moved up to 'Base'?
No, there are circumstances where you can have an empty Parameters resource
Grahame Grieve (Feb 14 2020 at 02:09):
appears to not support the property definition
hmm. I'll test...
Michael Lawley (Feb 14 2020 at 02:28):
Just to clear up details regarding the empty Parameters resource being invalid in this case (for the $lookup result), this is because the operation defines mandatory parameters ("name" and "display") in the result
Grahame Grieve (Feb 14 2020 at 03:47):
y. which is why not found = 404
Michael Lawley (Feb 14 2020 at 06:57):
We've opted to always return name & display now, so 404 only when code or system is not found.
John Timm (Mar 11 2020 at 20:37):
On the topic of empty Resources, every Resource schematron that is generated includes a global-1
constraint that looks like this:
<sch:pattern> <sch:title>Global 1</sch:title> <sch:rule context="f:*"> <sch:assert test="@value|f:*|h:div">global-1: All FHIR elements must have a @value or children</sch:assert> </sch:rule> </sch:pattern>
Context is f:*
which I think means "any element (in the FHIR namespace)"
Applying that to the root element of a FHIR XML payload, it is looking for one of:
@value
, f:*
, or h:div
which I think means:
an attribute named "value", any sub-element (in the FHIR namespace) , or a div tag for the narrative block XHTML subset.
I'm wondering if this particular constraint allows for an empty resource as suggested above.
Grahame Grieve (Mar 11 2020 at 20:47):
well, it doesn't, and the schematron is actually wrong. :unamused:
John Timm (Mar 11 2020 at 20:47):
Shall I create a ticket?
Grahame Grieve (Mar 11 2020 at 21:05):
yes I suppose. that particular schematron is going to unpleasant when it exempts resources from the rules
John Timm (Mar 12 2020 at 15:13):
https://jira.hl7.org/projects/FHIR/issues/FHIR-26565
Last updated: Apr 12 2022 at 19:14 UTC