source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDRDR2.m@ 1384

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

initial load of WorldVistAEHR

File size: 2.5 KB
RevLine 
[613]1PSDRDR2 ;BIR/BJW-Narc Disp/Rec (reprint VA FORM 10-2321) (cont'd) ; 4 Aug 94
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3PRINT ;reprint log in lieu of VA FORM 10-2321
4 S COPY=1 D COPY Q:PSDOUT G:$D(FLAG) DONE
5 I PSDCPY="B" S COPY=2 D COPY
6DONE I $E(IOST)'="C" W @IOF
7 I $E(IOST,1,2)="C-",'PSDOUT W ! K DIR,DIRUT S DIR(0)="EA",DIR("A")="END OF REPORT! Press <RET> to return to the menu" D ^DIR K DIR
8END Q
9HDR ;header for log
10 I PG,$G(PSDCPY)="V"!($G(COPY)=2) W !,"* VERIFIED ORDER WAS EDITED."
11 I $E(IOST,1,2)="C-",PG W ! K DA,DIR S DIR(0)="E" D ^DIR K DIR I 'Y S PSDOUT=1 Q
12 S PG=PG+1 W:$Y @IOF W !,?55,"*** REPRINT ***",! I PSDCPY="V"!(COPY=2) W !,?50,"*** PHARMACY VAULT COPY ***",!,?42,"Technician Delivering Orders: ____________________",!
13 W !,?2,"VA FORM 10-2321",?42,"Narcotic Dispensing/Receiving Report" I NAOU]"",NAOU'=0 W " for ",NAOU
14 W ?120,"Page: ",PG,!,?52,RPDT,!
15 W !,?14,"DATE",?78,"DATE"
16 W !,"DISP #",?12,"DISPENSED",?24,"QTY",?33,"DRUG",?78,"ORD",?90,"ORDERED BY"
17 W !,LN,!!
18 Q
19COPY ;copy number
20 S (COMM,PG,PSDOUT,NAOU)=0 D NOW^%DTC S Y=+$E(%,1,12) X ^DD("DD") S RPDT=Y
21 K LN S $P(LN,"-",132)="" I '$D(^TMP("PSDRDR",$J)) D HDR W !!,?45,"**** NO PENDING NARCOTIC ORDERS TO BE DELIVERED ****" S FLAG=1 Q
22 S NAOU="" F S NAOU=$O(^TMP("PSDRDR",$J,NAOU)) Q:NAOU=""!(PSDOUT) D HDR Q:PSDOUT D Q:PSDOUT
23 .S NUM="" F S NUM=$O(^TMP("PSDRDR",$J,NAOU,NUM)) Q:NUM=""!(PSDOUT) D:$Y+12>IOSL HDR Q:PSDOUT S NODE=^TMP("PSDRDR",$J,NAOU,NUM) D
24 ..I $P(NODE,"^",9),$Y+12>IOSL D HDR Q:PSDOUT
25 ..NEW X S X=$P(NODE,"^",2) S X=$S(PSDCPY="V":X,COPY=2:X,1:+X)
26 ..W !,NUM,?12,$P(NODE,"^",3),?21,$J(X,6),?33,$P(NODE,"^"),?78,$P(NODE,"^",4),?90,$P(NODE,"^",5)
27 ..;;The next line added for E3R# 3311 2-9-95.
28 ..I PSDCPY="V"!(COPY=2) W !,?33,"BALANCE: "_$S(+$P(NODE,"^",13):+$P(NODE,"^",13),1:"UNKNOWN")_" "_$P(NODE,"^",14)
29 ..I $P(NODE,"^",6)]"" W !,?33,"Mfg/Lot #/Exp Date: ",$P(NODE,"^",6)_" "_$P(NODE,"^",7)_" "_$P(NODE,"^",8)
30 ..W !!,?7,"Disp by RPh:",$S($P(NODE,"^",11)]"":" "_$P(NODE,"^",11),1:"___________________________________")
31 ..W ?61,"Rec'd by Nurse:",$S($P(NODE,"^",12)]"":" "_$P(NODE,"^",12),1:"___________________________________")
32 ..W !,?19,"(Full Name)",?76,"(Full Name)",!
33 ..I $P(NODE,"^",9) W ?24,"COMMENTS:" S COMM=1,PSDA=$P(NODE,"^",10) K ^UTILITY($J,"W") F TEXT=0:0 S TEXT=$O(^PSD(58.81,PSDA,2,TEXT)) Q:'TEXT D:$Y+4>IOSL HDR Q:PSDOUT S X=$G(^PSD(58.81,PSDA,2,TEXT,0)),DIWL=34,DIWR=115,DIWF="W" D ^DIWP
34 ..I COMM D ^DIWW S COMM=0 W !
35 I PG,$G(PSDCPY)="V"!($G(COPY)=2) W !,"* VERIFIED ORDER WAS EDITED."
36 Q
Note: See TracBrowser for help on using the repository browser.