Stream: dotnet
Topic: SearchUsingPostAsync() not working
Henrik Jacobsen Nytun (Jan 28 2021 at 10:57):
Hey everyone. I am very new to FHIR, and I sincerely hope this is the correct place to post this;
I am currently trying to query a FHIR server using the FhirClient. Im having issues getting the SearchUsingPostAsync() method to work. Regardless of what parameter i include in the body, it doesnt affect the search result:
Does anyone know the 100% correct way to add content in the body for this method? I've looked and googled everywhere but I can't seem to find the correct solution
Thanks in advance to whoever takes his or hers time to answer this, as it would be a lifesaver!
Mirjam Baltus (Jan 28 2021 at 11:14):
Could you also share your search code? Does the server respond with a Bundle, or does the request result in an error?
Mirjam Baltus (Jan 28 2021 at 11:25):
I have tried this successfully:
var q = new SearchParams("_elements", "identifier,name,extension,gender,addresss,birthDate");
var c = new FhirClient("https://vonk.fire.ly/R4");
var result = await c.SearchUsingPostAsync<Patient>(q);
Henrik Jacobsen Nytun (Jan 28 2021 at 11:26):
Henrik Jacobsen Nytun (Jan 28 2021 at 11:36):
(deleted)
Henrik Jacobsen Nytun (Jan 28 2021 at 11:37):
We're also getting a bundle out, and we're searching for a person with an Identifier provided, hoping to get 1 person out, however, we are getting 10 non relevant persons out, meaning the body content hasnt been correctly read
Mirjam Baltus (Jan 28 2021 at 13:02):
I have tried this both on Vonk and Hapi, and those servers do respond correctly. It would seem that the server you use does not support the search with POST. Maybe you could try the request with Postman, to verify that the issue isn't in the SDK?
Henrik Jacobsen Nytun (Jan 28 2021 at 13:26):
When you made it work, are you using the exact same Fhir-client version? If that is not the case we might need to switch it to communicate properly with our server
Mirjam Baltus (Jan 28 2021 at 13:31):
Yes, I am using the 2.0.3 version of the SDK. The only difference is that I do not have any handlers set for the client. I am also in contact with @Pål Alm Andersen, to see if we can figure this out.
Last updated: Apr 12 2022 at 19:14 UTC