FHIR Chat · meta format · cds hooks

Stream: cds hooks

Topic: meta format


view this post on Zulip David Hay (Mar 18 2016 at 21:49):

What's the format that you return when trying to register a service through the 'quick add' button on http://hooks.fhir.me/?
I paste in a url (http://107.170.196.80:3000/cdshook/helloworld/$cds-hook )
the client calls "/cdshook/helloworld/$cds-hook-metadata"
I return

{
    "resourceType": "Parameters",
    "parameter": [
        {
            "name": "name",
            "valueString": "helloworld"
        },
        {
            "name": "description",
            "valueString": "A classic hello world service that will just display a string"
        },
        {
            "name": "activity",
            "valueCoding": {
                "system": "http://cds-hooks.smarthealthit.org/activity",
                "code": "patient-view"
            }
        }
    ]
}

and it seems to be accepted (no error generated) - but the service is not subsequently called...

view this post on Zulip David Hay (Mar 18 2016 at 21:51):

(sorry - haven't got the formatting right yet)

view this post on Zulip Josh Mandel (Mar 18 2016 at 21:52):

Your metadata look good -- but when I try your service I see:

XMLHttpRequest cannot load http://107.170.196.80:3000/cdshook/helloworld/$cds-hook-metadata.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://hooks.fhir.me' is therefore not allowed access.

view this post on Zulip David Hay (Mar 18 2016 at 21:54):

wierd - I see the call being made in the log...

view this post on Zulip David Hay (Mar 18 2016 at 21:54):

but I can add the header easily enough...

view this post on Zulip Josh Mandel (Mar 18 2016 at 21:54):

Oh, the web app makes the call, but doesn't return results to the JS

view this post on Zulip Josh Mandel (Mar 18 2016 at 21:54):

That's how it knows there's no header :-)

view this post on Zulip Brian Postlethwaite (Mar 18 2016 at 21:55):

Not the old https page js calling a http location?

view this post on Zulip David Hay (Mar 18 2016 at 21:55):

sorry not following - I'm returning the above json when the meta is called...

view this post on Zulip David Hay (Mar 18 2016 at 21:55):

oh - https!

view this post on Zulip Josh Mandel (Mar 18 2016 at 22:00):

Wait, everything here (the EHR and David's server) are http.

view this post on Zulip David Hay (Mar 18 2016 at 22:01):

is that OK in the sandbox?

view this post on Zulip Brian Postlethwaite (Mar 18 2016 at 22:01):

Just checking. Have been caught by that one sooooo many time

view this post on Zulip Brian Postlethwaite (Mar 18 2016 at 22:01):

with the js page being on https

view this post on Zulip Brian Postlethwaite (Mar 18 2016 at 22:02):

David, your service has the CORS headers setup right?

view this post on Zulip Josh Mandel (Mar 18 2016 at 22:02):

Yes, http is A-OK

view this post on Zulip Josh Mandel (Mar 18 2016 at 22:02):

CORS is the issue.


Last updated: Apr 12 2022 at 19:14 UTC