source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDNU3.m@ 1639

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

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1PSDNU3 ;BIR/JPW-Print NAOU Usage Report Summary Totals ; 2 Aug 94
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3PRINT ;prints data for stock drugs
4 K LN S $P(LN,"-",80)="",(PG,PSDOUT)=0,%DT="",X="T" D ^%DT X ^DD("DD") S RPDT=Y
5 I '$D(^TMP("PSDNU",$J)) D HDR W !!,?10,"***** NO DATA AVAILABLE FOR THIS REPORT *****" Q
6 S JJ="" F S JJ=$O(^TMP("PSDNUS",$J,JJ)) Q:JJ=""!(PSDOUT) D HDR S KK="" F S KK=$O(^TMP("PSDNUS",$J,JJ,KK)) D:KK="" NTOT Q:KK=""!(PSDOUT) D TOT
7 Q
8HDR ;lists header information
9 I $E(IOST,1,2)="C-",PG K DA,DIR S DIR(0)="E" D ^DIR K DIR I 'Y S PSDOUT=1 Q
10 W:$Y @IOF S PG=PG+1 W !,"SUMMARY NAOU/DRUG USAGE REPORT - DATE: "_RPDT,?70,"PAGE: ",PG,!
11 I ANS="N",$D(JJ) W "NAOU: ",JJ,!
12 I ANS="D",$D(JJ) W "DRUG: ",JJ,!
13 W "From ",$P(PSDATE,"^")," to ",$P(PSDATE,"^",2),!!
14 W !,?2,"=> ",$S(ANS="D":"NAOU",1:"DRUG"),!,"TOTAL # OF ORDERS",?30,"TOTAL QUANTITY",!,LN,!
15 Q
16TOT Q:PSDOUT I $Y+8>IOSL D HDR
17 W !!,?2,"=> ",KK,!,$J(^TMP("PSDNUS",$J,JJ,KK),8),?34,$J(^TMP("PSDNUQ",$J,JJ,KK),6)
18 Q
19NTOT Q:PSDOUT I $Y+6>IOSL D HDR
20 W !!,?2,"=> ",KK
21 W !!,$S(ANS="D":"DRUG",1:"NAOU")," Subtotal # of Orders: ",^TMP("PSDNUT",$J,JJ) W:ANS="D" " Total Quantity: ",^TMP("PSDNUQT",$J,JJ)
22 W !!,"Grand Total # of Orders: ",^TMP("PSDNUG",$J),!
23 Q
Note: See TracBrowser for help on using the repository browser.