Stream: cds hooks
Topic: meta format
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...
David Hay (Mar 18 2016 at 21:51):
(sorry - haven't got the formatting right yet)
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.
David Hay (Mar 18 2016 at 21:54):
wierd - I see the call being made in the log...
David Hay (Mar 18 2016 at 21:54):
but I can add the header easily enough...
Josh Mandel (Mar 18 2016 at 21:54):
Oh, the web app makes the call, but doesn't return results to the JS
Josh Mandel (Mar 18 2016 at 21:54):
That's how it knows there's no header :-)
Brian Postlethwaite (Mar 18 2016 at 21:55):
Not the old https page js calling a http location?
David Hay (Mar 18 2016 at 21:55):
sorry not following - I'm returning the above json when the meta is called...
David Hay (Mar 18 2016 at 21:55):
oh - https!
Josh Mandel (Mar 18 2016 at 22:00):
Wait, everything here (the EHR and David's server) are http
.
David Hay (Mar 18 2016 at 22:01):
is that OK in the sandbox?
Brian Postlethwaite (Mar 18 2016 at 22:01):
Just checking. Have been caught by that one sooooo many time
Brian Postlethwaite (Mar 18 2016 at 22:01):
with the js page being on https
Brian Postlethwaite (Mar 18 2016 at 22:02):
David, your service has the CORS headers setup right?
Josh Mandel (Mar 18 2016 at 22:02):
Yes, http
is A-OK
Josh Mandel (Mar 18 2016 at 22:02):
CORS is the issue.
Last updated: Apr 12 2022 at 19:14 UTC