source: FOIAVistA/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDOPTY.m@ 1800

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1PSDOPTY ;BIR/LTL-Review OP Transactions by Rx # ; 21 July 94
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3 S PSDRX=PSDRX(4)-1,PSDT(1)=0
4LOOP F S PSDRX=$O(^PSD(58.81,"AOP",PSDRX)) W:$E(IOST)="C" "." Q:'PSDRX!(PSDRX>PSDRX(2))!(PSDOUT) S PSDRX(5)=0 F S PSDRX(5)=$O(^PSD(58.81,"AOP",PSDRX,PSDRX(5))) Q:'PSDRX(5) D Q:PSDOUT
5 .S PSDR(2)=$G(^PSD(58.81,PSDRX(5),0))
6 .Q:$P(PSDR(2),U,3)'=PSDLOC
7 .S PSDU=$P($G(^PSDRUG(+$P(PSDR(2),U,5),0)),U)
8 .S PSDR(4)=$G(^PSD(58.81,PSDRX(5),6))
9 .D:$Y+6>IOSL HEADER Q:PSDOUT
10 .W !,PSDU
11 .W:$P(PSDR(4),U,6)&($P(PSDR(2),U,7)'=$P(PSDR(4),U,6)) ?54,"RPH=> ",$E($P($G(^VA(200,+$P(PSDR(4),U,6),0)),U),1,20)
12 .S Y=$E($P(PSDR(2),U,4),1,12) X ^DD("DD") W !!,Y,?19
13 .S DFN=$P($G(^PSRX(+$P(PSDR(4),U),0)),U,2)
14 .N C S Y=DFN,C=$P(^DD(58.81,73,0),U,2) D Y^DIQ
15 .W $P(PSDR(4),U,5),?28,Y
16 .D PID^VADPT6 W " ("_VA("BID")_")",?60
17 .I $P(PSDR(4),U,2) S Y=$P($G(^PSRX(+$P(PSDR(4),U),1,+$P(PSDR(4),U,2),0)),U,18) X ^DD("DD") W Y
18 .I $P(PSDR(4),U,4) S Y=$P($G(^PSRX(+$P(PSDR(4),U),"P",+$P(PSDR(4),U,4),0)),U,19) X ^DD("DD") W Y
19 .I '$P(PSDR(4),U,2)&('$P(PSDR(4),U,4)) S Y=$P($G(^PSRX(+$P(PSDR(4),U),2)),U,13) X ^DD("DD") W Y
20 .W !,"Qty: ",$P(PSDR(2),U,6)," Bal: ",$P(PSDR(2),U,10)-$P(PSDR(2),U,6),?22,"RPH=> ",$P($G(^VA(200,+$P(PSDR(2),U,7),0)),U),?60
21 .W $S($P(PSDR(4),U,2):"Refill #"_$P(PSDR(4),U,2),$P(PSDR(4),U,4):"Partial #"_$P(PSDR(4),U,4),1:"Original")
22 .W !,LN,!
23END W:$E(IOST)'="C" @IOF
24 I $E(IOST)="C",'PSDOUT S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu." D ^DIR
25 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
26 D KVAR^VADPT K IO("Q"),VA("PID"),VA("BID"),^TMP("PSD",$J)
27 Q
28HEADER ;prints header info
29 I $E(IOST,1,2)'="P-",PG S DIR(0)="E" D ^DIR K DIR I 'Y S PSDOUT=1 Q
30 I $$S^%ZTLOAD W !!,"Task #",$G(ZTSK),", ",$G(ZTDESC)," was stopped by ",$P($G(^VA(200,+$G(DUZ),0)),U),"." S PSDOUT=1
31 W:$Y @IOF S $P(LN,"-",81)="",PG=PG+1 W !,"Outpatient Activity from Rx # ",PSDRX(1)," to Rx # ",PSDRX(3),?70,"PAGE: ",PG,!,LN,!,"Date Posted",?19,"Rx#",?28,"Patient",?60,"Date Released",!,LN
Note: See TracBrowser for help on using the repository browser.