[613] | 1 | PSUPR6 ;BIR/PDW - PBM Procurement Printer Controller ;25 AUG 1998
|
---|
| 2 | ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
|
---|
| 3 | EN ;EP for printing reports
|
---|
| 4 | N PSUQUIT
|
---|
| 5 | S PSUPG=0
|
---|
| 6 | S PSUPRJOB=PSUJOB
|
---|
| 7 | S PSUPRSUB="PSUPR_"_PSUPRJOB
|
---|
| 8 | DIVISION ;EP loop by divisions
|
---|
| 9 | S PSUDIV="" F S PSUDIV=$O(^XTMP(PSUPRSUB,"REPORT1",PSUDIV)) Q:PSUDIV="" D REPORT
|
---|
| 10 | Q
|
---|
| 11 | ;
|
---|
| 12 | REPORT ;EP Perform Prints Category & Drug for Division
|
---|
| 13 | ;
|
---|
| 14 | CATRPT ;
|
---|
| 15 | ; Printing Device should be opened by PSUDBQUE by now & IO set
|
---|
| 16 | I $Y>5 U IO W @IOF
|
---|
| 17 | S L="" F S L=$O(^XTMP(PSUPRSUB,"REPORT1",PSUDIV,L)) Q:L="" S X=^(L) U IO W !,X I L=2 W !,?60,"PAGE: 1"
|
---|
| 18 | U IO W !!,@IOF
|
---|
| 19 | ;
|
---|
| 20 | DRUGRPT ; Print Drug Summary
|
---|
| 21 | I '$D(^XTMP(PSUPRSUB,"REPORT2",PSUDIV)) Q
|
---|
| 22 | S PSUPG("PG")=1 D PGHDR
|
---|
| 23 | S L=6 F S L=$O(^XTMP(PSUPRSUB,"REPORT2",PSUDIV,L)) Q:L="" S X=^(L) U IO W !,X I $Y+4>IOSL D PG Q:$G(PSUQUIT)
|
---|
| 24 | W @IOF
|
---|
| 25 | Q
|
---|
| 26 | PG ;EP Page controller
|
---|
| 27 | S PSUQUIT=0
|
---|
| 28 | I $Y<(IOSL-4) Q
|
---|
| 29 | S:'$D(PSUPG("PG")) PSUPG("PG")=0 S PSUPG("PG")=PSUPG("PG")+1
|
---|
| 30 | I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR I ($G(DIROUT)!$G(DUOUT)!$G(DTOUT)!$G(DROUT)) S PSUQUIT=1
|
---|
| 31 | U IO W @IOF
|
---|
| 32 | ;
|
---|
| 33 | PGHDR ; Write Page Header (SUBJECT of MAILMESSAGE)
|
---|
| 34 | I '$D(^XTMP(PSUPRSUB,"REPORT2",PSUDIV)) Q
|
---|
| 35 | F I=1,2 W !,^XTMP(PSUPRSUB,"REPORT2",PSUDIV,I)
|
---|
| 36 | W !,?60,"PAGE: ",PSUPG("PG")
|
---|
| 37 | F I=3:1:6 I $D(^XTMP(PSUPRSUB,"REPORT2",PSUDIV,I)) W !,^(I)
|
---|
| 38 | Q
|
---|