FHIR Chat · logical id assignment on create · implementers

Stream: implementers

Topic: logical id assignment on create


view this post on Zulip Brian Reinhold (Feb 07 2019 at 13:14):

I have not found any clear text that tells me what the logical id is that is assigned to a newly created resource. For example, I upload a resource with a create operation and the response gives me
"location": "Patient/12423/_history/1",
If I retrieve that resource will the logical id be
12423
or
12423/_history/1?

What will happen if I do a search based on Patient/12423 vs Patient/12423/_history/1?

view this post on Zulip Michael Donnelly (Feb 07 2019 at 14:09):

What server is returning that?

view this post on Zulip Lloyd McKenzie (Feb 07 2019 at 15:42):

logial id is 12423. 1 is the version. If you do a version-specific GET, you'll get that version, even if it isn't the current version. If you do a GET with only the logical id, you'll get the current version of the resource.

view this post on Zulip René Spronk (Feb 09 2019 at 08:43):

? wouldn't the logical Id be Patient/12432, to distinguish between itself and e.g. Observation/12432 ?

view this post on Zulip Lloyd McKenzie (Feb 09 2019 at 16:06):

Logical id is within the scope of the resource type

view this post on Zulip René Spronk (Feb 10 2019 at 09:36):

So 'logical Id' is only unique (as an identifier for a particular resource instance) if combined with the Resource type and the Base URL. Note that the concept of resources having a URL next to a business identifier is a hard thing to understand for non-web programmers. What's the purpose (if any) of the Logical id besides it being part of a resource URL?
In entry level training courses we've switched to use the terms "location id" (=URL, id of the storage location, the locker number, like the id of a web page) and business id (the id of the thing contained in the locker).

view this post on Zulip Grahame Grieve (Feb 10 2019 at 09:54):

indeed, that's a very good question. And initially, we didn't have the id as part of the resource, since it's only function was to duplicate the resource id implicit in the URL. But implementers strongly preferred it to be present for convenience (and it mostly is in other RESTful APIs), so we added it. You should describe it as a denormalization for convenience

view this post on Zulip Lloyd McKenzie (Feb 10 2019 at 16:35):

I think of it like a primary key. Like a primary key, it's only unique within a specific table (resource) and database (server).


Last updated: Apr 12 2022 at 19:14 UTC