MUMPS Programming/overview

MUMPS Terminology

edit

First, some MUMPS terminology-

  • Routines - the term for programs, lines of commands in sequence.
    • Each routine has a name (RoutineName) which is used to execute it by way of the DO command.
    • An up arrow ^ (caret character) is a prefix to the RoutineName distinguishing it as a routine versus a label within the current routine.
    • Traditionally a routine is about a page in length as a logical section that is easily visible as a cognitive unit.
  • Globals are the persistent database variables in MUMPS. These are a unique feature.
    • Global Names begin with up arrow (caret) also.
    • Global names have a comma-separated list in parentheses of subscripts as a multi-dimensional array.
    • Subscripts create a hierarchical database, which may be huge, may be shared among many simultaneous tasks.
    • Globals are persistent on the Hard Drive (or other devices like flash drives) as they are the database representation in MUMPS.
    • The intrinsic nature of globals in the MUMPS language largely hide the necessity of application programmers dealing with issues of file opening, buffering, caching, encryption, compression, etc. These are managed with historic sophistication by the binary tree encoding and dynamic creation of the MUMPS system. See MUMPS as an Operating System.
    ^PtData(ClinicId,PtNum,VisitNum,NoteNum,Line)=  ...  
    ;
    ;where  data is separated by Clinic first, then by patient, then visit, then note,
    ;   and the node itself contains the text for one line of the patient note.