Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BTIUPRT2

BTIUPRT2.m

Go to the documentation of this file.
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
FOOTW I '+$G(TIUHDR),+$G(TIUCONT) D HEADER(TIUFLAG,TIUCONT1,HEADER,TIUDA,DFN)
FOOTX ;
 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