PSGWHV1 ;BHAM ISC/PTD,CML-Print High Volume Report for Selected Date Range - CONTINUED ; 23 Mar 93 / 12:53 PM
;;2.3;Automatic Replenishment/Ward Stock ;**21**;4 JAN 94;Build 6
EN1 S (CF,CNT)=0,PGCT=1,QFLG="" D HDR I '$D(^TMP("PSGWHV",$J,"VL")) W !!,"NO DATA AVAILABLE FOR SELECTED DATES." G DONE
CFLP S CF=$O(^TMP("PSGWHV",$J,"VL",CF)),DRG=0 I 'CF W !!,"# of Items: ",CNT G DONE
DRGLP S DRG=$O(^TMP("PSGWHV",$J,"VL",CF,DRG)) G:DRG="" CFLP S LOC=^TMP("PSGWHV",$J,"VL",CF,DRG)
D:$Y+4>IOSL PRTCHK G:QFLG END W !,DRG,?44,$J($P(LOC,"^"),8,0),?63,$S($P(LOC,"^",2)'="NO DATA":$J($P(LOC,"^",2),10,2),1:"COST DATA MISSING") S CNT=CNT+1 G DRGLP
;
DONE I $E(IOST)'="C" W @IOF
I $E(IOST)="C" D:'QFLG SS^PSGWUTL1
;PSGW*2.3*21 add PSGWCNM to kill list
END K PSGWCNM,ALL,AOU,AOUCST,AOUQD,BDT,DRG,DRGCST,DRGDA,DRGNAME,DRGNM,DRGQD,EDT,INACTOT,INC,INVDA,INVDT,INVN,J,LOC,LOC1,LOC2,LOCSR,LOCWD,ODA,ODT,PGCT,PRCNT,PRCT,QD,RETDT,SRV,SRVDA,WARD,WDN,WRDA,WRDDA,X,Y
K ANS,QFLG,AOUN,CF,CNT,CST,CUT,DRN,DRUG,LOCN,QUAN,TOTCST,TOTQD,^TMP("PSGWHV",$J),PSGWIO,ZTSK,%,%I,%H,G,ZTIO,IO("Q") D ^%ZISC
S:$D(ZTQUEUED) ZTREQ="@" Q
;
HDR ;PRINT REPORT MAIN HEADER
W:$Y @IOF W !,"HIGH VOLUME REPORT AR/WS - ",$S(ALL=1:"FOR ALL AOUS",1:$P(^PSI(58.1,AOU,0),"^")),?70,"PAGE ",PGCT,!,"TOTAL QUANTITY DISPENSED GREATER THAN OR EQUAL TO ",CUT
W !,"FROM " S Y=BDT X ^DD("DD") W Y," TO " S Y=EDT X ^DD("DD") W Y
W !!?53,"DATE: ",$$PSGWDT^PSGWUTL1 S PGCT=PGCT+1
W !?5,"ITEM",?42,"QUANTITY DISPENSED",?66,"TOTAL COST",! F J=1:1:80 W "-"
Q
PRTCHK ;
I $E(IOST)="C" W !!,"Press <RETURN> to Continue or ""^"" to Exit: " R ANS:DTIME S:'$T ANS="^" D:ANS?1."?" HELP^PSGWUTL1 I ANS="^" S QFLG=1 Q
D HDR Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSGWHV1 1686 printed Nov 22, 2024@16:49:42 Page 2
PSGWHV1 ;BHAM ISC/PTD,CML-Print High Volume Report for Selected Date Range - CONTINUED ; 23 Mar 93 / 12:53 PM
+1 ;;2.3;Automatic Replenishment/Ward Stock ;**21**;4 JAN 94;Build 6
EN1 SET (CF,CNT)=0
SET PGCT=1
SET QFLG=""
DO HDR
IF '$DATA(^TMP("PSGWHV",$JOB,"VL"))
WRITE !!,"NO DATA AVAILABLE FOR SELECTED DATES."
GOTO DONE
CFLP SET CF=$ORDER(^TMP("PSGWHV",$JOB,"VL",CF))
SET DRG=0
IF 'CF
WRITE !!,"# of Items: ",CNT
GOTO DONE
DRGLP SET DRG=$ORDER(^TMP("PSGWHV",$JOB,"VL",CF,DRG))
if DRG=""
GOTO CFLP
SET LOC=^TMP("PSGWHV",$JOB,"VL",CF,DRG)
+1 if $Y+4>IOSL
DO PRTCHK
if QFLG
GOTO END
WRITE !,DRG,?44,$JUSTIFY($PIECE(LOC,"^"),8,0),?63,$SELECT($PIECE(LOC,"^",2)'="NO DATA":$JUSTIFY($PIECE(LOC,"^",2),10,2),1:"COST DATA MISSING")
SET CNT=CNT+1
GOTO DRGLP
+2 ;
DONE IF $EXTRACT(IOST)'="C"
WRITE @IOF
+1 IF $EXTRACT(IOST)="C"
if 'QFLG
DO SS^PSGWUTL1
+2 ;PSGW*2.3*21 add PSGWCNM to kill list
END KILL PSGWCNM,ALL,AOU,AOUCST,AOUQD,BDT,DRG,DRGCST,DRGDA,DRGNAME,DRGNM,DRGQD,EDT,INACTOT,INC,INVDA,INVDT,INVN,J,LOC,LOC1,LOC2,LOCSR,LOCWD,ODA,ODT,PGCT,PRCNT,PRCT,QD,RETDT,SRV,SRVDA,WARD,WDN,WRDA,WRDDA,X,Y
+1 KILL ANS,QFLG,AOUN,CF,CNT,CST,CUT,DRN,DRUG,LOCN,QUAN,TOTCST,TOTQD,^TMP("PSGWHV",$JOB),PSGWIO,ZTSK,%,%I,%H,G,ZTIO,IO("Q")
DO ^%ZISC
+2 if $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+3 ;
HDR ;PRINT REPORT MAIN HEADER
+1 if $Y
WRITE @IOF
WRITE !,"HIGH VOLUME REPORT AR/WS - ",$SELECT(ALL=1:"FOR ALL AOUS",1:$PIECE(^PSI(58.1,AOU,0),"^")),?70,"PAGE ",PGCT,!,"TOTAL QUANTITY DISPENSED GREATER THAN OR EQUAL TO ",CUT
+2 WRITE !,"FROM "
SET Y=BDT
XECUTE ^DD("DD")
WRITE Y," TO "
SET Y=EDT
XECUTE ^DD("DD")
WRITE Y
+3 WRITE !!?53,"DATE: ",$$PSGWDT^PSGWUTL1
SET PGCT=PGCT+1
+4 WRITE !?5,"ITEM",?42,"QUANTITY DISPENSED",?66,"TOTAL COST",!
FOR J=1:1:80
WRITE "-"
+5 QUIT
PRTCHK ;
+1 IF $EXTRACT(IOST)="C"
WRITE !!,"Press <RETURN> to Continue or ""^"" to Exit: "
READ ANS:DTIME
if '$TEST
SET ANS="^"
if ANS?1."?"
DO HELP^PSGWUTL1
IF ANS="^"
SET QFLG=1
QUIT
+2 DO HDR
QUIT