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

PSOCST6.m

Go to the documentation of this file.
PSOCST6 ;BHAM ISC/SAB - DRUG COSTS BY PATIENT STATUS ; 08/19/92 9:01
 ;;7.0;OUTPATIENT PHARMACY;**31**;DEC 1997
 ;External Ref. to ^PS(53, is supp. by DBIA# 1975
BEG S RP=6 D HDC^PSOCSTX F  D CDT^PSOCSTX Q:$G(CTR)  D PTS^PSOCSTX Q:$G(CTR)  S RP=0 D CTP^PSOCSTX Q:$G(CTR)  I RP=0 D DEV Q
 D EX Q
DEV D DVC^PSOCSTX Q:$G(CTR)
 K PSOION I $D(IO("Q")) S ZTDESC="DRUG COST BY PATIENT STATUS",ZTRTN="START^PSOCST6" 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:"PAT",1:"STA")
 D ZER^PSOCSTX S STAX="" D HD I $O(^TMP($J,STAX))']"" D HDN^PSOCSTX Q
 F I=0:0 S STAX=$O(^TMP($J,STAX)) Q:STAX=""  D HD:($Y+4)>IOSL Q:$G(CTR)  D
 .S Y=^TMP($J,STAX),TTX=STAX D PRT^PSOCSTX
 I 'CTR,'IFN D HD:($Y+2)>IOSL D FTX^PSOCSTX
EX D EX^PSOCSTX Q
PAT F STA=0:0 S STA=$O(^PSCST(PSDT,"PS",STA)) Q:'STA  D STA
 Q
STA I $D(^PSCST(PSDT,"PS",STA,0)) S X=^(0) D STORE
 Q
STORE Q:'$D(^PS(53,STA,0))  S STAX=$P(^(0),"^") S:'$D(^TMP($J,STAX)) ^TMP($J,STAX)="^0^0^0"
 S UTL=^TMP($J,STAX),^TMP($J,STAX)="^"_($P(UTL,"^",2)+$P(X,"^",2))_"^"_($P(UTL,"^",3)+$P(X,"^",3))_"^"_($P(UTL,"^",4)+$P(X,"^",4))
 Q
HD D HD^PSOCSTX Q