BTIUPRPN ;IHS/MSC/MGH - Special header/printer formats ;29-Aug-2014 15:41;DU
;;1.0;TEXT INTEGRATION UTILITIES;**1008,1012,1013**;Jun 20, 1997;Build 33
;Copy of SLC/MJC - Print SF 509 Progress Notes ;;7-6-95 9:00pm
DEVICE(TIUFLAG,TIUSPG) ; pick your device
;
W ! K IOP S %ZIS="Q" D ^%ZIS I POP K POP G EXIT
S TIUFLAG=+$G(TIUFLAG),TIUSPG=+$G(TIUSPG)
I $D(IO("Q")) K IO("Q") D G EXIT
.S ZTRTN="ENTRY1^TIUPRPN",ZTSAVE("^TMP(""TIUPR"",$J,")="",ZTSAVE("TIUD0")=""
.S ZTSAVE("TIUFLAG")="",ZTSAVE("TIUSPG")="",ZTDESC="TIU PRT PNS"
.D ^%ZTLOAD W !,$S($D(ZTSK):"Request Queued!",1:"Request Canceled!")
.K ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,TIUFLAG,TIUSPG
.D HOME^%ZIS
U IO D ENTRY1,^%ZISC
Q
ENTRY ; Entry point to print progress notes-called from ^TIUA
N TIUSPG
U IO
ENTRY1 ; Entry point from above
N TIUERR,D0,DN,Y,DTOUT,DUOUT,DIRUT,DIROUT
I $E(IOST)="C" S (TIUSPG,TIUFLAG)=1
I '+$G(TIUFLAG) S TIUSPG=1
K ^TMP("TIULQ",$J)
I $D(ZTQUEUED) S ZTREQ="@" ; Tell TaskMan to delete Task log entry
;If this title is defined as a special type
;Patch 1013 wrapped it with $G
S TIUTYPE=$P($G(TIUD0),U,1)
I +TIUTYPE D PRINT^BTIUPRT1(TIUTYPE,1,0)
E D PRINT^TIUPRPN1($G(TIUFLAG),$G(TIUSPG))
EXIT K ^TMP("TIULQ",$J),^TMP("TIUPR",$J)
Q
DIV ; enter/edit division params in file 8925.94
N DA,DIC,DIV,DIE,DR,TIUQT,Y,TITLE
F W ! D Q:$D(TIUQT)
.S DIC=8925.94,DIC(0)="AEQMNL"
.S DIC("A")="Select Division for PNs Outpatient Batch Print: "
.D ^DIC I Y<0 S TIUQT=1 Q
.S DIV=+Y
.K DIC
.;Find the title
.S DIC="^TIU(8925.94,"_DIV_",9999999.11,",DIC(0)="AELQ"
.S DA(1)=DIV,DIC("P")=$P(^DD(8925.94,9999999.11,0),"^",2)
.D ^DIC I Y<0 S TIUQT=1 Q
.S TITLE=+Y
.K Y
.S DIE=DIC
.S DA(1)=DIV,DA=TITLE
.S DR="1;2" D ^DIE
.K DR,DA,DIE,DIC
K DLAYGO
Q
BTIUPRPN ;IHS/MSC/MGH - Special header/printer formats ;29-Aug-2014 15:41;DU
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**1008,1012,1013**;Jun 20, 1997;Build 33
+2 ;Copy of SLC/MJC - Print SF 509 Progress Notes ;;7-6-95 9:00pm
DEVICE(TIUFLAG,TIUSPG) ; pick your device
+1 ;
+2 WRITE !
KILL IOP
SET %ZIS="Q"
DO ^%ZIS
IF POP
KILL POP
GOTO EXIT
+3 SET TIUFLAG=+$GET(TIUFLAG)
SET TIUSPG=+$GET(TIUSPG)
+4 IF $DATA(IO("Q"))
KILL IO("Q")
Begin DoDot:1
+5 SET ZTRTN="ENTRY1^TIUPRPN"
SET ZTSAVE("^TMP(""TIUPR"",$J,")=""
SET ZTSAVE("TIUD0")=""
+6 SET ZTSAVE("TIUFLAG")=""
SET ZTSAVE("TIUSPG")=""
SET ZTDESC="TIU PRT PNS"
+7 DO ^%ZTLOAD
WRITE !,$SELECT($DATA(ZTSK):"Request Queued!",1:"Request Canceled!")
+8 KILL ZTSK,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,TIUFLAG,TIUSPG
+9 DO HOME^%ZIS
End DoDot:1
GOTO EXIT
+10 USE IO
DO ENTRY1
DO ^%ZISC
+11 QUIT
ENTRY ; Entry point to print progress notes-called from ^TIUA
+1 NEW TIUSPG
+2 USE IO
ENTRY1 ; Entry point from above
+1 NEW TIUERR,D0,DN,Y,DTOUT,DUOUT,DIRUT,DIROUT
+2 IF $EXTRACT(IOST)="C"
SET (TIUSPG,TIUFLAG)=1
+3 IF '+$GET(TIUFLAG)
SET TIUSPG=1
+4 KILL ^TMP("TIULQ",$JOB)
+5 ; Tell TaskMan to delete Task log entry
IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+6 ;If this title is defined as a special type
+7 ;Patch 1013 wrapped it with $G
+8 SET TIUTYPE=$PIECE($GET(TIUD0),U,1)
+9 IF +TIUTYPE
DO PRINT^BTIUPRT1(TIUTYPE,1,0)
+10 IF '$TEST
DO PRINT^TIUPRPN1($GET(TIUFLAG),$GET(TIUSPG))
EXIT KILL ^TMP("TIULQ",$JOB),^TMP("TIUPR",$JOB)
+1 QUIT
DIV ; enter/edit division params in file 8925.94
+1 NEW DA,DIC,DIV,DIE,DR,TIUQT,Y,TITLE
+2 FOR
WRITE !
Begin DoDot:1
+3 SET DIC=8925.94
SET DIC(0)="AEQMNL"
+4 SET DIC("A")="Select Division for PNs Outpatient Batch Print: "
+5 DO ^DIC
IF Y<0
SET TIUQT=1
QUIT
+6 SET DIV=+Y
+7 KILL DIC
+8 ;Find the title
+9 SET DIC="^TIU(8925.94,"_DIV_",9999999.11,"
SET DIC(0)="AELQ"
+10 SET DA(1)=DIV
SET DIC("P")=$PIECE(^DD(8925.94,9999999.11,0),"^",2)
+11 DO ^DIC
IF Y<0
SET TIUQT=1
QUIT
+12 SET TITLE=+Y
+13 KILL Y
+14 SET DIE=DIC
+15 SET DA(1)=DIV
SET DA=TITLE
+16 SET DR="1;2"
DO ^DIE
+17 KILL DR,DA,DIE,DIC
End DoDot:1
IF $DATA(TIUQT)
QUIT
+18 KILL DLAYGO
+19 QUIT