source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDREPV.m@ 703

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1PSDREPV ;BIR/LTL-Review PV 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 N C,D,DIC,DIR,DIRUT,DTOUT,DUOUT,PSD,PSDL,PSDEV,PSDOUT,X,Y
8 D DT^DICRW
9 S DIR(0)="Y",DIR("A")="Would you like to select a date range"
10 S DIR("B")="No",DIR("?")="If you select a date range, I'll show all invoices for that range." D ^DIR K DIR G:Y<0 END G:Y ^PSDREPD
11 S DIC="^PSD(58.81,",DIC(0)="AEQ",D="PV",DIC("A")="Please select Prime Vendor Invoice number: " W ! D IX^DIC K DIC S PSD=+Y,PSD(2)=$P($G(^PSD(58.81,+Y,8)),U) I Y<0 S PSDOUT=1 G END
12 I PSD(2)']"" W !!,"No Prime Vendor Invoice for this transaction." S PSDOUT=1 G END
13DEV ;(PSD*3*18) Changed %ZIS( call to fileman - SQA.
14 ;S PSDEV=$P($G(^%ZIS(1,+$P($G(^PSD(58.8,+$S($G(PSDLOC):PSDLOC,1:$P($G(^PSD(58.81,+Y,0)),U,3)),2)),U,9),0)),U)
15 S X="`"_+$P($G(^PSD(58.8,+$S($G(PSDLOC):PSDLOC,1:$P($G(^PSD(58.81,+Y,0)),"^",3)),2)),U,9)
16 S DIC=3.5,DIC(0)="" D ^DIC S PSDEV=$P($G(Y),"^",2) ; IA # 10114
17 ;asks device and queueing info
18 K IO("Q") N %ZIS,IOP,POP S %ZIS="Q",%ZIS("B")=PSDEV D ^%ZIS I POP W !,"NO DEVICE SELECTED OR OUTPUT PRINTED!" S PSDOUT=1 G END
19 I $D(IO("Q")) N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTDTH,ZTSK S ZTRTN="START^PSDREPV",ZTDESC="Invoice receipt review",ZTSAVE("PSD*")="" D ^%ZTLOAD,HOME^%ZIS S PSDOUT=1 G END
20START ;compiles and prints output
21 N %DT,LN,PG,RPDT S (PG,PSDOUT,PSD(1))=0,Y=DT X ^DD("DD") S RPDT=Y
22 D HEADER
23LOOP F S PSD(1)=$O(^PSD(58.81,"PV",PSD(2),PSD(1))) Q:'PSD(1) G:$G(PSDOUT) END D:$Y+5>IOSL HEADER G:PSDOUT END S PSD(3)=$G(^PSD(58.81,+PSD(1),0)) D
24 .I '$G(PSDLOC) S PSDLOC=$P(PSD(3),U,3) W !,"Receiving Site: ",$P($G(^PSD(58.8,+PSDLOC,0)),U),!
25 .I $G(PSDLOC)'=$P(PSD(3),U,3),$P(PSD(3),U,3) S PSDL(PSD(1))=PSD(3) Q
26 .S Y=+$E($P(PSD(3),U,4),1,12) X ^DD("DD") W !,Y," "
27 .W $E($P($G(^PSDRUG(+$P(PSD(3),U,5),0)),U),1,25)," -> "
28 .W $P(PSD(3),U,6)," rec'd by "
29 .W $E($P($G(^VA(200,+$P(PSD(3),U,7),0)),U),1,20),!
30 W:$O(PSDL(0)) !,"Receiving Site: ",$P($G(^PSD(58.8,+$P(PSD(3),U,3),0)),U),!
31 F S PSD(1)=$O(PSDL(PSD(1))) Q:'PSD(1) D:$Y+5>IOSL HEADER Q:PSDOUT D
32 .S PSD(3)=$G(PSDL(PSD(1)))
33 .S Y=$E($P(PSD(3),U,4),1,12) X ^DD("DD") W !,Y," "
34 .W $E($P($G(^PSDRUG(+$P(PSD(3),U,5),0)),U),1,25)," -> "
35 .W $P(PSD(3),U,6)," rec'd by "
36 .W $E($P($G(^VA(200,+$P(PSD(3),U,7),0)),U),1,20),!
37END W:$E(IOST)'="C" @IOF
38 I $E(IOST)="C",'$G(PSDOUT) S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu. " D ^DIR
39 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@" K IO("Q")
40 Q
41HEADER ;prints header info
42 I $E(IOST,1,2)'="P-",PG S DIR(0)="E" D ^DIR K DIR I 'Y S PSDOUT=1 Q
43 I $$S^%ZTLOAD W !!,"Task #",$G(ZTSK),", ",$G(ZTDESC)," was stopped by ",$P($G(^VA(200,+$G(DUZ),0)),U),"." S PSDOUT=1 Q
44 W:$Y @IOF S $P(LN,"-",81)="",PG=PG+1 W !,"History of receipts for Invoice # ",PSD(2),?57,RPDT,?70,"PAGE: ",PG,!,LN,!
Note: See TracBrowser for help on using the repository browser.