Node.js integrates with M: Next big thing in healthcare IT

No readers like this yet.
MUMPS, M and R programming languages

Opensource.com

Join the M revolution and the next big thing in healthcare IT: the integration of the node.js programming language with the NoSQL hierarchical database, M.

M was developed to organize and access with high efficiency the type of data that is typically managed in healthcare, thus making it uniquely well-suited for the job.

One of the biggest reasons for the success of M is that it integrates the database into the language in a natural and seamless way. The growth and involvement of th community of M developers however, has been below the radar for educators and the larger IT community. As a consequece it has been facing challenges for recruiting young new developers, despite the critical importance of this technology for supporting the Health IT infrastructure of the US.

At the recent 26th VistA Community Meeting, an exciting alternative was presented by Rob Tweed. I summarize it as: Node.js meets the M Database.

In his work, Rob has created an intimate integration between the M database and the language features of node.js. The result is a new way of accessing the M database from Javascript code in such a way that the developer doesn't feel that is accessing a database.

It is now possible to access M from node.js, both when using theM implementation of Intersystems Cache and with the open source M implementation of GT.M. This second interface was implemented by David Wicksell, based on the API previously defined for Cache in the GlobalsDB project.

In a recent blog post, Rob describes some of the natural notation in node.js that provides access to the M hierarchical database by nicely following the language patterns of Javascript. Here are some of Rob's examples:

The M expression:

set town = ^patient(123456, "address", "town")

becomes the Javascript expression:

 var town = patient.$('address').$('town')._value;

with some flavor of jQuery.

The following M expression of a healthcare typical example:

^patient(123456,"birthdate")=-851884200
^patient(123456,"conditions",0,"causeOfDeath")=""
^patient(123456,"conditions",0,"codes","ICD-10-CM",0)="I21.01"
^patient(123456,"conditions",0,"codes","ICD-9-CM",0)="410.00"
^patient(123456,"conditions",0,"description")="Diagnosis, Active: Hospital Measures - AMI (Code List: 2.16.840.1.113883.3.666.5.3011)"
^patient(123456,"conditions",0,"end_time")=1273104000

becomes the following JSON datastructure that can be manipulated with Javascript:

var patient = new ewd.GlobalNode("patient", [123456]);
patient._delete();

var document = {
  "birthdate": -851884200,
  "conditions": [
    {
      "causeOfDeath": null,
      "codes": {
        "ICD-9-CM": [
          "410.00"
        ],
        "ICD-10-CM": [
          "I21.01"
        ]
      },
      "description": "Diagnosis, Active: Hospital Measures - AMI (Code List: 2.16.840.1.113883.3.666.5.3011)",
      "end_time": 1273104000
    }
  ]
};

More detailed examples are provided in Rob's blog post. The M module for node.js is available here.

What this achieves is seamless integration between the powerful M hierarchical database and the language features of the very popular node.js implementation of Javascript. This integration becomes a great opportunity for hundreds of node.js developers to join the space of healthcare IT, and to do, as Tim O'Reilly advises: Work on Stuff that Matters!

M is currently being used in hundreds of hospitals in the public sector:

  • The Department of Veterans Affairs
  • The Department of Defense
  • The Indian Health Service

As well as hundreds of hospitals in the private sector:

  • Kaiser Permanente hospital system
  • Johns Hopkins
  • Beth Israel Deaconess Medical Center
  • Harvard Medical School

In particular at deploments of these EHR systems:

  • Epic
  • GE/Centricity
  • McKesson
  • Meditech

Given this, and the large popularity of Javascript and the high efficiency of node.js, this may be the most significant event happening in healthcare IT in recent years.

If you are an enthusiast of node.js, or you are looking for the best next language to learn, or you want to do some social good, this could be the thing for you.

User profile image.
Luis Ibáñez works as Senior Software Engineer at Google Inc in Chicago.

1 Comment

Now <em>this</em> is how you get more interest in a good non-SQL database.

Node.JS is already the most popular way of writing highly-scalable web applications which need things like WebSockets and there are already a lot of developers comfortable with using it to talk to non-relational databases.

Assuming the code can demonstrate sufficient maturity and robustness, I think this could be a big win for getting more talent into the healthcare IT sector... heck, if that works out, it might also result in more people using M with Node.JS outside healthcare.

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.