Lecture 5


VistA, Healthcare Programming, MUMPS, FileMan

Previous lecture looked at some high level description of VistA electronic medical record system and briefly presented its architecture. Then it described some basic commands in MUMPS, a database system and programming language in which VistA is created.




This week describes more details on MUMPS, how it is used to create and manage databases, and how MUMPS code is written. Then, FileMan a database management system written in MUMPS is described. Finally, it is shown that VistA EMR is built on top of FileMan, which allows for creation of virtual tables (called files).

If the above video does not work, download this file: Lecture Part 1.mp4

 




MUMPS can be viewed as a database system, as a programming language, or as an operating system. The later functions are not used anymore, but are legacy from the times when Windows or Linux operating systems did not exist. The fact that it is a database system and programing language, makes it very convenient for programmers to write code that directly uses data stored permanently within a database. This is in contrast to integration of modern programming languages such as Java with database languages such as SQL. As a database system, MUMPS stores data in form of hierarchies. An example of a hierarchy is presented in Figure 1




Figure 1

Two basic MUMPS commands are SET (or S) that assigns a variable or global a value, WRITE (or W) that displays desired content to screen, and READ (or R) that reads value from screen. These commands were covered in the previous lecture.

In addition to commands, MUMPS implements a variety of functions. Three most important functions used in data manipulation are: $DATA which checks if a values is assigned to a specific local or global variable, $ORDER which returns next element in an array on the same level, and $QUERY which returns next element in the array in a sub-tree.
S code= " w x+y,! "
R x
R y
X code

As a result of executing these four lines of code, the program prompts user to enter value of x, then value of y, and then executes command stored in code variable. The command displays sum of x and y followed by a new line (indicated by exclamation point). Similarly, to execute a routine one used DO (or D) command.



Another unique feature of MUMPS is that data are automatically sorted. In relational databases records are stored in order in which they were entered. In MUMPS, all items within an array are sorted by indices of an array.

If the above video does not work, download this file: Lecture Part 2.mp4

 







FileMan is a database management system written in MUMPS. Its idea is to provide better control over database by allowing to store data in tables (called files). It also provides data dictionary, and allows for data insertion, edition, deletion, and import/export.

Within VistA database, FileMan is stored in ^DI global. To start it, execute command DO P^DI.

If the above video does not work, download this file: Lecture Part 3.mp4

If the above video does not work, download this file: Screen Recording