Skip to content

JSMumps.getObject()

John Willis edited this page Mar 21, 2017 · 2 revisions

Retrieves a MUMPS subtree and its children as an ECMAScript object.

    jsm.getObject(global, subscripts, callback);

Arguments

  • global

The MUMPS global name from which to retrieve data.

  • subscripts

An ECMAScript array indicating the subscript level from which to retrieve data from global. If you wish to retrieve the entire global, provide an empty array ([]) here.

  • callback

The callback to be called when the data is retrieved. Per Node.js conventions, this callback function takes two arguments, err and data.

Example

This example will output the contents of ^VA(200) (the VistA NEW PERSON file) onto the console.

    const jsmumps = require('jsmumps');
    var jsm = new jsmumps.JSMumps();

    jsm.getObject("VA", [200], (err, data) => {
        if(!err) {
            console.log(data);
        }
    });
Clone this wiki locally