Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSXCSDC2

PSXCSDC2.m

Go to the documentation of this file.
PSXCSDC2 ;BIR/JMB-Drug Cost by Drug Report-CONTINUED ;[ 04/08/97   2:06 PM ]
 ;;2.0;CMOP;;11 Apr 97
SUBDV ;Division total line
 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
 S PSXAVG=$S($P(PSXSUB(PSXDV),"^",3)=0:0,1:$P(PSXSUB(PSXDV),"^",4)/$P(PSXSUB(PSXDV),"^",3)) W $J(PSXAVG,10,2)
 S PSXAVCST=$P(PSXSUB(PSXDV),"^",4)/$P(PSXSUB(PSXDV),"^",5) W ?PSXT6,$J(PSXAVCST,8,3)
 Q
SUB ;Facility total line
 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
 .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)
 .S $P(PSXTOT,"^",5)=$P(PSXTOT,"^",5)+$P(PSXSUB(PSXX),"^",5)
 .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
 .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)
 .I '$D(PSXID) S PSXAVCST=$P(PSXSUB(PSXX),"^",4)/$P(PSXSUB(PSXX),"^",5) W ?PSXT6,$J(PSXAVCST,8,3) K PSXAVCST
 W !,PSXSLN,!,"FACILITY TOTAL",?PSXT1,$J($P(PSXTOT,"^"),6),?PSXT2,$J($P(PSXTOT,"^",2),6)
 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)
 S PSXAVCST=$P(PSXTOT,"^",4)/$P(PSXTOT,"^",5) W ?PSXT6,$J(PSXAVCST,8,3)
 Q