Hi,
I am struggling with fetching medication order of Wilma Smart (Aspirin, Glucovance, etc) using SMART on FHIR js library.
Here is the code I tried. :
function onReady(smart) {
if (smart.hasOwnProperty('patient')) {
var patient = smart.patient;
var pt = patient.read();
var obv = smart.patient.api.fetchAll({
type: 'Observation',
query: {
code: {
}
}
});
var medOrder = smart.patient.api.fetchAll({
type: 'MedicationOrder',
query: {
patient: '4342008'
}
});
console.log(medOrder);
...
I checked the console output for medOrder by Chrome inspection tool and it gave me this:
![Screen Shot 2018-11-28 at 4.34.43 PM.png](https://groups.google.com/group/cerner-fhir-developers/attach/bc560222a058f/Screen%20Shot%202018-11-28%20at%204.34.43%20PM.png?part=0.1&view=1)
I also tried this but I got the same result
var medOrder = smart.patient.api.search({
type: 'MedicationOrder',
query: {
patient: '4342008'
}
});
How can I fetch MedicationOrder resource?
Thank you