Page Numbering Example

From VistApedia
Jump to: navigation, search

This originally appeared as "Intracare Implementation Log Episode 46: A (Very) brief Programming VistA with MUMPS page numbering example."

In this brief example, we will get header page number printing working for progress notes. The routines to be changed are the routine ^TIUPRPN1 and the routine ^TIUPRPN2 (in GT.M stored in files: TIUPRPN1.m and TIUPRPN2.m) which in an install based on Astronaut (the rpm or deb based install) will reside in the Linux Directory named /opt/worldvista/EHR/r

There are several Linux Editors that work in text mode (such as you get with a putty or terminal emulator window) : vim, nano, gedit, etc. If you are using a GUI interface to Linux, you might want to use a GUI editor such as gedit or xemacs. To do this if you have used the "su" command to login to a different id, such as (from a su'ed in login such as to the vista id), you must issue a linux command to tell the "X Window system" that you need it to use a different user id. This is usually done to deal with issues of file protections. The linux command line to use is: xhost +SI:localuser:vista If you don't use this command once before using gedit then the X Window System (which handles GUI stuff on Linux) will reject it with message that says that 'no protocol specified'

If you don't want to leave the mumps command Prompt, for example, if you have already setup some of your local symbol table (with DUZ, U, etc) then you can use a command that will force GT.M to recreate the object file for a program if necessary.

One such command is:

From the gtm Prompt do a ZP ^routinename (The routinename is the mumpsfilename without the .m) In our example, these routine names are TIUPRPN1 and TIUPRPN2. So you would say ZP ^TIUPRPN1 or ZP ^TIUPRPN2 .

If you need to debug a program and need to dump the variable that occurred when an error was logged in the system. command: From the gtm Prompt D ^XTER the highest numbered error message will be the latest one.

In TIUPRN1.m just after line 13 which reads: N TIUPFHDR,TIUPFNBR,TIUMISC,TIUCONT1,TIUIDONE,TMP add the following line:

       S TIUZPAGE=1

Change line 26 by adding a dummy parameter .S15967 and TIUZPAGE as well as a increment operation. It should read:

       . I +$G(TIUSPG) D

HEADER^TIUPRPN2(.TIUFOOT,TIUFLAG,.TIUPFHDR,TIUCONT1,.S15967,TIUZPAGE) S TIUZPAGE=$G(TIUZPAGE)+1

Do similar to line 40:

       . . . I '+$G(TIUSPG) D

HEADER^TIUPRPN2(.TIUFOOT,TIUFLAG,.TIUPFHDR,TIUCONT1,.S15967,TIUZPAGE) S TIUZPAGE=$G(TIUZPAGE)+1

Save the file.

Now edit TIUPRN2.m

As before, add the TIUZPAGE variable to the call to HEADER on line 39:

FOOTW I '+$G(TIUHDR),+$G(TIUCONT) D HEADER(.TIUFOOT,TIUFLAG,.TIUPFHDR,TIUCONT1,$G(TIUROOT),TIUZPAGE)

Then to the actual function call on line 42:

HEADER(TIUFOOT,TIUFLAG,TIUPFHDR,TIUCONT1,TIUROOT,TIUZPAGE) ; Header

Then change line 51 to:

.W "MEDICAL Record     Page "_$G(TIUZPAGE,"IVTest") W:'+$G(TIUFLAG) "
    • " W ?(80-$L(TIUPFHDR)),TIUPFHDR

Save the file.

At the gtm Prompt issue:

gtm>ZP ^TIUPRPN1 gtm>ZP ^TIUPRPN2

Then fire up CPRS and try printing a test patient note to actual paper or a pdf. Page numbers should now appear. If you had CPRS running before the compilation step then it is likely that you will have to restart CPRS for the changes to appear.

-- IV