SMART on FHIR JS API获取Patient资源异常及文档代码报错问题
问题:使用SMART on FHIR JavaScript Library获取完整Patient资源的正确方式
我正基于Cerner的SMART on FHIR教程开发应用,示例代码通过以下方式获取患者与观测数据:
var patient = smart.patient; var pt = patient.read(); var obv = smart.patient.api.fetchAll({ type: 'Observation', query: { code: { $or: ['http://loinc.org|8302-2', 'http://loinc.org|8462-4', 'http://loinc.org|8480-6', 'http://loinc.org|2085-9', 'http://loinc.org|2089-1', 'http://loinc.org|55284-4'] } } });
修改后的代码在SMART App Launcher运行正常,但移除smart.patient.api.fetchAll获取Observation的调用后,Patient的JSON字符串为空。
尝试按照官方文档使用以下代码时出现报错:
<!-- index.html --> <script src="./node_module/fhirclient/build/fhir-client.js"></script> <script> FHIR.oauth2.ready() .then(client => client.request("Patient")) .then(console.log) .catch(console.error); </script>
报错截图:
使用的库直接来自Cerner教程:
咨询:使用SMART on FHIR JavaScript Library获取完整Patient资源的正确方式是什么?
内容的提问来源于stack exchange,提问作者John
相关产品推荐
相关产品推荐

