source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDPND1.m@ 1800

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1PSDPND1 ;BIR/JPW-Pharm Dispensing Report (cont'd) ; 2 Aug 94
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3PRINT ;print pharmacy disp log by date
4 I SUM S PG=0 D SUMPRT G DONE
5 S (PG,PSDOUT)=0
6 K LN S $P(LN,"-",132)="" I '$D(^TMP("PSDND",$J)) D HDR W !!,?45,"**** NO DISPENSING DATA FOR THIS DISPENSING LOCATION ****" G DONE
7 D HDR S NUM="" F S NUM=$O(^TMP("PSDND",$J,NUM)) Q:NUM=""!(PSDOUT) D:$Y+4>IOSL HDR Q:PSDOUT D
8 .F PSD=0:0 S PSD=$O(^TMP("PSDND",$J,NUM,PSD)) Q:'PSD!(PSDOUT) D:$Y+4>IOSL HDR Q:PSDOUT S NODE=^TMP("PSDND",$J,NUM,PSD) W !,NUM,?15,$P(NODE,"^"),?58,$J($P(NODE,"^",3),6),?68,$P(NODE,"^",4),?86,$P(NODE,"^",2),?112,$P(NODE,"^",5)
9 I $E(IOST,1,2)="C-",'PSDOUT W !!,"Press <RET> to return to display the summary totals" R X:DTIME
10 D:'PSDOUT SUMPRT
11DONE I $E(IOST)'="C" W @IOF
12 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
13 Q
14HDR ;header for log
15 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
16 S PG=PG+1 W:$Y @IOF W !,?45,"Pharmacy Dispensing Report",?115,"Page: ",PG,!,?45,"Dispensing Vault: "_PSDSN,!,?45,$P(PSDATE,"^")_" to "_$P(PSDATE,"^",2)
17 W !!,?58,"QUANTITY",?71,"DATE"
18 W !,"DISP #",?15,"DRUG",?58,"DISPENSED",?71,"DISP",?86,"DISPENSED TO",?112,"DISPENSED BY"
19 W !,LN,!
20 Q
21SUMPRT ;prt sum
22 K LN S (PG,PSDOUT)=0,$P(LN,"-",80)=""
23 I '$D(^TMP("PSDNDT",$J)) D SUMHDR W !!,?45,"**** NO DISPENSING DATA FOR THIS DISPENSING LOCATION ****" Q
24PRTSUM ;prints summary data
25 D SUMHDR Q:PSDOUT
26 S DRUG="" F S DRUG=$O(^TMP("PSDNDT",$J,DRUG)) Q:DRUG="" D:$Y+4>IOSL SUMHDR Q:PSDOUT W !,?2,DRUG,?60,$J(+^TMP("PSDNDT",$J,DRUG),6),!
27 Q
28SUMHDR ;sum header
29 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
30 W:$Y @IOF S PG=PG+1 W !,?25,"Pharmacy Dispensing Report",?70,"Page "_PG,!,?25,$P(PSDATE,"^")_" to "_$P(PSDATE,"^",2),!,?31,"** SUMMARY **",!!,"Dispensing Vault: ",PSDSN,!!
31 W ?5,"DRUG",?57,"TOTAL DISPENSED",!,LN,!
32 Q
Note: See TracBrowser for help on using the repository browser.