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

PSXCSHI1.m

Go to the documentation of this file.
PSXCSHI1 ;BIR/JMB-High Cost Rx Report-CONTINUED ;[ 04/08/97   2:06 PM ]
 ;;2.0;CMOP;**38**;11 Apr 97
PRINT ;Loops thru ^TMP global
 F PSXFAC=0:0 S PSXFAC=+$O(^TMP($J,PSXFAC)) Q:'PSXFAC!($G(PSXEXIT))  D  Q:$G(PSXEXIT)  D HD:($Y+4)>IOSL Q:$G(PSXEXIT)  W !!,"No. of Fills="_PSXCNT,?20,"'*' indicates a refill"
 .D HD S PSXCNT=0,PSXDG="" F  S PSXDG=$O(^TMP($J,PSXFAC,PSXDG)) Q:PSXDG=""!($G(PSXEXIT))  S PSXRXN="" F  S PSXRXN=$O(^TMP($J,PSXFAC,PSXDG,PSXRXN)) Q:PSXRXN=""!($G(PSXEXIT))  D
 ..F PSXIEN=0:0 S PSXIEN=+$O(^TMP($J,PSXFAC,PSXDG,PSXRXN,PSXIEN)) Q:'PSXIEN!($G(PSXEXIT))  D
 ...S PSXCNT=PSXCNT+1 D HD:($Y+4)>IOSL Q:$G(PSXEXIT)
 ...W !,$S($P(^TMP($J,PSXFAC,PSXDG,PSXRXN,PSXIEN),"^"):"* ",1:"  ")_PSXRXN,?15,PSXDG,?50,$J($P(^(PSXIEN),"^",2),4),?55,"x",?57,$J($P(^(PSXIEN),"^",3),6,3),?65,"=",?66,$J($P(^(PSXIEN),"^",4),7,2)
 Q
HD I PSXPG>1,$E(IOST)="C" S DIR(0)="FO",DIR("A")=" Press Return to Continue or ^ to Exit " D ^DIR K DIR I $G(DTOUT)!($G(DUOUT)) S PSXEXIT=1 Q
 S PSXFACR="ALL FACILITIES"
 ;I $G(PSXFAC)'="" N X,Y S X=PSXFAC,DIC=4,DIC(0)="MNZ" S:$D(^PSX(552,"D",X)) X=$E(X,2,99) D ^DIC K DIC S PSXFACR=Y(0,0) K X,Y ;****DOD L1
 I $G(PSXFAC)'="" N X,Y S X=PSXFAC,AGNCY="VASTANUM" S:$D(^PSX(552,"D",X)) X=$E(X,2,99),AGNCY="DMIS" S Y=$$IEN^XUMF(4,AGNCY,X),PSXFACR=$$GET1^DIQ(4,Y,.01)
 W:PSXPG>1!($E(IOST)="C") @IOF W !,"PRINTED: ",PSXPDT,?(72-$L(PSXPG)),"PAGE ",PSXPG S PSXPG=PSXPG+1
 W !!?(60-$L(PSXFACR)/2),"HIGH COST REPORT FOR ",PSXFACR
 W !?8,"FILLS THAT COST AT LEAST $",PSXMAX," -- FROM ",PSXBDTR," TO ",PSXEDTR
 W !!,"  RX #",?15,"DRUG",?51,"QTY",?59,"COST",?67,"TOTAL COST"
 W ! F PSXI=1:1:79 W "-"
 Q