Skip to content

Instantly share code, notes, and snippets.

@carpeliam
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save carpeliam/08fad4f02e1d3fa2ef23 to your computer and use it in GitHub Desktop.
Save carpeliam/08fad4f02e1d3fa2ef23 to your computer and use it in GitHub Desktop.
This is how to get patient summary details from a node console, similar to the function call at https://github.com/robtweed/ewdGateway2/blob/master/ewdLite/node_modules/VistADemo.js#L81.
// after running `vagrant ssh` to log into VM:
// sudo su - osehra
// cd ewdjs
var ewdGlobals = require('ewdjs/lib/ewdGlobals');
var interface = require('nodem/lib/mumps');
var db = new interface.Gtm();
var util = require('util');
var ok = db.open();
ewdGlobals.init(db);
var ewd = {
mumps: ewdGlobals
};
var patientId = 17; // or whichever id you'd like
var patient = new ewd.mumps.GlobalNode("DPT", [patientId,'0']);
var patientRec0 = patient._value;
var patientObj = patientRec0.split('^');
/* patientObj:
[ 'SIXTEEN,PATIENT P',
'M',
'2660506',
'',
'',
'',
'',
'',
'222559876',
'',
'Wakefield',
'44',
'',
'',
'1',
'3140405',
'',
'',
'',
'1' ]
*/
db.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment