Stream: implementers
Topic: sintax for lookup and expand using fhir-client.js
Marcelo Cabello (Oct 18 2019 at 20:41):
Where can I find the way to perform $lookup, $expand, $validate-code, and $subsumes using the fhir-client.js?
Something like that???
smart.api.search({ type: "CodeSystem", operation: "$lookup", <-------- ¿¿¿¿????? url: the_url code: the_code }) .then(function(response) { console.log(response); });
Lloyd McKenzie (Oct 19 2019 at 11:20):
@Abigail Watson ?
Marcelo Cabello (Oct 19 2019 at 12:45):
Where can I find the way to perform $lookup, $expand, $validate-code, and $subsumes using the fhir-client.js?
Something like that???
smart.api.search({ type: "CodeSystem", operation: "$lookup", <-------- ¿¿¿¿????? url: the_url code: the_code }) .then(function(response) { console.log(response); });
@Josh Mandel is there a way to do terminology operations using fhir-client.js ?
Abbie Watson (Oct 19 2019 at 15:47):
Josh has helped design the protocol and spec, and the spec says to put it all in the URL. So you probably just want to use .request()
and append it to the URL like so:
let the_url = "/Patient/smart-1642068/$everything"; client.request(the_url, { resolveReferences: "medicationReference" }).then(data => data.entry.map(item => getMedicationName( getPath(item, "resource.medicationCodeableConcept.coding") || getPath(item, "resource.medicationReference.code.coding") )));
Abbie Watson (Oct 19 2019 at 15:54):
Here are some advanced examples of using the client with parameterized URLs.
http://docs.smarthealthit.org/client-js/request.html
Marcelo Cabello (Oct 19 2019 at 19:44):
That's another way I didn't know it. So, I changed part of my code and now I can perform directly the URL inside instead using an object for the query. It works fine now!
Thanks @Abigail Watson !!
Last updated: Apr 12 2022 at 19:14 UTC