cerner / smart-on-fhir-tutorial Goto Github PK
View Code? Open in Web Editor NEWSMART on FHIR developer tutorial
Home Page: https://engineering.cerner.com/smart-on-fhir-tutorial/
SMART on FHIR developer tutorial
Home Page: https://engineering.cerner.com/smart-on-fhir-tutorial/
The sample application can run into a JavaScript error when the response from the server does not have the appropriate Observation data. The application should ensure that data is valid before accessing the data.
The component
object can be nil. Currently the find
function is accessing this component
object without checking.
The tutorial page [1] has a link under the launch-smart-sandbox.html description that points to a URL [2] that errors when loaded. When loading the main SMART Health IT site, the given sandbox links redirect to a different URL [3].
[1] https://github.com/cerner/smart-on-fhir-tutorial/blob/0d011e9d5542ccd595f5f1d71d550a1e3fc8638c/source/index.html.md
[2] https://sandbox.smarthealthit.org/
[3] http://docs.smarthealthit.org/
The example SMART app doesn't work in IE 10 or 11 currently. One of the known problems preventing the app working in IE 10 & 11 is the use of Array.prototype.find().
Followed instructions here : http://engineering.cerner.com/smart-on-fhir-tutorial/#github-pages
But page still not loading when it switch branch to git page. Is there an open issue on this or am I doing something wrong?
Consider converting to a github template to avoid the problem of users accidentally trying to push a pr back to this repo
https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/
Getting the below error when lunch App from SMART code console. The App has been registered.
An application was attempting to request access to healthcare data with Abilities Center; unfortunately, the application isn't currently registered. If you require further assistance, please contact support.
Information to provide to Technical Support
Correlation ID:cbcc7b39-99a9-4a9f-98cb-cf1eec04bdcb
Information to provide to Unknown Application
The supplied "client_id" value does not correspond to any registered applications on record.
Error Code:urn:cerner:error:authorization-server:oauth2:grant:unknown-client
Do you know any FHIR commercial server available with exposed apis? On prem/cloud?
In the launch.html file we currently have a bogus client id. It might be clearer to users of the tutorial that the client id must be replaced in order to launch their app if the value for the client id was something like
<client id>
In the tutorial site, we do use a throwaway value for the client id in the code example https://engineering.cerner.com/smart-on-fhir-tutorial/#request-authorization
Hi,
I forked the smarton-fhir tutorial onto my computer and I managed to follow the steps from this url, including the outline for the project setup and registration without utilizing the bundle executable to deploy to github pages (just used git changes from the CL). I go to console code and click on the app I created and hit launch to transport me to the millenium sandbox login and enter the username and password provided. When I' redirected I get a p tag with the information:
Failed to call FHIR Service
Is my patient call using your example suppose to take me to an error point?
-Akeem Spencer
Is there an option to invoke the R4 FHIR API using this sample code ?
If that is not possible, can you please share a code sample for R4 version.
I am following tutorial https://engineering.cerner.com/smart-on-fhir-tutorial/#introduction and trying to test my sample app which is forked as mentioned in the documentation. Followed all instructions mentioned in documentation.
While testing the app, i am getting 'Failed to call FHIR service' error
My git repository is https://github.com/dhaneshov/smart-on-fhir-tutorial
x-request-id returned by the response
Request URL : https://fhir-ehr-code.cerner.com/dstu2/ec2458f2-1e24-41c8-b71b-0e701af7583d/Patient/12724065
X-Request-Id: 7137e0e7-a557-4a5b-a559-437e9da76d30
Request URL: https://fhir-ehr-code.cerner.com/dstu2/ec2458f2-1e24-41c8-b71b-0e701af7583d/Observation?code=http%3A%2F%2Floinc.org%7C8302-2%2Chttp%3A%2F%2Floinc.org%7C8462-4%2Chttp%3A%2F%2Floinc.org%7C8480-6%2Chttp%3A%2F%2Floinc.org%7C2085-9%2Chttp%3A%2F%2Floinc.org%7C2089-1%2Chttp%3A%2F%2Floinc.org%7C55284-4&patient=12724065
X-Request-Id: 5f1359ec-ef71-4dea-9d75-ecef3eb7ba18
I am trying to test my app and need a test provider/patient credential. The guide for this repo stated the following
Next log back into the code console and click on the app you’ve registered (My amazing SMART app). To launch your app through the code console click the “Begin Testing” button. The console will ask if the app you’re launching requires a patient in context. Our app requires a patient, so select yes and choose a patient. Please note the millennium username and password, you’ll need this credential when prompted. Finally, click launch and the console will redirect to your application.
However, I was unable to see a "Being Testing" button in my code console. Is this instruction still valid? If not, how should I go about getting a sandbox provider/patient credential for testing openid/Oauth2 for instance?
Thanks!
When the example app gets the JSON about the patient, it has a bug in translating the JSON of the birthdate (say, "2012-02-19") into a local date ("2/19/2012").
It's off by one day. The JSON may say "2012-02-19," but the date displayed says "2/18/2012". This is because the example app just feeds the JSON into a JavaScript Date object (https://github.com/cerner/smart-on-fhir-tutorial/blob/gh-pages/example-smart-app/src/js/example-smart-app.js#L30)
Note I am not talking about being off by one month. You've already adjusted the month for January being 0 not 1. I am talking about being off by one day.
The problem is that when you initialize the Date object with a date string, it interprets it as UTC time zone, not local time zone. But then when you run .getDate(), it gives you local time zone. So "2012-02-19" is interpreted as a UTC date of midnight on 2/19, which when localized to the US will come across as some time the day before.
"parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged" --- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
Currently:
var dob = new Date(patient.birthDate);
Suggested (use the multi-argument version of Date, something like this)
var dob = patient.birthDate.split('-');
dob[1]--; // in JavaScript, January is 0
dob = new Date(dob[0], dob[1], dob[2]);
Hi, everyone!
I have some troubles in process of authorization of my SMART App.
In the tutorial, they wrote about Authrization:
"The responsibility of launch.html is to redirect to the appropriate FHIR authorization server. As you can see in the code, fhir-client makes our job pretty easy. All we have to do is call FHIR.oauth2.authorize and supply the client_id generated by the code console during registration and the scopes we registered."
But when I deploy and go to 'https://.github.io/smart-on-fhir-tutorial/example-smart-app/', the browser says 'Failed to call FHIR Service'.
Also when I go to 'https://.github.io/smart-on-fhir-tutorial/example-smart-app/launch.html' where function FHIR.oauth2.authorize is in, there is an error that is caused by no authorization server is identified.
Of course, I registered my app and now have a Client_ID, and use it in function FHIR.oauth2.authorize, as tutorial says.
I think when go to url 'https://.github.io/smart-on-fhir-tutorial/example-smart-app/launch.html', I should give it params 'iss' and 'launch'.
But for this, I need to know url of Authorization server.
It is what I cannot solve, and as it is the beginning of SMART app development, I could make no step in advance.
As I am not familiar with SMART app(though very experienced in api development using JS), really hope to see your kind reply.
Thank you.
Hello, I am added this project in the localhost with this url "http://localhost/launch.html". I am getting this issue "Cannot read property 'substr' of undefined at stripTrailingSlash".please tell me what i am doing wrong
Hi, everyone!
I have some troubles in process of authorization of my SMART App.
In the tutorial, they wrote about Authrization:
"The responsibility of launch.html is to redirect to the appropriate FHIR authorization server. As you can see in the code, fhir-client makes our job pretty easy. All we have to do is call FHIR.oauth2.authorize and supply the client_id generated by the code console during registration and the scopes we registered."
But when I deploy and go to 'https://.github.io/smart-on-fhir-tutorial/example-smart-app/', the browser says 'Failed to call FHIR Service'.
Also when I go to 'https://.github.io/smart-on-fhir-tutorial/example-smart-app/launch.html' where function FHIR.oauth2.authorize is in, there is an error that is caused by no authorization server is identified.
Of course, I registered my app and now have a Client_ID, and use it in function FHIR.oauth2.authorize, as tutorial says.
I think when go to url 'https://.github.io/smart-on-fhir-tutorial/example-smart-app/launch.html', I should give it params 'iss' and 'launch'.
But for this, I need to know url of Authorization server.
It is what I cannot solve, and as it is the beginning of SMART app development, I could make no step in advance.
As I am not familiar with SMART app(though very experienced in api development using JS), really hope to see your kind reply.
Thank you.
Looks like SMART Health IT Sandbox has been changed. And the tutorial needs to be updated. I am not able to run the application against SMART Health IT Sandbox.
Does smart app API provide HL7 values?
I recently finished the tutorial and found a few small issues with the tutorial. Would it be possible to get these issues updated?
The issues I noticed:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.