source: WorldVistAEHR/trunk/r/CONTROLLED_SUBSTANCES-PSD/PSDPAT2.m@ 1166

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

initial load of WorldVistAEHR

File size: 871 bytes
Line 
1PSDPAT2 ;B'ham ISC/JPW - Print Patient/Drug Report (summary) ; 1 Feb 94
2 ;;3.0; CONTROLLED SUBSTANCES ;;13 Feb 97
3 D NOW^%DTC S Y=+$E(%,1,12) X ^DD("DD") S RPDT=Y
4 S (PG,PSDOUT)=0,$P(LN,"-",80)=""
5 I '$D(^TMP("PSDPATL",$J)) D HDR W !!,?45,"**** NO DISPENSING SUMMARY ****" Q
6PRINT ;prints data for dispensing
7 D HDR Q:PSDOUT
8 S LOOP="" F S LOOP=$O(^TMP("PSDPATL",$J,LOOP)) Q:LOOP=""!(PSDOUT) D:$Y+4>IOSL HDR Q:PSDOUT D Q:PSDOUT
9 .W !,LOOP,?55,$J(+$P(^TMP("PSDPATL",$J,LOOP),"^",3),6),?70,$J(+$P(^(LOOP),"^",2),6),!
10DONE I SUM,$E(IOST)'="C" W @IOF
11 Q
12HDR ;lists header information
13 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
14 W:$Y @IOF S PG=PG+1 W !,?22,"ACTIVITY",?70,"PG "_PG,!,?29,"** SUMMARY **",!,?27,"Date: ",$P(PSDATE,"^")," to ",$P(PSDATE,"^",2),!!,"NAOU: ",NAOUN,!!
15 W "DRUG",?55,"QUANTITY USED",?70,"BALANCE",!,LN,!
16 Q
Note: See TracBrowser for help on using the repository browser.