我有一个nodejs应用程序,该应用程序连接到FHIR服务器并查询患者数据。我不确定如何将Oauth2令牌传递给getPatient函数。 我正在为该应用程序使用fhir.js节点库。
var Fhir = require('fhir.js');
var user = require('user.js);
function getPatient(response){
return new Promise(function(resolve,reject) {
var patientid = 123456;
var Oauth2Token = user.token;
// Create fhir instance
var fhir = Fhir({
baseUrl: process.env.baseUrl,
});
// Execute the search
fhir.search({
type: 'Patient',
query: {id: patientid}
})
.then(function(response){
//manipulate your data here.
var data = response.data.entry[0].resource;
console.log("FHIR Data :",data);
resolve(data);
})
.catch(function(error){
//Error responses
if (error.status){
console.log('Error', error.status);
reject(error);
}
//Errors
if (error.message){
console.log('Error', error.message);
reject(error);
}
});
});
}
答案 0 :(得分:0)
您可以尝试将PatientId放在引号中吗?
var patientid = "123456";
答案 1 :(得分:0)
您可以查看Readme:
DROP TABLE IF EXISTS table1;
CREATE TABLE table1
(resource VARCHAR(12) NOT NULL
,slc_rank INT NOT NULL
,val INT NOT NULL
,PRIMARY KEY(resource,slc_rank)
);
INSERT INTO table1 VALUES
('Critical',1,3),
('Critical',2,3),
('Critical',3,6),
('Critical',4,12),
('High',1, 8),
('High',2, 8),
('High',3,12),
('High',4,24);
DROP TABLE IF EXISTS table2;
CREATE TABLE table2
(name VARCHAR(20) NOT NULL
,resource VARCHAR(12) NOT NULL
,slc_rank INT NOT NULL
,PRIMARY KEY(name,resource,slc_rank)
);
INSERT INTO table2 VALUES
('RAM','Critical',1),
('KIRAN','Critical',2),
('BASS','High',3),
('LOUT','Critical',4),
('chinna','High',1),
('lavanya','Critical',3),
('babau','High',4),
('rani','Critical',2);
SELECT x.*
, y.val
FROM table2 x
JOIN table1 y
ON y.resource = x.resource
AND y.slc_rank = x.slc_rank;
+---------+----------+----------+-----+
| name | resource | slc_rank | val |
+---------+----------+----------+-----+
| babau | High | 4 | 24 |
| BASS | High | 3 | 12 |
| chinna | High | 1 | 8 |
| KIRAN | Critical | 2 | 3 |
| lavanya | Critical | 3 | 6 |
| LOUT | Critical | 4 | 12 |
| RAM | Critical | 1 | 3 |
| rani | Critical | 2 | 3 |
+---------+----------+----------+-----+