Skip to content

Instantly share code, notes, and snippets.

@rajvansia
Created June 19, 2016 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajvansia/246440d6d5a18435af77a97f15e6bd23 to your computer and use it in GitHub Desktop.
Save rajvansia/246440d6d5a18435af77a97f15e6bd23 to your computer and use it in GitHub Desktop.
pt.api.search({type: "Observation", query: {code: {$or: ["55284-4" ]}}}) // it worked you need to identifey what code you waan
.then(function(bps) {
var data=[];
bps.data.entry.forEach(function(bp){ // how can we access diffrent datat from the model for a set of blood pressures do it for one blood pressure
var blood= bp.resource.component;
console.log(bp.resource.effectiveDateTime
)
console.log(blood)
blood.forEach(function(b){
data.push({"bloodp": b.valueQuantity.value, "date": bp.resource.effectiveDateTime, "type": b.code.text, "code": b.code.coding[0].code})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment