smart-on-fhir-tutorial icon indicating copy to clipboard operation
smart-on-fhir-tutorial copied to clipboard

Update example-smart-app.js to support R4

Open sp020499 opened this issue 1 year ago • 0 comments

Correction on the JS to behave with R4. It is not completely compatible with R4.  The current app is trying to treat the family name as an array as per DSTU2.  In FHIR R4 the change in the data structure family name is a singular value instead of an array. This is causing an exception below: Uncaught TypeError: patient.name[0].family.join is not a function at Array. (example-smart-app.js:36:44) at i (jquery.min.js:2:27449) at Object.fireWith [as resolveWith] (jquery.min.js:2:28213) at Object. (jquery.min.js:2:29526) at fire (fhir-client-v0.1.12.js:10114:30) at Object.fireWith [as resolveWith] (fhir-client-v0.1.12.js:10226:7) at deferred. [as resolve] (fhir-client-v0.1.12.js:10316:34) at fhir-client-v0.1.12.js:1208:22 at Object. (fhir-client-v0.1.12.js:1187:18) at Object. (fhir-client-v0.1.12.js:10271:33)

This correction will enable the launch with both DSTU2 and R4.

sp020499 avatar Mar 29 '23 19:03 sp020499