[613] | 1 | PSXCSDC2 ;BIR/JMB-Drug Cost by Drug Report-CONTINUED ;[ 04/08/97 2:06 PM ]
|
---|
| 2 | ;;2.0;CMOP;;11 Apr 97
|
---|
| 3 | SUBDV ;Division total line
|
---|
| 4 | W !,PSXSLN,!,"DIVISION TOTAL",?PSXT1,$J($P(PSXSUB(PSXDV),"^"),6),?PSXT2,$J($P(PSXSUB(PSXDV),"^",2),6),?PSXT3,$J($P(PSXSUB(PSXDV),"^",3),6),?PSXT4,$J($P(PSXSUB(PSXDV),"^",4),10,2),?PSXT5
|
---|
| 5 | S PSXAVG=$S($P(PSXSUB(PSXDV),"^",3)=0:0,1:$P(PSXSUB(PSXDV),"^",4)/$P(PSXSUB(PSXDV),"^",3)) W $J(PSXAVG,10,2)
|
---|
| 6 | S PSXAVCST=$P(PSXSUB(PSXDV),"^",4)/$P(PSXSUB(PSXDV),"^",5) W ?PSXT6,$J(PSXAVCST,8,3)
|
---|
| 7 | Q
|
---|
| 8 | SUB ;Facility total line
|
---|
| 9 | Q:+$G(PSXSPDV) S PSXTOT=1 D:'$D(PSXID) HD^PSXCSDC1 S PSXTOT="0^0^0^0^0^",PSXX="" F S PSXX=$O(PSXSUB(PSXX)) Q:PSXX="" D
|
---|
| 10 | .S $P(PSXTOT,"^")=$P(PSXTOT,"^")+$P(PSXSUB(PSXX),"^"),$P(PSXTOT,"^",2)=$P(PSXTOT,"^",2)+$P(PSXSUB(PSXX),"^",2),$P(PSXTOT,"^",3)=$P(PSXTOT,"^",3)+$P(PSXSUB(PSXX),"^",3),$P(PSXTOT,"^",4)=$P(PSXTOT,"^",4)+$P(PSXSUB(PSXX),"^",4)
|
---|
| 11 | .S $P(PSXTOT,"^",5)=$P(PSXTOT,"^",5)+$P(PSXSUB(PSXX),"^",5)
|
---|
| 12 | .W:'$D(PSXID) !,PSXX,?PSXT1,$J($P(PSXSUB(PSXX),"^"),6),?PSXT2,$J($P(PSXSUB(PSXX),"^",2),6),?PSXT3,$J($P(PSXSUB(PSXX),"^",3),6),?PSXT4,$J($P(PSXSUB(PSXX),"^",4),10,2),?PSXT5
|
---|
| 13 | .I '$D(PSXID) S PSXAVG=$S($P(PSXSUB(PSXX),"^",3)=0:0,1:$P(PSXSUB(PSXX),"^",4)/$P(PSXSUB(PSXX),"^",3)) W $J(PSXAVG,10,2)
|
---|
| 14 | .I '$D(PSXID) S PSXAVCST=$P(PSXSUB(PSXX),"^",4)/$P(PSXSUB(PSXX),"^",5) W ?PSXT6,$J(PSXAVCST,8,3) K PSXAVCST
|
---|
| 15 | W !,PSXSLN,!,"FACILITY TOTAL",?PSXT1,$J($P(PSXTOT,"^"),6),?PSXT2,$J($P(PSXTOT,"^",2),6)
|
---|
| 16 | W ?PSXT3,$J($P(PSXTOT,"^",3),6),?PSXT4,$J($P(PSXTOT,"^",4),10,2),?PSXT5 S PSXAVG=$S($P(PSXTOT,"^",3)=0:0,1:$P(PSXTOT,"^",4)/$P(PSXTOT,"^",3)) W $J(PSXAVG,10,2)
|
---|
| 17 | S PSXAVCST=$P(PSXTOT,"^",4)/$P(PSXTOT,"^",5) W ?PSXT6,$J(PSXAVCST,8,3)
|
---|
| 18 | Q
|
---|