Last active
August 29, 2015 13:58
-
-
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.
This file contains 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
// 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