FHIR Chat · Connectathon LastN Query Track · implementers

Stream: implementers

Topic: Connectathon LastN Query Track


view this post on Zulip Eric Haas (Sep 09 2017 at 18:30):

This is the chat stream for the Connectathon LastN Query

view this post on Zulip Eric Haas (Sep 09 2017 at 18:31):

@Grahame Grieve tried this ...

http://test.fhir.org/r3/Observation/$lastn?max=3&patient=Patient/123&category=vital-signs

No response???

view this post on Zulip Grahame Grieve (Sep 09 2017 at 18:45):

I'll investigate

view this post on Zulip Grahame Grieve (Sep 09 2017 at 19:11):

the case is wrong to start with - lastN

view this post on Zulip Jenni Syed (Sep 09 2017 at 19:12):

My server will allow lastn with patient (hard codes max to 5 right now), but requires oauth

view this post on Zulip Jenni Syed (Sep 09 2017 at 19:12):

Still working on removing that requirement :)

view this post on Zulip Brian Wright (Sep 09 2017 at 19:16):

Initial DotNet implementation, restricted to only using loinc codes (all codes may be a challenge due to our server implementation which integrates multiple EMRs and carries the system codings as well).

    private IEnumerable<Observation> LastNLoincFilter(IEnumerable<Observation> obs, int max)
    {
        return obs.GroupBy(o => string.Join('|', (from c in o.Code.Coding where c.System.Equals("http://loinc.org") orderby c.Code select c.Code)))
         .SelectMany(g => g.OrderByDescending(s => s.Effective.ToString()).
                         Take(max));
    }

view this post on Zulip Jenni Syed (Sep 09 2017 at 19:22):

My server example: https://fhir-open.stagingcerner.com/stu3/a758f80e-aa74-4118-80aa-98cc75846c76/Observation/$lastn?patient=1316024 (or https://fhir-ehr.stagingcerner.com/stu3/a758f80e-aa74-4118-80aa-98cc75846c76/Observation/$lastn?patient=1316024)

view this post on Zulip Jenni Syed (Sep 09 2017 at 19:23):

sadly, both require auth. Register an app here for Cerner: https://code.cerner.com/developer/smart-on-fhir/

view this post on Zulip Jenni Syed (Sep 09 2017 at 19:24):

And then let me know your client id and I can get it access to the staging servers above

view this post on Zulip Eric Haas (Sep 09 2017 at 19:34):

@Grahame Grieve the specification states $lastn still I'm getting an error like this when I use $lastN.
Screen-Shot-2017-09-09-at-12.31.43-PM.png

view this post on Zulip Grahame Grieve (Sep 09 2017 at 19:57):

that's not an error

view this post on Zulip Grahame Grieve (Sep 09 2017 at 19:58):

that's just an empty outcome.

view this post on Zulip Grahame Grieve (Sep 09 2017 at 19:58):

agree that the spec says lastn - I will update it after 5pm tonight

view this post on Zulip Richard Ettema (Sep 09 2017 at 20:47):

FYI - I have some TestScripts for $lastn deployed to Touchstone. I'd be interested in having them run against any server supporting that operation; i.e. I'd like to "test the test".

view this post on Zulip Richard Ettema (Sep 09 2017 at 20:50):

FHIRConnectathon16Tests.png

view this post on Zulip Kevan Riley (Sep 09 2017 at 22:54):

@Jenni Syed I am getting the following trying to hit the lastN? endpoint you posted above:

view this post on Zulip Kevan Riley (Sep 09 2017 at 22:54):

<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />

view this post on Zulip Kevan Riley (Sep 09 2017 at 22:56):

@Jenni Syed Update/correction, I am getting an unauthorized error (401), ignore the previous.

view this post on Zulip Jenni Syed (Sep 09 2017 at 22:57):

yeah :) you have to authenticate right now

view this post on Zulip Jenni Syed (Sep 09 2017 at 23:02):

