BIW ;IHS/CMI/MWR - WRITE LINES TO ^TMP.; MAY 10, 2010
;;8.5;IMMUNIZATION;;SEP 01,2011
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; WRITE LINES TO ^TMP AND VALMHDR FOR LISTMAN DISPLAYS & REPORTS.
;
;
;----------
WH(BILINE,BIVAL,BIBLNK) ;EP
;---> Write a Header line to the VALMHDR array (Listman Header).
;---> Parameters:
; 1 - BILINE (ret) Last line# in the Header array.
; 2 - BIVAL (opt) Value/text of line (Null=blank line).
; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
;
Q:'$D(BILINE)
S:$G(BIVAL)="" BIVAL=" "
S BILINE=BILINE+1,VALMHDR(BILINE)=BIVAL
;
;---> Write as many blank line after as specified by parameter 3.
N I F I=1:1:+$G(BIBLNK) S BILINE=BILINE+1,VALMHDR(BILINE)=" "
Q
;
;
;----------
WL(BILINE,BINOD,BIVAL,BIBLNK,BIENT) ;EP
;---> Write a line to the ^TMP global for WP or Listman.
;---> Parameters:
; 1 - BILINE (ret) Last line# in the WP ^TMP global.
; 2 - BINOD (req) Node in ^TMP to store lines under.
; 3 - BIVAL (opt) Value/text of line (Null=blank line).
; 4 - BIBLNK (opt) Number of blank lines to add after line sent.
; 5 - BIENT (opt) Entry Number for LM selection in VALMY
;
Q:$G(BINOD)=""
S:'$G(BILINE) BILINE=0
S:$G(BIVAL)="" BIVAL=" "
;
S BILINE=BILINE+1
S ^TMP(BINOD,$J,BILINE,0)=BIVAL
S:$G(BIENT) ^TMP(BINOD,$J,"IDX",BILINE,BIENT)=""
;
;---> Write as many blank lines after as specified by parameter 4.
N I F I=1:1:+$G(BIBLNK) D
.S BILINE=BILINE+1,^TMP(BINOD,$J,BILINE,0)=" "
.S:$G(BIENT) ^TMP(BINOD,$J,"IDX",BILINE,BIENT)=""
Q
;
;
;;*** BELOW IS A STANDARD "WRITE" CALL THAT CAN BE PASTED INTO
;;*** A ROUTINE FOR MULTIPLE CALLS FROM THAT ROUTINE TO THE ABOVE
;;*** SUBROUTINE. NOTE: THE NODE PASSED MUST BE EDITED AS APPROPRIATE.
;----------
WRITE(BILINE,BIVAL,BIBLNK,BIENT) ;EP
;---> Write lines to ^TMP (see documentation in ^BIW).
;---> Parameters:
; 1 - BILINE (ret) Last line# written.
; 2 - BIVAL (opt) Value/text of line (Null=blank line).
; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
; 4 - BIENT (opt) Entry Number for LM selection in VALMY
;
Q:'$D(BILINE)
D WL^BIW(.BILINE,"BIREPA1",$G(BIVAL),$G(BIBLNK),$G(BIENT))
Q
;
;
;----------
MARK(BILINE,BILNS,BINODE) ;EP
;---> Mark the top line of a record (or node in a Listman TMP global
;---> with the number of lines in that record.
;---> This utility enables one to avoid splitting records with
;---> formfeeds when printing.
;---> The number of lines in a record is stored by appending a number
;---> of $C(30)'s equal to the number of lines, delimited by $C(31).
;---> Note that $(30) and $C(31) are not visible characters on screen.
;---> This code is picked up by line label PRTLST, just below,
;---> when printing a Listman TMP global.
;---> Parameters:
; 1 - BILINE (ret) Top line of the record to be marked.
; 2 - BILNS (req) Number of lines in the record.
; 3 - BINODE (req) The node in ^TMP storing the text,
; e.g., "BIDULV" in ^TMP("BIDULV",$J,BILINE,0).
;
Q:'$G(BILINE) Q:'$G(BILNS) Q:$G(BINODE)=""
N BI31 S BI31=$C(31)_$C(31)
N BILNS1,I S BILNS1=""
F I=1:1:BILNS S BILNS1=BILNS1_$C(30)
S $P(^TMP(BINODE,$J,BILINE,0),BI31,2)=BILNS1
Q
BIW ;IHS/CMI/MWR - WRITE LINES TO ^TMP.; MAY 10, 2010
+1 ;;8.5;IMMUNIZATION;;SEP 01,2011
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; WRITE LINES TO ^TMP AND VALMHDR FOR LISTMAN DISPLAYS & REPORTS.
+4 ;
+5 ;
+6 ;----------
WH(BILINE,BIVAL,BIBLNK) ;EP
+1 ;---> Write a Header line to the VALMHDR array (Listman Header).
+2 ;---> Parameters:
+3 ; 1 - BILINE (ret) Last line# in the Header array.
+4 ; 2 - BIVAL (opt) Value/text of line (Null=blank line).
+5 ; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
+6 ;
+7 IF '$DATA(BILINE)
QUIT
+8 IF $GET(BIVAL)=""
SET BIVAL=" "
+9 SET BILINE=BILINE+1
SET VALMHDR(BILINE)=BIVAL
+10 ;
+11 ;---> Write as many blank line after as specified by parameter 3.
+12 NEW I
FOR I=1:1:+$GET(BIBLNK)
SET BILINE=BILINE+1
SET VALMHDR(BILINE)=" "
+13 QUIT
+14 ;
+15 ;
+16 ;----------
WL(BILINE,BINOD,BIVAL,BIBLNK,BIENT) ;EP
+1 ;---> Write a line to the ^TMP global for WP or Listman.
+2 ;---> Parameters:
+3 ; 1 - BILINE (ret) Last line# in the WP ^TMP global.
+4 ; 2 - BINOD (req) Node in ^TMP to store lines under.
+5 ; 3 - BIVAL (opt) Value/text of line (Null=blank line).
+6 ; 4 - BIBLNK (opt) Number of blank lines to add after line sent.
+7 ; 5 - BIENT (opt) Entry Number for LM selection in VALMY
+8 ;
+9 IF $GET(BINOD)=""
QUIT
+10 IF '$GET(BILINE)
SET BILINE=0
+11 IF $GET(BIVAL)=""
SET BIVAL=" "
+12 ;
+13 SET BILINE=BILINE+1
+14 SET ^TMP(BINOD,$JOB,BILINE,0)=BIVAL
+15 IF $GET(BIENT)
SET ^TMP(BINOD,$JOB,"IDX",BILINE,BIENT)=""
+16 ;
+17 ;---> Write as many blank lines after as specified by parameter 4.
+18 NEW I
FOR I=1:1:+$GET(BIBLNK)
Begin DoDot:1
+19 SET BILINE=BILINE+1
SET ^TMP(BINOD,$JOB,BILINE,0)=" "
+20 IF $GET(BIENT)
SET ^TMP(BINOD,$JOB,"IDX",BILINE,BIENT)=""
End DoDot:1
+21 QUIT
+22 ;
+23 ;
+24 ;;*** BELOW IS A STANDARD "WRITE" CALL THAT CAN BE PASTED INTO
+25 ;;*** A ROUTINE FOR MULTIPLE CALLS FROM THAT ROUTINE TO THE ABOVE
+26 ;;*** SUBROUTINE. NOTE: THE NODE PASSED MUST BE EDITED AS APPROPRIATE.
+27 ;----------
WRITE(BILINE,BIVAL,BIBLNK,BIENT) ;EP
+1 ;---> Write lines to ^TMP (see documentation in ^BIW).
+2 ;---> Parameters:
+3 ; 1 - BILINE (ret) Last line# written.
+4 ; 2 - BIVAL (opt) Value/text of line (Null=blank line).
+5 ; 3 - BIBLNK (opt) Number of blank lines to add after line sent.
+6 ; 4 - BIENT (opt) Entry Number for LM selection in VALMY
+7 ;
+8 IF '$DATA(BILINE)
QUIT
+9 DO WL^BIW(.BILINE,"BIREPA1",$GET(BIVAL),$GET(BIBLNK),$GET(BIENT))
+10 QUIT
+11 ;
+12 ;
+13 ;----------
MARK(BILINE,BILNS,BINODE) ;EP
+1 ;---> Mark the top line of a record (or node in a Listman TMP global
+2 ;---> with the number of lines in that record.
+3 ;---> This utility enables one to avoid splitting records with
+4 ;---> formfeeds when printing.
+5 ;---> The number of lines in a record is stored by appending a number
+6 ;---> of $C(30)'s equal to the number of lines, delimited by $C(31).
+7 ;---> Note that $(30) and $C(31) are not visible characters on screen.
+8 ;---> This code is picked up by line label PRTLST, just below,
+9 ;---> when printing a Listman TMP global.
+10 ;---> Parameters:
+11 ; 1 - BILINE (ret) Top line of the record to be marked.
+12 ; 2 - BILNS (req) Number of lines in the record.
+13 ; 3 - BINODE (req) The node in ^TMP storing the text,
+14 ; e.g., "BIDULV" in ^TMP("BIDULV",$J,BILINE,0).
+15 ;
+16 IF '$GET(BILINE)
QUIT
IF '$GET(BILNS)
QUIT
IF $GET(BINODE)=""
QUIT
+17 NEW BI31
SET BI31=$CHAR(31)_$CHAR(31)
+18 NEW BILNS1,I
SET BILNS1=""
+19 FOR I=1:1:BILNS
SET BILNS1=BILNS1_$CHAR(30)
+20 SET $PIECE(^TMP(BINODE,$JOB,BILINE,0),BI31,2)=BILNS1
+21 QUIT