IBDF2B1 ;ALB/CJM - ENCOUNTER FORM - (continuation of IBDF2B);12/15/92
;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
;
TXTPRINT ;for printing a word-processing field
;
;if the this is not the first time this form is being printed and the data doesn't change then don't print it!
Q:(('IBPRINT("ENTIRE"))&('RTN("CHANGES")))
;
N LINE,LNSUSED,SPACE,QUIT S LNSUSED=0 ;LNSUSED keeps track of number of available lines for text are used already
S SPACE=$S(SPACING=2:2,1:1)
I 'HIO!('WIO)!(XIO'=+XIO)!(YIO'=+YIO) Q
I LABEL'="",(('IBPRINT("WITH_DATA"))!($G(@RTN("DATA_LOCATION")@(1,0))="")) D
.D DRWSTR^IBDFU(YIO+SPACE-1,XIO,LABEL,DISPLAY)
.D DRWSTR^IBDFU(YIO+SPACE-1,XIO+$L(LABEL)," "_$$HLINE^IBDFU(WIO-($L(LABEL)+1)))
.S LNSUSED=SPACE
I IBPRINT("WITH_DATA"),($G(@RTN("DATA_LOCATION")@(1,0))'="") D
.D FORMAT^IBDFU6("^TMP(""IB"",$J,""INTERFACES"",+$G(DFN),RTN(""NAME""))",WIO,LABEL)
.S (LNSUSED,LINE,QUIT)=0 F S LINE=$O(^UTILITY($J,"W",1,LINE)) D Q:QUIT
..I 'LINE!(LNSUSED+SPACE>HIO) S QUIT=1 D:(LINE&('IBDEVICE("LISTMAN"))&RTN("FULL")) OVERFLOW^IBDF2B("CURRENT") Q
..D DRWSTR^IBDFU(YIO+LNSUSED+(SPACE-1),XIO,$$PADRIGHT^IBDFU($G(^UTILITY($J,"W",1,LINE,0)),WIO))
..S LNSUSED=LNSUSED+SPACE
D ADDLINES^IBDF2B
K ^UTILITY($J,"W",1)
Q
IBDF2B1 ;ALB/CJM - ENCOUNTER FORM - (continuation of IBDF2B);12/15/92
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
+2 ;
TXTPRINT ;for printing a word-processing field
+1 ;
+2 ;if the this is not the first time this form is being printed and the data doesn't change then don't print it!
+3 IF (('IBPRINT("ENTIRE"))&('RTN("CHANGES")))
QUIT
+4 ;
+5 ;LNSUSED keeps track of number of available lines for text are used already
NEW LINE,LNSUSED,SPACE,QUIT
SET LNSUSED=0
+6 SET SPACE=$SELECT(SPACING=2:2,1:1)
+7 IF 'HIO!('WIO)!(XIO'=+XIO)!(YIO'=+YIO)
QUIT
+8 IF LABEL'=""
IF (('IBPRINT("WITH_DATA"))!($GET(@RTN("DATA_LOCATION")@(1,0))=""))
Begin DoDot:1
+9 DO DRWSTR^IBDFU(YIO+SPACE-1,XIO,LABEL,DISPLAY)
+10 DO DRWSTR^IBDFU(YIO+SPACE-1,XIO+$LENGTH(LABEL)," "_$$HLINE^IBDFU(WIO-($LENGTH(LABEL)+1)))
+11 SET LNSUSED=SPACE
End DoDot:1
+12 IF IBPRINT("WITH_DATA")
IF ($GET(@RTN("DATA_LOCATION")@(1,0))'="")
Begin DoDot:1
+13 DO FORMAT^IBDFU6("^TMP(""IB"",$J,""INTERFACES"",+$G(DFN),RTN(""NAME""))",WIO,LABEL)
+14 SET (LNSUSED,LINE,QUIT)=0
FOR
SET LINE=$ORDER(^UTILITY($JOB,"W",1,LINE))
Begin DoDot:2
+15 IF 'LINE!(LNSUSED+SPACE>HIO)
SET QUIT=1
IF (LINE&('IBDEVICE("LISTMAN"))&RTN("FULL"))
DO OVERFLOW^IBDF2B("CURRENT")
QUIT
+16 DO DRWSTR^IBDFU(YIO+LNSUSED+(SPACE-1),XIO,$$PADRIGHT^IBDFU($GET(^UTILITY($JOB,"W",1,LINE,0)),WIO))
+17 SET LNSUSED=LNSUSED+SPACE
End DoDot:2
IF QUIT
QUIT
End DoDot:1
+18 DO ADDLINES^IBDF2B
+19 KILL ^UTILITY($JOB,"W",1)
+20 QUIT