source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDEM3.m@ 767

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

initial load of WorldVistAEHR

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