VistA-FOIAVistA/r/PHARMACY_BENEFITS_MANAGEMEN.../PSULR6.m

39 lines
1.3 KiB
Mathematica

PSULR6 ;BIR/PDW - PBM Laboratory Printer Controller ;25 AUG 1998
;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
EN ;EP for printing reports
S PSUPG=0
S PSULRJOB=PSUJOB
S PSULRSUB="PSULR_"_PSULRJOB
DIVISION ;EP loop by divisions
S PSUDIV="" F S PSUDIV=$O(^XTMP(PSULRSUB,"REPORT1",PSUDIV)) Q:PSUDIV="" D REPORT
Q
;
REPORT ;EP Perform Prints COUNTS & PATIENTS for Division
;
;
; Printing Device should be opened by PSUDBQUE by now & IO set
I $Y>5 U IO W @IOF
S L="" F S L=$O(^XTMP(PSULRSUB,"REPORT1",PSUDIV,L)) Q:L="" S X=^(L) U IO W !,X I L=2 W !,?60,"PAGE: 1"
U IO W !!,@IOF
;
;VMP OIFO BAY PINES;ELR;PSU*3.0*32
I (($E($G(IOST))="P")&($G(IOST)'["P-MESS")) Q
REPORT2 ; Print Report 2
S PSUPG("PG")=1
D PGHDR
S L=5 F S L=$O(^XTMP(PSULRSUB,"REPORT2",PSUDIV,L)) Q:L="" S X=^(L) U IO W !,X I $Y+4>IOSL D PG Q:$G(PSUQUIT)
W !!
Q
PG ;EP Page controller
S PSUQUIT=0
I $Y<(IOSL-4) Q
S:'$D(PSUPG("PG")) PSUPG("PG")=0 S PSUPG("PG")=PSUPG("PG")+1
I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR I ($G(DIROUT)!$G(DUOUT)!$G(DTOUT)!$G(DROUT)) S PSUQUIT=1
U IO W @IOF
;
PGHDR ; Write Page Header (SUBJECT of MAILMESSAGE)
F I=1,2 W !,^XTMP(PSULRSUB,"REPORT2",PSUDIV,I)
W !,?60,"PAGE: ",PSUPG("PG")
F I=3:1:5 I $D(^XTMP(PSULRSUB,"REPORT2",PSUDIV,I)) W !,^(I)
Q