source: WorldVistAEHR/trunk/r/AUTO_REPLENISHMENT_WARD_STOCK-PSGW/PSGWADP1.m@ 1361

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

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1PSGWADP1 ;BHAM ISC/PTD,CML-Print Data for AMIS Stats - CONTINUED ; 30 Aug 93 / 10:13 AM
2 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
3PRINT S PSGWPG=1,OUT=0 D HDR G:OUT END
4 F PSGWTY=0:0 Q:OUT S PSGWTY=$O(^TMP("PSGWADP",$J,PSGWTY)),PSGWNM=0 G:PSGWTY=9999 ONDM G:'PSGWTY DONE D:$Y+5>IOSL HDR I 'OUT D WRTYPE F J=0:0 S PSGWNM=$O(^TMP("PSGWADP",$J,PSGWTY,PSGWNM)) Q:PSGWNM=""!(OUT) D
5 .D:$Y+5>IOSL HDR I 'OUT W !!?5,PSGWNM D WRTDATA
6 ;
7ONDM I 'OUT S PSGWNM=0 D:$Y+5>IOSL HDR I 'OUT D WRTYPE F J=0:0 S PSGWNM=$O(^TMP("PSGWADP",$J,9999,PSGWNM)) Q:PSGWNM=""!(OUT) I '$D(^TMP("PSGWADP",$J,"DN",PSGWNM)) D:$Y+5>IOSL HDR I 'OUT W !!?5,PSGWNM D WRTDATA
8 ;
9DONE I $E(IOST)'="C" W @IOF
10 I $E(IOST)="C"&('OUT) W !!,"Press RETURN to continue: " R AUTO:DTIME
11END K ^TMP("PSGWADP",$J),I,J,K,PSGWAOU,PSGWDR,PSGWITM,PSGWNM,PSGWTY,PSGWPG,LOC,LOC1,LOC2,OUPTR,OUNIT,PSGWIO,ZTSK,PSGWDT,%,%I,%H,DA,ZTIO,%DT,IO("Q"),X,Y,AUTO,OUT
12 D ^%ZISC
13 S:$D(ZTQUEUED) ZTREQ="@" Q
14 ;
15HDR ;PRINT REPORT HEADING
16 I $E(IOST)="C"&(PSGWPG>1) S DIR(0)="E" D ^DIR K DIR I Y'=1 S OUT=1 Q
17 W:$Y @IOF S %DT="",X="T" D ^%DT X ^DD("DD") W !!,"PAGE: ",PSGWPG,?110,"DATE: ",Y,!?50,"DATA FOR AR/WS AMIS STATS",!!,"TYPE",?47,"ORDER",?59,"PRICE PER",?73,"DISPENSE UNITS",?90,"PRICE PER",?105,"AMIS",?120,"AMIS CONV.",!
18 W ?5,"DRUG NAME",?47,"UNIT",?59,"ORDER UNIT",?73,"PER ORDER UNIT",?90,"DISPENSE UNIT",?105,"CATEGORY",?120,"NUMBER",!
19 F J=1:1:132 W "="
20 S PSGWPG=PSGWPG+1
21 Q
22 ;
23WRTYPE W !!,$S((PSGWTY'=9999)&($D(^PSI(58.16,PSGWTY,0))):$P(^PSI(58.16,PSGWTY,0),"^"),1:"** UNCLASSIFIED BY TYPE: ") Q
24 ;
25WRTDATA S LOC=^TMP("PSGWADP",$J,PSGWTY,PSGWNM) F J=1:1:6 I $P(LOC,"^",J)="" S $P(LOC,"^",J)="NO DATA"
26 W ?47,$P(LOC,"^"),?61,$P(LOC,"^",2),?75,$P(LOC,"^",3),?90,$P(LOC,"^",4),?105,$P(LOC,"^",5),?120,$P(LOC,"^",6)
27 Q
Note: See TracBrowser for help on using the repository browser.