Stream: implementers
Topic: Retrieving SNOMED codelists with FHIR .net API
Bjørn Erik Nordal (Dec 08 2020 at 16:00):
I am trying to retrieve SNOMED codelists with the Firely .net SDK, but so far no luck. I just keep getting an error "Compose element(s) or 'url' parameter is expected to be present for an expansion, containing eg http://snomed.info/sct?fhir_vs=ecl/ or http://snomed.info/sct/45991000052106?fhir_vs=ecl/)" whatever i put into the Expand query. I guess I dont have the parameters right. Does anyone have a working sample of this? Any tips? I have tried these combinations of parameters for address and identifier / valueset [TestCase("https://snowstorm-training.snomedtools.org/fhir", "http://snomed.info/sct/900000000000207008?fhir_vs=ecl", "<<763158003:<<762951001=387517004")]//Alle med prod som har en relasjon til paracetamol
[TestCase("https://snowstorm-training.snomedtools.org/fhir", "http://snomed.info/sct?fhir_vs=ecl/<<373873005", "(Clinical Drug)")]
[TestCase("https://snowstorm-training.snomedtools.org/fhir", "http://snomed.info/sct?fhir_vs=ecl/", "(Clinical Drug)")]
[TestCase("https://snowstorm-training.snomedtools.org/fhir", "url=http://snomed.info/sct/900000000000207008?fhir_vs=ecl/", "(Clinical Drug)")]
[TestCase("https://snowstorm-training.snomedtools.org/fhir", "url=http://snomed.info/sct?fhir_vs=ecl/<<373873005", "(Clinical Drug)")]
[TestCase("https://snowstorm-training.snomedtools.org/fhir", "url=http://snomed.info/sct?fhir_vs=ecl/", "(Clinical Drug)")]
Lloyd McKenzie (Dec 08 2020 at 17:03):
@Ward Weistra
Peter Jordan (Dec 08 2020 at 20:43):
I'm not sure if this is an issue with the .NET SDK as I'm currently using that (latest version) and GET requests such as the one below receive valid responses from my Server...
https://terminz.azurewebsites.net/fhir/ValueSet/$expand?identifier=http://snomed.info/sct?fhir_vs=ecl/<<73211009
Although implementing ECL on any FHIR Terminology Server involves a certain amount of custom coding.
Bjørn Erik Nordal (Dec 09 2020 at 10:10):
Thank you for the response. I am on Firely .NET sdk (lib) latest version. The lib sends POSTs to a Snowstorm server (trying to read SNOMED CT data) that speaks FHIR. I have GET samples that work in the browser, but cant get the parameters right for the POSTs in the lib. I keep getting "Compose element(s) or 'url' parameter is expected to be present for an expansion, containing eg http://snomed.info/sct?fhir_vs=ecl/ or http://snomed.info/sct/45991000052106?fhir_vs=ecl/)" whatever i do. I have tried using all three overloads of Expand method in the lib, but getting none to work. @Ward Weistra do you know if there are known issues with the lib regarding code systems or Snowstorm?
Grahame Grieve (Dec 09 2020 at 10:59):
you should probably ask this on #snomed ?
Bjørn Erik Nordal (Dec 09 2020 at 11:16):
I am not really sure, as I suspect that the problem is related to the client or at least how I am using it. Is there a separate forum for the Firely .NET lib? Anyhow, thanks for the pointer. I will post my request there.
Ward Weistra (Dec 09 2020 at 11:18):
Hi @Bjørn Erik Nordal, you're always welcome to ask this on #dotnet too, but I've asked @Mirjam Baltus and @Matthijs van der Wielen to have a look at this to see if it's on the SDK side of things.
Michele Mottini (Dec 09 2020 at 14:46):
Try the request with a tool like Postman maybe? In that way you can be sure if the problem is server-side or in the client
Marco Visser (Dec 11 2020 at 11:48):
Hi @Bjørn Erik Nordal. The error message is coming from the server. The server asks also to provide an url. In the standard Expand
operation in our SDK , we do not provide the url
, which we might do in future releases.
But you can also provide the url
parameter as well. I made a unit test to show you how:
[TestMethod]
[TestCategory("IntegrationTest")]
public async System.Threading.Tasks.Task InvokeExpandWithIdentifierAndUrl()
{
var par = new Parameters()
.Add("identifier", new FhirUri("http://snomed.info/sct?fhir_vs=ecl/<<763158003:<<762951001=387517004"))
.Add("url", new FhirUri("http://snomed.info/sct?fhir_vs=ecl/<<763158003:<<762951001=387517004"));
using var client = new FhirClient("https://snowstorm-training.snomedtools.org/fhir");
var vs = (await client.TypeOperationAsync<ValueSet>(RestOperation.EXPAND_VALUESET, par)).OperationResult<ValueSet>();
Assert.IsTrue(vs.Expansion.Contains.Any());
}
I hope this will bring you further.
Marco Visser, Firely, lead developer of Firely .NET SDK
Bjørn Erik Nordal (Dec 11 2020 at 12:10):
Hi again and thank you for all your help. Actually I have managed to retrieve data now placing the Valueset id parameters in the base uri for the client (i.e. not as a Expand function parameter; yes it seems the url is not propagated that way). I need to qualify this solution further. I will also try the strategy provided here. Again; thank you
Last updated: Apr 12 2022 at 19:14 UTC