For the next 15 minutes, this bearer token will work: Bearer eyJraWQiOiIyMDE3LTA5LTA5VDE5OjMzOjE3LjMzNi5lYyIsInR5cCI6IkpXVCIsImFsZyI6IkVTMjU2In0.eyJzdWIiOiJqdzY0OTkiLCJ1cm46Y29tOmNlcm5lcjphdXRob3JpemF0aW9uOmNsYWltcyI6eyJ2ZXIiOiIxLjAiLCJ0bnQiOiJhNzU4ZjgwZS1hYTc0LTQxMTgtODBhYS05OGNjNzU4NDZjNzYiLCJhenMiOiJ1c2VyXC9PYnNlcnZhdGlvbi5yZWFkIn0sImF6cCI6ImZoaXItbG9jYWwiLCJpc3MiOiJodHRwczpcL1wvYXV0aG9yaXphdGlvbi5zYW5kYm94Y2VybmVyLmNvbVwvIiwiZXhwIjoxNTA0OTk4NzM4LCJpYXQiOjE1MDQ5OTgxMzgsImp0aSI6ImVkNjgxMDNmLTM5YmMtNDg2Yy1iNWFiLTU1YmY2NmNiMjI5MyIsInVybjpjZXJuZXI6YXV0aG9yaXphdGlvbjpjbGFpbXM6dmVyc2lvbjoxIjp7InZlciI6IjEuMCIsInByb2ZpbGVzIjp7InNtYXJ0LXYxIjp7ImF6cyI6InVzZXJcL09ic2VydmF0aW9uLnJlYWQifX0sImNsaWVudCI6eyJuYW1lIjoiRkhJUiBMb2NhbCBUZXN0IENsaWVudCIsImlkIjoiZmhpci1sb2NhbCJ9LCJ1c2VyIjp7InByaW5jaXBhbCI6Imp3NjQ5OSIsInBlcnNvbmEiOiJwcm92aWRlciIsImlkc3AiOiJhNzU4ZjgwZS1hYTc0LTQxMTgtODBhYS05OGNjNzU4NDZjNzYiLCJwcmluY2lwYWxVcmkiOiJodHRwczpcL1wvbWlsbGVubmlhLnNhbmRib3hjZXJuZXIuY29tXC9pbnN0YW5jZVwvYTc1OGY4MGUtYWE3NC00MTE4LTgwYWEtOThjYzc1ODQ2Yzc2XC9wcmluY2lwYWxcLzAwMDAuMDAwMC4wMDE0LjE0QTciLCJpZHNwVXJpIjoiaHR0cHM6XC9cL21pbGxlbm5pYS5zYW5kYm94Y2VybmVyLmNvbVwvYWNjb3VudHNcL3N0Z2VuZy50ZW1wX3Joby5jZXJuZXJhc3AuY29tXC9hNzU4ZjgwZS1hYTc0LTQxMTgtODBhYS05OGNjNzU4NDZjNzZcL2xvZ2luIn0sInRlbmFudCI6ImE3NThmODBlLWFhNzQtNDExOC04MGFhLTk4Y2M3NTg0NmM3NiJ9fQ.LjmqfqW-OWqndPTKdLXaXAN2r_b1zJVplV-fSPEH2Zje4B8ZwdXjQv7hsgYxpO0sNoiRt2pCVa5JQSf9wHcxAQ

view this post on Zulip Jenni Syed (Sep 09 2017 at 23:13):

For our server, to get tokens, you can use our demo app: https://authz-demo.sandboxcerner.com/client/demo

view this post on Zulip Jenni Syed (Sep 09 2017 at 23:14):

Use client id c4093c13-1ed1-47ef-95a6-a225d3e47023 if you don't have an app with a real redirect, leave redirect url empty

view this post on Zulip Jenni Syed (Sep 09 2017 at 23:14):

the discovery step won't work, but the get access code and get access token should

view this post on Zulip Jenni Syed (Sep 09 2017 at 23:15):

I can walk you through it if you have issues :) just let me know

view this post on Zulip Jenni Syed (Sep 09 2017 at 23:16):

actually, discovery will work as long as you use this fhir server: https://fhir-ehr.stagingcerner.com/stu3/a758f80e-aa74-4118-80aa-98cc75846c76/

view this post on Zulip Brian Wright (Sep 10 2017 at 17:20):

Spec test cases for local testing this morning:
http://172.20.26.136:63532/fhir/Observation$lastn?max=3&patient=Patient/19300100&category=vital-signs
http://172.20.26.136:63532/fhir/Observation$lastn?patient=Patient/19300107&category=laboratory
http://172.20.26.136:63532/fhir/Observation$lastn?max=3&patient=Patient/19300100&category=vital-signs&code=8302-2,29463-7

Extra credit - Diagnostic report
http://localhost:63532/fhir/DiagnosticReport$lastn?Patient=Patient/19300111&max=1

view this post on Zulip Brian Wright (Sep 10 2017 at 18:52):

Some takeaways from connectathon:

Was not able to test on local network. Will plan on hosting on cloud in future for access from test tools and other users.

Used synthetic data from Mitre Synthea for test cases.

Adding lastn as filter in fhir layer was effective, but in my mind anyway, disallows use of paging. However, during discussions the use of lastn was planned to be limited to queries including patient/subject, so paging not usually necessary, but implies possibly processing large amounts of data on server.

My implementation was limited to specifying a single code system. For out environment, where we are integrating data from multiple systems, and carry source code systems as well as standard codes, this works will, but need to think about other multi-code systems use cases and whether this is generally appropriate.

view this post on Zulip Nick Hatt (Sep 10 2017 at 19:04):

re: testing on local network: We used ngrok (https://ngrok.com/ ) to avoid having to deploy anything. It gives you internet-facing url and tunnels it to localhost.

view this post on Zulip Simone Heckmann (Sep 12 2017 at 00:39):

(deleted)


Last updated: Apr 12 2022 at 19:14 UTC