source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDREV.m@ 1375

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1PSDREV ;BIR/LTL-Review Receipt Transactions ; 29 Aug 94
2 ;;3.0; CONTROLLED SUBSTANCES ;**18**;13 Feb 97
3 ;
4 ;References to ^PSD(58.8, covered by DBIA2711
5 ;References to ^PSD(58.81 are covered by DBIA2808
6 ;References to ^PSDRUG( are covered by DBIA221
7 ;References to ^PRC(442 are covered by DBIA#682
8 N C,DIC,DIR,DTOUT,DUOUT,PSDEV,PSDLOC,PSDOUT,PSDPO,X,Y
9 S DIC="^PRC(442,",DIC(0)="AEMQZ",DIC("A")="Please Select Purchase Order Number: ",DIC("S")="I $P($G(^(0)),U,5)[822400",PSDOUT=1 D ^DIC K DIC G:$D(DTOUT)!($D(DUOUT))!(Y<1) END S PSDPO=+Y
10 I '$O(^PSD(58.81,"C",+Y,"")) W !!,"There have been no receipts for this Purchase Order.",!! G END
11DEV ;asks device and queueing info
12 S Y=$P($G(^PSD(58.8,+$P($G(^PSD(58.81,+$O(^PSD(58.81,"C",+Y,0)),0)),U,3),2)),U,9),C=$P(^DD(58.8,24,0),U,2) D Y^DIQ S PSDEV=Y
13 K IO("Q"),PSDLOC N %ZIS,IOP,POP S %ZIS="Q",%ZIS("B")=PSDEV D ^%ZIS I POP W !,"NO DEVICE SELECTED OR OUTPUT PRINTED!" Q
14 I $D(IO("Q")) N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTDTH,ZTSK S ZTRTN="START^PSDREV",ZTDESC="Receipt transaction review",ZTSAVE("PSDPO")="" D ^%ZTLOAD,HOME^%ZIS S PSDOUT=1 G END
15START ;compiles and prints output
16 N %DT,LN,PSDR,PG,RPDT S (PG,PSDOUT)=0,Y=DT,PSDR="" X ^DD("DD") S RPDT=Y D HEADER
17LOOP F S PSDR=$O(^PSD(58.81,"C",PSDPO,PSDR)) G:'PSDR END D:$Y+5>IOSL HEADER G:PSDOUT END D
18 .I '$D(PSDLOC) S PSDLOC=$P($G(^PSD(58.81,+PSDR,0)),U,3) W !,"Receiving Site: ",$P($G(^PSD(58.8,+PSDLOC,0)),U),!
19 .I $G(PSDLOC)'=$P($G(^PSD(58.81,+PSDR,0)),U,3) S PSDLOC=$P($G(^(0)),U,3) W !,"Receiving Site: ",$P($G(^PSD(58.8,+$P($G(^PSD(58.81,+PSDR,0)),U,3),0)),U),!
20 .S Y=$P($G(^PSD(58.81,+PSDR,0)),U,4) X ^DD("DD") W !,Y," ",$E($P($G(^PSDRUG(+$P($G(^PSD(58.81,PSDR,0)),U,5),0)),U),1,25)," -> "
21 .W $P($G(^PSD(58.81,+PSDR,0)),U,6)," rec'd by ",$E($P($G(^VA(200,+$P($G(^PSD(58.81,+PSDR,0)),U,7),0)),U),1,20),!
22END W:$E(IOST)'="C" @IOF
23 I $E(IOST)="C",'PSDOUT S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu." D ^DIR
24 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K IO("Q")
25 Q
26HEADER ;prints header info
27 I $E(IOST,1,2)'="P-",PG S DIR(0)="E" D ^DIR K DIR I 'Y S PSDOUT=1 Q
28 I $$S^%ZTLOAD W !!,"Task #",$G(ZTSK),", ",$G(ZTDESC)," was stopped by ",$P($G(^VA(200,+$G(DUZ),0)),U),"." S PSDOUT=1 Q
29 W:$Y @IOF S $P(LN,"-",81)="",PG=PG+1 W !?2,"History of receipts for P.O.# ",$P($G(^PRC(442,+PSDPO,0)),U),?50,RPDT,?70,"PAGE: ",PG,!,LN,!
Note: See TracBrowser for help on using the repository browser.