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

PSOCST11.m

Go to the documentation of this file.
PSOCST11 ;BHAM ISC/SAB - DRUG COSTS BY CLINIC ; 12/22/92 15:58
 ;;7.0;OUTPATIENT PHARMACY;**10,31**;DEC 1997
BEG S RP=11 D HDC^PSOCSTX F  D CDT^PSOCSTX Q:$G(CTR)  D CLN Q:$G(CTR)  S RP=0 D CTP^PSOCSTX Q:$G(CTR)  I RP=0 D DEV Q
 D EX Q
CLN D CMC^PSOCSTX Q:$G(CTR)
 I IFN S DIC(0)="AEQM",DIC="^SC(",DIC("A")="Select Clinic: " D ^DIC K DIC S:Y<0 CTR=1 Q:$G(CTR)  S IFN=1,CLA=+Y
 Q
DEV D DVC^PSOCSTX Q:$G(CTR)
 K PSOION I $D(IO("Q")) S ZTDESC="DRUG COST BY CLINIC",ZTRTN="START^PSOCST11" D PAS^PSOCSTX
 I  K IO("Q") D ^%ZTLOAD W:$D(ZTSK) !,"REPORT QUEUED TO PRINT !!",! D EX Q
START U IO K ^TMP($J) F PSDT=(BEGDATE-1):0:ENDDATE S PSDT=$O(^PSCST(PSDT)) Q:'PSDT!(PSDT>ENDDATE)  D @$S('IFN:"ACL",1:"SCL")
 D ZER^PSOCSTX S CLAX="" D HD I $O(^TMP($J,CLAX))']"" D HDN^PSOCSTX Q
 F  S CLAX=$O(^TMP($J,CLAX)) Q:CLAX=""  D HD:($Y+4)>IOSL Q:$G(CTR)  S Y=^TMP($J,CLAX),TTX=CLAX D PRT^PSOCSTX
 D HD:($Y+2)>IOSL D FTX^PSOCSTX
EX D EX^PSOCSTX Q
ACL F CLA=0:0 S CLA=$O(^PSCST(PSDT,"S",CLA)) Q:'CLA  D SCL
 Q
SCL I $D(^PSCST(PSDT,"S",CLA,0)) S X=^(0) D STORE
 Q
STORE Q:'$D(^SC(CLA,0))  S CLAX=$P(^(0),"^") S:'$D(^TMP($J,CLAX)) ^TMP($J,CLAX)="^0^0^0" S UTL=^(CLAX),^TMP($J,CLAX)="^"_($P(UTL,"^",2)+$P(X,"^",2))_"^"_($P(UTL,"^",3)+$P(X,"^",3))_"^"_($P(UTL,"^",4)+$P(X,"^",4))
 Q
HD D HD^PSOCSTX Q