Stream: dotnet
Topic: Invoking search on a List
Dimitar (Sep 27 2017 at 14:04):
Hello,
My question is the following, I have the following request http://vonk.furore.com/List?subject=Patient/example&item._type=FamilyMemberHistory , which searches for a patient's list, which contains only instances of the resource type, which in this case is FamilyMemberHistory. How would I go about writing the search params, which would be used in the search. Thank you in advance!
Michel Rutten (Sep 27 2017 at 14:11):
Hi @Dimitar, something like this should work:
FhirClient cl = new FhirClient(@"http://vonk.furore.com"); var srch = new SearchParams() .Where("subject=Patient/example"); var b = cl.Search<FamilyMemberHistory>(srch);
Dimitar (Sep 27 2017 at 14:18):
@Michel Rutten Thank you, I was making it more difficult, than it should, by searching for all the lists, which are contained in a patient and than extracting only lists which contain a medication statement in them, which is for my case.
Dimitar (Sep 27 2017 at 14:21):
How would this be done, in a scenario, where I need lets say the specific list of medical statement entries?
Michel Rutten (Sep 27 2017 at 14:22):
Hi @Dimitar, the small piece of example code just demonstrates the C# API syntax. I think you'd have to tweak the expression to actually get the desired results.
Dimitar (Sep 27 2017 at 14:23):
Given that there might be lists from several different practitioners
Dimitar (Sep 27 2017 at 14:23):
Nevermind, disregard the last parts, I am talking nonsense :)
Dimitar (Sep 27 2017 at 14:26):
I am just going to query the resource, based on which list it is a part of. Thank you!
Michel Rutten (Sep 27 2017 at 14:28):
Hi @Dimitar, this may work:
Michel Rutten (Sep 27 2017 at 14:28):
FhirClient cl = new FhirClient(@"http://vonk.furore.com"); var srch = new SearchParams() .Where("subject=Patient/example") .Where("entry.item.type=FamilyMemberHistory"); var b = cl.Search<List>(srch);
Dimitar (Sep 27 2017 at 14:30):
@Michel Rutten That is exactly what I need! Much appreciated!
Last updated: Apr 12 2022 at 19:14 UTC