Skip to content

Instantly share code, notes, and snippets.

@horsey
Last active October 7, 2015 18:06
Show Gist options
  • Select an option

  • Save horsey/86baad23c64106648ff4 to your computer and use it in GitHub Desktop.

Select an option

Save horsey/86baad23c64106648ff4 to your computer and use it in GitHub Desktop.
function(eventList, next) {
if (_.isEmpty(eventList))
return next(null, eventList);
var tmp = {};
var val = _
.chain(eventList)
.map(function(e) {
if(!e.patientId)
return e;
function patientInfo(pid, fn) {
patients.read(pid, function(err, res) {
if(err)
return fn(err);
return fn(res);
});
}
patientInfo(e.patientId, function(res) {
e.patientInfo = res;
return e;
});
}).value()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment