source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCST6.m@ 1305

Last change on this file since 1305 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1PSOCST6 ;BHAM ISC/SAB - DRUG COSTS BY PATIENT STATUS ; 08/19/92 9:01
2 ;;7.0;OUTPATIENT PHARMACY;**31**;DEC 1997
3 ;External Ref. to ^PS(53, is supp. by DBIA# 1975
4BEG 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
5 D EX Q
6DEV D DVC^PSOCSTX Q:$G(CTR)
7 K PSOION I $D(IO("Q")) S ZTDESC="DRUG COST BY PATIENT STATUS",ZTRTN="START^PSOCST6" D PAS^PSOCSTX
8 I K IO("Q") D ^%ZTLOAD W:$D(ZTSK) !,"REPORT QUEUED TO PRINT !!",! D EX Q
9START 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")
10 D ZER^PSOCSTX S STAX="" D HD I $O(^TMP($J,STAX))']"" D HDN^PSOCSTX Q
11 F I=0:0 S STAX=$O(^TMP($J,STAX)) Q:STAX="" D HD:($Y+4)>IOSL Q:$G(CTR) D
12 .S Y=^TMP($J,STAX),TTX=STAX D PRT^PSOCSTX
13 I 'CTR,'IFN D HD:($Y+2)>IOSL D FTX^PSOCSTX
14EX D EX^PSOCSTX Q
15PAT F STA=0:0 S STA=$O(^PSCST(PSDT,"PS",STA)) Q:'STA D STA
16 Q
17STA I $D(^PSCST(PSDT,"PS",STA,0)) S X=^(0) D STORE
18 Q
19STORE Q:'$D(^PS(53,STA,0)) S STAX=$P(^(0),"^") S:'$D(^TMP($J,STAX)) ^TMP($J,STAX)="^0^0^0"
20 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))
21 Q
22HD D HD^PSOCSTX Q
Note: See TracBrowser for help on using the repository browser.