BTIUPRT2 ;IHS/MSC/MGH - Special header/footers;18-Mar-2015 12:30;DU
;;1.0;TEXT INTEGRATION UTILITIES;**1008,1013**;Jun 20, 1997;Build 33
;From TIUPRPN2 - Header/Footer for Progress Notes ;25-JAN-2001 08:50:35
;IHS/MSC/MGH 1013 new VADM because of variable leak
;
; Also controls Pagination position, writes footer when appropriate.
; vars TIUMISC,TIUCONT1. Optional TIUHDR.
; IF TIUHDR=1, HEADER WILL NOT BE PRINTED
N TIUCONT,TIUFLAG,TIUPFNBR,TIUDA,LINENO,LINE,Y,CNT
K ^TMP("TIUBOIL",$J)
S TIUCONT=1
S TIUFLAG=$P(TIUMISC,U),TIUPFNBR=$P(TIUMISC,U,2),TIUDA=$P(TIUMISC,U,3)
I $E(IOST)="C" G FOOTX:$Y+3<IOSL S TIUCONT=$$STOP G FOOTW
G FTR:+$G(TIUHDR)
G:$Y+10<IOSL FOOTX
FTR D BOIL(FOOTER,.CNT,DFN)
S LINENO=CNT+4
I (IOT'="HFS")!(IOSL<250) F Q:$Y+LINENO'<IOSL W ! ;moves ftr to pg bottom
N TIUFNUM,TIULINE,LOC,DIV,TIUDIV,TIUDIVI,TIUPRTDT,TIUPRTNM
S $P(TIULINE,"-",81)=""
S Y="" F S Y=$O(^TMP("TIUBOIL",$J,Y)) Q:Y="" D
.W !,$G(^TMP("TIUBOIL",$J,Y,0))
W ?21,$S(+$G(TIUCONT1):"** THIS NOTE CONTINUED ON NEXT PAGE **",1:""),!
S TIUPRTDT="Printed:"_$$DATE^TIULS($$NOW^TIULC,"MM/DD/CCYY HR:MIN")
W ?55,TIUPRTDT
W !,"=========================== CONFIDENTIAL INFORMATION ==========================="
W @IOF
Q TIUCONT
; Requires array TIUFOOT, vars TIUFLAG,TIUPFHDR,TIUCONT1
N TIULINE,LINENO,X,LINE,NEWLINE,Y,LINENO
K ^TMP("TIUBOIL",$J)
S $P(TIULINE,"-",81)=""
I $E(IOST)="C" D
.;W @IOF,$C(13),!,TIULINE,!
.;I +$G(TIUCONT1) W $$DATE^TIULS(@TIUROOT@(1301,"I"),"MM/DD/CCYY HR:MIN"),
.I +G(TIUCONT1) W !,?21,"** CONTINUED FROM PREVIOUS SCREEN **",!!
E D
.;W !,TIULINE,!
.;I +$G(TIUCONT1) W $$DATE^TIULS(@TIUROOT@(1301,"I"),"MM/DD/CCYY HR:MIN"),
.I +$G(TIUCONT1) W !,?21,"** CONTINUED FROM PREVIOUS PAGE **",!!
D BOIL(HEADER,.LINENO,DFN)
S Y="" F S Y=$O(^TMP("TIUBOIL",$J,Y)) Q:Y="" D
.W !,$G(^TMP("TIUBOIL",$J,Y,0))
W !
Q
BOIL(TYPE,CNT,DFN) ;Expand boilerplate text
N TIU,VADM
S TIU("VISIT")=TIUK
S LINENO=0 F S LINENO=$O(^TIU(8927,TYPE,2,LINENO)) Q:LINENO="" D
. S CNT=LINENO
. S LINE=$G(^TIU(8927,TYPE,2,LINENO,0))
. I LINE["|" S X=$$BOIL^TIUSRVD(LINE,LINENO) D
. .I X["~@" D INSMULT^TIUSRVD(X,"^TMP(""TIUBOIL"",$J)",.LINENO) I 1
. .E S ^TMP("TIUBOIL",$J,LINENO,0)=X
. E S ^TMP("TIUBOIL",$J,LINENO,0)=LINE
Q
STOP() ;on screen paging check
; quits TIUCONT=1 if cont. ELSE quits TIUCONT=0
N DIR,Y,TIUCONT
S DIR(0)="E" D ^DIR
S TIUCONT=Y
Q TIUCONT
BTIUPRT2 ;IHS/MSC/MGH - Special header/footers;18-Mar-2015 12:30;DU
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**1008,1013**;Jun 20, 1997;Build 33
+2 ;From TIUPRPN2 - Header/Footer for Progress Notes ;25-JAN-2001 08:50:35
+3 ;IHS/MSC/MGH 1013 new VADM because of variable leak
+4 ;
+1 ; Also controls Pagination position, writes footer when appropriate.
+2 ; vars TIUMISC,TIUCONT1. Optional TIUHDR.
+3 ; IF TIUHDR=1, HEADER WILL NOT BE PRINTED
+4 NEW TIUCONT,TIUFLAG,TIUPFNBR,TIUDA,LINENO,LINE,Y,CNT
+5 KILL ^TMP("TIUBOIL",$JOB)
+6 SET TIUCONT=1
+7 SET TIUFLAG=$PIECE(TIUMISC,U)
SET TIUPFNBR=$PIECE(TIUMISC,U,2)
SET TIUDA=$PIECE(TIUMISC,U,3)
+8 IF $EXTRACT(IOST)="C"
IF $Y+3<IOSL
GOTO FOOTX
SET TIUCONT=$$STOP
GOTO FOOTW
+9 IF +$GET(TIUHDR)
GOTO FTR
+10 IF $Y+10<IOSL
GOTO FOOTX
FTR DO BOIL(FOOTER,.CNT,DFN)
+1 SET LINENO=CNT+4
+2 ;moves ftr to pg bottom
IF (IOT'="HFS")!(IOSL<250)
FOR
IF $Y+LINENO'<IOSL
QUIT
WRITE !
+3 NEW TIUFNUM,TIULINE,LOC,DIV,TIUDIV,TIUDIVI,TIUPRTDT,TIUPRTNM
+4 SET $PIECE(TIULINE,"-",81)=""
+5 SET Y=""
FOR
SET Y=$ORDER(^TMP("TIUBOIL",$JOB,Y))
IF Y=""
QUIT
Begin DoDot:1
+6 WRITE !,$GET(^TMP("TIUBOIL",$JOB,Y,0))
End DoDot:1
+7 WRITE ?21,$SELECT(+$GET(TIUCONT1):"** THIS NOTE CONTINUED ON NEXT PAGE **",1:""),!
+8 SET TIUPRTDT="Printed:"_$$DATE^TIULS($$NOW^TIULC,"MM/DD/CCYY HR:MIN")
+9 WRITE ?55,TIUPRTDT
+10 WRITE !,"=========================== CONFIDENTIAL INFORMATION ==========================="
+11 WRITE @IOF
IF +$GET(TIUCONT)
DO HEADER(TIUFLAG,TIUCONT1,HEADER,TIUDA,DFN)
+1 QUIT TIUCONT
+1 ; Requires array TIUFOOT, vars TIUFLAG,TIUPFHDR,TIUCONT1
+2 NEW TIULINE,LINENO,X,LINE,NEWLINE,Y,LINENO
+3 KILL ^TMP("TIUBOIL",$JOB)
+4 SET $PIECE(TIULINE,"-",81)=""
+5 IF $EXTRACT(IOST)="C"
Begin DoDot:1
+6 ;W @IOF,$C(13),!,TIULINE,!
+7 ;I +$G(TIUCONT1) W $$DATE^TIULS(@TIUROOT@(1301,"I"),"MM/DD/CCYY HR:MIN"),
+8 IF +G(TIUCONT1)
WRITE !,?21,"** CONTINUED FROM PREVIOUS SCREEN **",!!
End DoDot:1
+9 IF '$TEST
Begin DoDot:1
+10 ;W !,TIULINE,!
+11 ;I +$G(TIUCONT1) W $$DATE^TIULS(@TIUROOT@(1301,"I"),"MM/DD/CCYY HR:MIN"),
+12 IF +$GET(TIUCONT1)
WRITE !,?21,"** CONTINUED FROM PREVIOUS PAGE **",!!
End DoDot:1
+13 DO BOIL(HEADER,.LINENO,DFN)
+14 SET Y=""
FOR
SET Y=$ORDER(^TMP("TIUBOIL",$JOB,Y))
IF Y=""
QUIT
Begin DoDot:1
+15 WRITE !,$GET(^TMP("TIUBOIL",$JOB,Y,0))
End DoDot:1
+16 WRITE !
+17 QUIT
BOIL(TYPE,CNT,DFN) ;Expand boilerplate text
+1 NEW TIU,VADM
+2 SET TIU("VISIT")=TIUK
+3 SET LINENO=0
FOR
SET LINENO=$ORDER(^TIU(8927,TYPE,2,LINENO))
IF LINENO=""
QUIT
Begin DoDot:1
+4 SET CNT=LINENO
+5 SET LINE=$GET(^TIU(8927,TYPE,2,LINENO,0))
+6 IF LINE["|"
SET X=$$BOIL^TIUSRVD(LINE,LINENO)
Begin DoDot:2
+7 IF X["~@"
DO INSMULT^TIUSRVD(X,"^TMP(""TIUBOIL"",$J)",.LINENO)
IF 1
+8 IF '$TEST
SET ^TMP("TIUBOIL",$JOB,LINENO,0)=X
End DoDot:2
+9 IF '$TEST
SET ^TMP("TIUBOIL",$JOB,LINENO,0)=LINE
End DoDot:1
+10 QUIT
STOP() ;on screen paging check
+1 ; quits TIUCONT=1 if cont. ELSE quits TIUCONT=0
+2 NEW DIR,Y,TIUCONT
+3 SET DIR(0)="E"
DO ^DIR
+4 SET TIUCONT=Y
+5 QUIT TIUCONT