source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCST8.m@ 1133

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

initial load of WorldVistAEHR

File size: 1.2 KB
RevLine 
[613]1PSOCST8 ;BHAM ISC/SAB - DRUG COSTS BY DIVISION ; 08/19/92 9:03
2 ;;7.0;OUTPATIENT PHARMACY;**31**;DEC 1997
3 ;External Ref. to ^PS(59, is supp. by DBIA# 212
4BEG S RP=8 D HDC^PSOCSTX F D CDT^PSOCSTX Q:$G(CTR) D DVS^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 DIVISION",ZTRTN="START^PSOCST8" 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:"DIV")
10 D ZER^PSOCSTX S DIVX="" D HD I $O(^TMP($J,DIVX))']"" D HDN^PSOCSTX Q
11 F I=0:0 S DIVX=$O(^TMP($J,DIVX)) Q:DIVX="" D HD:($Y+4)>IOSL Q:$G(CTR) S Y=^TMP($J,DIVX),TTX=DIVX D PRT^PSOCSTX
12 I 'CTR,'IFN D HD:($Y+2)>IOSL D FTX^PSOCSTX
13EX D EX^PSOCSTX Q
14PAT F DIV=0:0 S DIV=$O(^PSCST(PSDT,"V",DIV)) Q:'DIV D DIV
15 Q
16DIV I $D(^PSCST(PSDT,"V",DIV,0)) S X=^(0) D STORE
17 Q
18STORE Q:'$D(^PS(59,DIV,0)) S DIVX=$P(^(0),"^") S:'$D(^TMP($J,DIVX)) ^TMP($J,DIVX)="^0^0^0"
19 S UTL=^TMP($J,DIVX),^TMP($J,DIVX)="^"_($P(UTL,"^",2)+$P(X,"^",2))_"^"_($P(UTL,"^",3)+$P(X,"^",3))_"^"_($P(UTL,"^",4)+$P(X,"^",4))
20 Q
21HD D HD^PSOCSTX Q
Note: See TracBrowser for help on using the repository browser.