Episode46

From VistApedia
Jump to: navigation, search

In this brief example, we will get header page number printing working for progress notes. The routines to be changed are TIUPRPN1.m and TIUPRPN2.m which in the rpm or deb based install will reside in /opt/worldvista/EHR/r

Linux Editor: vim, nano, gedit, etc. If you want to use a GUI editor such as gedit from a su'ed in login such as to the vista id, you must issue a: xhost +SI:localuser:vista once before using gedit or X will reject it with 'no protocol specified'

Compile command: From the gtm Prompt do a ZP ^<mumpsfilename without the .m> where in this example it is TIUPRPN1 and TIUPRPN2.

Dump the debug variable 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

All rights reserved - Ignacio Valdes