Stream: terminology
Topic: NamingSystem $preferred-id
Peter Jordan (Apr 19 2018 at 04:39):
Any thoughts on adding the new (and rather useful) $preferred-id operation on NamingSystem to the TerminologyCapabilities resource? Has anyone else implemented it yet (will be in the new version of Terminz, for the R4 May 18 build, at the weekend)?
Grahame Grieve (Apr 19 2018 at 05:10):
I have not yet implemented it - keeping up is starting to get hard...
Grahame Grieve (Apr 19 2018 at 05:10):
I think that the role it plays in a terminology server is once people start using FHIR terminology services in the context of v2, CDA, or openEHR, where the FHIR code system URL is not in use
Peter Jordan (May 15 2020 at 05:08):
This appears to be the only operation in the FHIR spec that contains an input parameter called 'id'. This is causing issues with the routing templates in the Controller Class of my .NET Web API server (kindly provided by @Brian Postlethwaite) which treats it as a Resource id. Any objections if I create a ticket to rename this 'identifier'.
Peter Jordan (May 15 2020 at 07:10):
Brian Postlethwaite (May 16 2020 at 05:18):
@Peter Jordan got some details on where the issue is, I'm doing some updates to the API project at the moment and could do some updates for you.
Brian Postlethwaite (May 16 2020 at 05:19):
P. S. Will also be adding it to the public NuGet, so you won't have to build it yourself anymore too.
Peter Jordan (May 16 2020 at 21:34):
@Brian Postlethwaite The Routing Template in the Controller Class that's 'upset' by having an id parameter in the query string is...
[HttpGet, Route("fhir/{resource}/{id=null}/{operation=null}")]
When that's used with the following GET request it matches the id parameter with the {id} element in the template and ignores the {operation} element (possibly because that element precedes the id parameter)...
GET [base] /NamingSystem/$preferred-id?id=2.16.840.1.113883.2.18.2&type=uri
I did a quick search to see if there was an easy fix - i.e. an 'ignore query string' template setting, but couldn't see anything.
Subsequently, I changed the parameter name to 'identifier' and it all worked.
Brian Postlethwaite (May 16 2020 at 23:16):
I'll see if there is something I can do there. Maybe moving the $outside the operation name, or using the [From Query] attribute mark-up.
Brian Postlethwaite (May 16 2020 at 23:54):
I did a quick unit test and didn't see it.
Are you in netcore or the owin version (full framework)
Peter Jordan (May 16 2020 at 23:58):
I'm using Web API - can't recall where I downloaded it from - what's the equivalent routing template in the versions you're looking at?
Brian Postlethwaite (May 17 2020 at 00:00):
Full framework or netcore?
Peter Jordan (May 17 2020 at 00:25):
Full framework.
Brian Postlethwaite (May 17 2020 at 01:35):
Will take a look in that code later.
Brian Postlethwaite (May 17 2020 at 01:52):
http://localhost:7931/NamingSystem/$preferred-id?id=45&type=uri
Goes into the correct Perform operation.
Can you share the link to the source in the github code that you're seeing it hit?
(this might be an older version)
In debugging the above query, it is hitting this line in the FhirController
https://github.com/brianpos/fhir-net-web-api/blob/33abebf2b903bd57046e5c4629e4f67c0c1d5234/src/Hl7.Fhir.WebApi.Owin/FhirController.cs#L263
Peter Jordan (May 17 2020 at 02:43):
...well that line implements [HttpPost, Route("{ResourceName}/${operation}")] - rather than [HttpGet, Route("{ResourceName}/${operation}")]
BUT, I note the use of the $ sign in the template and that's what I may be missing - so will give that a try.
Brian Postlethwaite (May 17 2020 at 02:50):
Ok, I'll recheck my debugger to see if it is doing a get or post.
Brian Postlethwaite (May 17 2020 at 03:00):
Sorry, that was a local branch vs local branch change thing.
It was going through the function that takes the get right above it.
Last updated: Apr 12 2022 at 19:14 UTC