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

PSUPR6.m

Go to the documentation of this file.
  1. PSUPR6 ;BIR/PDW - PBM Procurement Printer Controller ;25 AUG 1998
  1. ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
  1. EN ;EP for printing reports
  1. N PSUQUIT
  1. S PSUPG=0
  1. S PSUPRJOB=PSUJOB
  1. S PSUPRSUB="PSUPR_"_PSUPRJOB
  1. DIVISION ;EP loop by divisions
  1. S PSUDIV="" F S PSUDIV=$O(^XTMP(PSUPRSUB,"REPORT1",PSUDIV)) Q:PSUDIV="" D REPORT
  1. Q
  1. ;
  1. REPORT ;EP Perform Prints Category & Drug for Division
  1. ;
  1. CATRPT ;
  1. ; Printing Device should be opened by PSUDBQUE by now & IO set
  1. I $Y>5 U IO W @IOF
  1. 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"
  1. U IO W !!,@IOF
  1. ;
  1. DRUGRPT ; Print Drug Summary
  1. I '$D(^XTMP(PSUPRSUB,"REPORT2",PSUDIV)) Q
  1. S PSUPG("PG")=1 D PGHDR
  1. 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)
  1. W @IOF
  1. Q
  1. PG ;EP Page controller
  1. S PSUQUIT=0
  1. I $Y<(IOSL-4) Q
  1. S:'$D(PSUPG("PG")) PSUPG("PG")=0 S PSUPG("PG")=PSUPG("PG")+1
  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
  1. U IO W @IOF
  1. ;
  1. PGHDR ; Write Page Header (SUBJECT of MAILMESSAGE)
  1. I '$D(^XTMP(PSUPRSUB,"REPORT2",PSUDIV)) Q
  1. F I=1,2 W !,^XTMP(PSUPRSUB,"REPORT2",PSUDIV,I)
  1. W !,?60,"PAGE: ",PSUPG("PG")
  1. F I=3:1:6 I $D(^XTMP(PSUPRSUB,"REPORT2",PSUDIV,I)) W !,^(I)
  1. Q