Stream: implementers
Topic: canonical resource version handling
Shankar (Jul 15 2020 at 14:03):
Hi, we have a requirement to support terminology catalogs (German EBM Catalogs) in our solution. Each catalog can have multiple business versions to be supported at the same time. How can we achieve this behavior catalogs being canonical terminology resources? I found the following example in Fhir Site.
A value set is posted to a server (POST [base]/ValueSet) with ValueSet.url = "http://acme.com/valuesets/example". This is identified as the 1st version of the value set (ValueSet.version = 1). When the server gets it, it assigns an identity e.g. ValueSet.id = x1, and ValueSet.meta.versionId = 1. Later, another user creates a revised version of the value set, and this is called version 2. This time, as well as supporting this new version 2, there are production systems still using version 1, and both need to be valid on the value set server. So a new value set is created on the server (POST [base]/ValueSet) and is assigned the identiity 'x2'.
Now, there are two different value sets, both with URL "http://acme.com/valuesets/example". One has ValueSet.id = x1, ValueSet.version = 1 and ValueSet.meta.versionId = 1 and the other has ValueSet.id = x2, ValueSet.version = 2 and ValueSet.meta.versionId = 1
In this example, 'example' resource has two business versions. I am confused to understand this. Does it mean we shall always query/read always using 'id' (GET [base]/ValueSet/x1) ? Why this pattern is not strictly followed for conformance resources in the fhir specification?
Is it a valid request (GET [base]/ValueSet/example)? If yes, which business version shall be obtained in the above example?
Thanks in advance
Shankar
Lloyd McKenzie (Jul 15 2020 at 17:15):
If you do a straight read, it'll be driven by the 'id', not the canonical URL. If you do a search filtering by canonical URL, you'll get both. If you have a canonical reference and want to know how the system will resolve between the two, it'll look at the .version element and if it can figure out a precedence between the two, it'll give the most recent. If it can't, behavior is undefined.
Shankar (Jul 16 2020 at 04:59):
is it a good idea in that case to mandate the "id" field for canonical resources?
Lloyd McKenzie (Jul 16 2020 at 05:08):
You can't - because different servers use different styles of ids - and also because there are legitimate reasons to have multiple instances with the same canonical URL on the same server (i.e. different versions).
Signe Hejgaard Kristoffersen (Jul 16 2020 at 11:05):
@Lloyd McKenzie when you say different versions, do you mean record version or business version?
Lloyd McKenzie (Jul 16 2020 at 13:19):
Business version
Signe Hejgaard Kristoffersen (Jul 16 2020 at 13:26):
Okay. Just tried creating two CodeSystems with the same url but different versions at hapi.fhir.org, butI got the error: "Can not create multiple CodeSystem resources with CodeSystem.url \"http://provdennetest.dk\", already have one with resource ID: CodeSystem/xxx" for the second instance. But this should work then?
Lloyd McKenzie (Jul 16 2020 at 13:34):
Servers are always allowed to enforce their own business rules, but yes, a server that supported multiple instances with the same canonical URL but different 'version' elements would be fully conformant.
Last updated: Apr 12 2022 at 19:14 UTC