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

PSGWBOIP.m

Go to the documentation of this file.
PSGWBOIP ;BHAM ISC/CML-Print Backorder Report by Specific Item (Single or Multiple) - CONTINUED ; 03 Sep 93 / 12:25 PM
 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
PRT1 ;
 S $P(LN,"-",81)="",PG=0,%DT="",(DNM,ANM,QFLG)="" S HDT=$$PSGWDT^PSGWUTL1 D HDR
 I '$D(^TMP("PSGWBOI",$J)) W !?17,"***** NO DATA AVAILABLE FOR THIS REPORT *****" S QFLG=1 G DONE
 F LL=0:0 S TOT=0,DNM=$O(^TMP("PSGWBOI",$J,DNM)) Q:DNM=""  D:$Y+6>IOSL PRTCHK Q:QFLG  W !!,"=> ",DNM D PRT2 Q:QFLG
DONE ;
 D:'QFLG INACT I $E(IOST)'="C" W @IOF
 I $E(IOST)="C" D:'QFLG SS^PSGWUTL1
QUIT ;
 K %DT,%,%H,%I,BO,BODA,BODT,CURBO,DIC,DNM,DRGDA,ITMDA,JJ,LOC,TOT,AOU,ANM,HDT,INACT,LL,LN,LNS,QQ,PG,X,Y,ANS,QFLG
 K ^TMP("PSGWBOI",$J),^TMP("PSGWQ",$J),PSGWIO,ZTSK,ZTIO,DA,HDRFLG,IO("Q") D ^%ZISC
 Q
PRT2 F LL=0:0 S ANM=$O(^TMP("PSGWBOI",$J,DNM,ANM)) Q:QFLG  D ANMCHK Q:ANM=""  F BODT=0:0 S BODT=$O(^TMP("PSGWBOI",$J,DNM,ANM,BODT)) Q:'BODT  D DATA Q:QFLG
 Q
DATA ;DATA LINES
 S LOC=$P(^TMP("PSGWBOI",$J,DNM,ANM,BODT),"^"),CURBO=$P(^(BODT),"^",2),TOT=TOT+CURBO Q:CURBO<1  I $Y+6>IOSL D PRTCHK Q:QFLG
 S:ANM["**" INACT=1 S Y=$E(BODT,1,12) X ^DD("DD") W !?7,ANM,?40,LOC,?54,Y,?73,$J(CURBO,6)
 Q
ANMCHK ;
 I ANM="ZZZ" W ?48,"<NO CURRENT BACKORDERS>" S ANM="" Q
 I ANM="",TOT<1 W ?48,"<NO CURRENT BACKORDERS>" Q
 I ANM="" D:$Y+6>IOSL PRTCHK Q:QFLG  W !?72,"-------",!?66,"TOTAL:",?72,$J(TOT,7) Q
 Q
HDR ;HEADER
 S INACT=0 W:$Y @IOF S PG=PG+1 I HDRFLG="S" W !?24,"PHARMACY SINGLE ITEM BACKORDER LIST"
 I HDRFLG="M" W !?22,"PHARMACY MULTIPLE ITEMS BACKORDER LIST"
 W ?71,"PAGE: ",PG,!?28,"PRINTED: ",HDT,!!,"=> ITEM",?56,"DATE/TIME FOR",?72,"CURRENT",!?12,"AOU",?42,"LOCATION",?58,"BACKORDER",?71,"BACKORDER",!,LN
 Q
INACT I INACT F LNS=1:1:((IOSL-$Y)-3) W !
 I  W "** Indicates an Inactive AOU"
 Q
PRTCHK ;
 D INACT 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