Last active
October 7, 2015 18:06
-
-
Save horsey/86baad23c64106648ff4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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