source: WorldVistAEHR/trunk/r/AUTO_REPLENISHMENT_WARD_STOCK-PSGW/PSGWATR1.m@ 1742

Last change on this file since 1742 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1PSGWATR1 ;BHAM ISC/CML-Print Item Activity Inquiry (80 column) ; 23 Mar 93 / 12:44 PM
2 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
3 S (PG,QFLG)=0,Y=BDT X ^DD("DD") S HBDT=Y,Y=EDT X ^DD("DD") S HEDT=Y S HDT=$$PSGWDT^PSGWUTL1,$P(LN,"-",80)="",DRGDA=+^PSI(58.1,AOU,1,ITEM,0),$P(LN2,"-",65)="" D INV I 'QFLG D OND I 'QFLG D RET
4DONE I $E(IOST)'="C" W @IOF
5 I $E(IOST)="C" D:'QFLG SS^PSGWUTL1
6QUIT K ^TMP("PSGWATR",$J) K ZTSK,%,%H,%I,%W,ADT,ANS,AOU,ARDT,BDT,C,DRGDA,EDT,HBDT,HDT,HEDT,INVDA,ITEM,LN,LN2,NODE,OD,ODDA,ODDT,PG,QD,QFLG,RET,RETDT,TYPE,X,Y,G,PSGWIO
7 D ^%ZISC
8 S:$D(ZTQUEUED) ZTREQ="@" Q
9INV ;PRINT INVENTORIES
10 D HDR,IHDR I '$O(^TMP("PSGWATR",$J,"AR",0)) W !?15,"** THERE IS NO INVENTORY DATA FOR THIS DATE RANGE **" Q
11 F ADT=0:0 S ADT=$O(^TMP("PSGWATR",$J,"AR",ADT)) Q:'ADT S NODE=^(ADT),QFLG=0 D:$Y+5>IOSL PRTCHK Q:QFLG D:$Y+5>IOSL HDR,IHDR W !?15,"ID #",+NODE," - " S Y=ADT X ^DD("DD") W Y,?60,$J($P(NODE,"^",2),7)
12 Q
13OND ;PRINT ON-DEMANDS
14 D PRTCHK Q:QFLG D HDR,OHDR I '$O(^TMP("PSGWATR",$J,"OD",0)) W !?15,"** THERE IS NO ON-DEMAND DATA FOR THIS DATE RANGE **" Q
15 F OD=0:0 S OD=$O(^TMP("PSGWATR",$J,"OD",OD)) Q:'OD S QD=+^(OD),QFLG=0 D:$Y+5>IOSL PRTCHK Q:QFLG D:$Y+5>IOSL HDR,OHDR S Y=OD X ^DD("DD") W !?17,Y,?60,$J(QD,7)
16 Q
17RET ;PRINT RETURNS
18 D PRTCHK Q:QFLG D HDR,RHDR I '$O(^TMP("PSGWATR",$J,"RET",0)) W !?15,"** THERE IS NO RETURNS DATA FOR THIS DATE RANGE **" Q
19 F RET=0:0 S RET=$O(^TMP("PSGWATR",$J,"RET",RET)) Q:'RET S QD=+^(RET),QFLG=0 D:$Y+5>IOSL PRTCHK Q:QFLG D:$Y+5>IOSL HDR,RHDR S Y=RET X ^DD("DD") W !?17,Y,?60,$J(QD,7)
20 Q
21HDR ;
22 S PG=PG+1 W:$Y @IOF W !,"ITEM ACTIVITY INQUIRY for period ",HBDT," to ",HEDT,?72,"Page: ",PG,!,"Printed ",HDT,!!,"AOU : ",$P(^PSI(58.1,AOU,0),"^"),!,"ITEM: ",$P(^PSDRUG(DRGDA,0),"^"),!,LN Q
23PRTCHK ;
24 I $E(IOST)="C" W !!,"Press <RETURN> to Continue or ""^"" to Exit: " R ANS:DTIME S:'$T ANS="^" D:ANS["?" HELP^PSGWUTL1 I ANS="^" S QFLG=1 Q
25 Q
26IHDR ;INVENTORY SUBHEADER
27 W !,"INVENTORIES:",!!?15,"ID # - DATE/TIME FOR INVENTORY",?55,"QUANTITY DISPENSED",!?15,LN2 Q
28OHDR ;ON-DEMAND HEADERS
29 W !,"ON-DEMAND REQUESTS:",!!?15,"ON-DEMAND REQUEST DATE/TIME",?55,"QUANTITY DISPENSED",!?15,LN2 Q
30RHDR ;RETURNS HEADER
31 W !,"RETURNS:",!!?15,"RETURN DATE/TIME",?55,"QUANTITY RETURNED",!?15,LN2 Q
Note: See TracBrowser for help on using the repository browser.