source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCST3.m@ 1764

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

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1PSOCST3 ;BHAM ISC/SAB - DRUG BY PROVIDER COST ; 10/01/92 16:30
2 ;;7.0;OUTPATIENT PHARMACY;**31**;DEC 1997
3 ;External Ref. to ^PSDRUG is supp. by DBIA# 221
4BEG S RP=3 D HDC^PSOCSTX F D CDT^PSOCSTX Q:$G(CTR) D DRS^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 COSTS BY PROVIDER",ZTRTN="START^PSOCST3" 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:"DRUG",1:"PHY")
10 D ZER^PSOCSTX S DRUGX="" D HD I $O(^TMP($J,DRUGX))']"" D HDN^PSOCSTX Q
11 F S DRUGX=$O(^TMP($J,DRUGX)) Q:DRUGX="" D:($Y+7)>IOSL HD Q:$G(CTR) W !,?5,"DRUG: "_DRUGX D
12 .S PHYX="" D:($Y+4)>IOSL HD Q:$G(CTR) F S PHYX=$O(^TMP($J,DRUGX,PHYX)) D:PHYX="" SUB Q:PHYX="" D PRT3
13 I 'IFN,'CTR D TOT^PSOCSTX
14EX D EX^PSOCSTX Q
15PRT3 D HD:($Y+4)>IOSL Q:$G(CTR)
16 S Y=^TMP($J,DRUGX,PHYX),TTX=PHYX D PRT^PSOCSTX Q
17DRUG F DRUG=0:0 S DRUG=$O(^PSCST(PSDT,"D",DRUG)) Q:'DRUG D PHY
18 Q
19PHY F PHY=0:0 S PHY=$O(^PSCST(PSDT,"D",DRUG,"P",PHY)) Q:'PHY I $D(^(PHY,0)) S X=^(0) D STORE
20 Q
21STORE S PHYX=$S($D(^VA(200,+PHY,0)):$P(^(0),"^"),1:"UNKNOWN")
22 Q:'$D(^PSDRUG(DRUG,0)) S DRUGX=$P(^(0),"^") S:'$D(^TMP($J,DRUGX,PHYX)) ^TMP($J,DRUGX,PHYX)="^0^0^0"
23 S UTL=^TMP($J,DRUGX,PHYX),^TMP($J,DRUGX,PHYX)="^"_($P(UTL,"^",2)+$P(X,"^",2))_"^"_($P(UTL,"^",3)+$P(X,"^",3))_"^"_($P(UTL,"^",4)+$P(X,"^",4))
24 Q
25HD D HD^PSOCSTX Q
26SUB D HD:($Y+2)>IOSL D FTU^PSOCSTX W !,"Total for ",$E(DRUGX,1,23) D FTT^PSOCSTX,FTU^PSOCSTX,SUB^PSOCSTX
27 Q
Note: See TracBrowser for help on using the repository browser.