source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPTODA2.m@ 1200

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1DGPTODA2 ;ALB/AS - PTF DRG ALOS REPORTS (CONT) ; 9/13/01 5:55pm
2 ;;5.3;Registration;**375**;Aug 13, 1993
3 F DRG=0:0 S:DRG>0&('$D(^UTILITY($J,"DGTC",DRG))) ^UTILITY($J,"DGTC",DRG,DGPAG)="" S DRG=$O(^UTILITY($J,"DGPTFR","D",DRG)) Q:DRG'>0 S Z=^(DRG) D LN
4 D WM Q
5LN I $Y>$S($D(IOSL):(IOSL-12),1:54) D HD^DGPTODA1
6 S (DGHI,DGLODC,DGLODAY,DG1DAY)=0,DGWU=$P(Z,"^",6),DGTD=$P(Z,"^",2),DGLOTRIM=$P(Z,"^",3),DGTL=$P(Z,"^"),DGTT(5)=DGTT(5)+DGTD,DGTT(6)=DGTT(6)+DGTL,(DGA,DGU)=""
7 W !,$J(DRG,3),$J(DGLOTRIM,5),$J($P(Z,"^",4),6),$J($P(Z,"^",5),9),$J(DGWU,9),$J($P(Z,"^",7),4) Q:DGRNO=3
8 S D5=0 I DGRNO=1 F D=0:0 S D5=$O(^UTILITY($J,"DGPTFR","D",DRG,D5)) Q:D5="" S %=^(D5) D AA:D5="AA",BA:D5="BA"
9 I $D(DGBNM) F D=0:0 S D5=$O(^UTILITY($J,"DGPTFR","SB",DGSV,DGBS,DRG,D5)) Q:D5="" S %=^(D5) D AA:D5="AA",BA:D5="BA"
10WLN W ?37,"|" W:DGU="B" $J(DGDU,6),$J(DGLU,8),$J(DGLU/DGDU,7,1)," |" W:DGU'="B" ?43,"0 0 0 |" W:DGA="A" $J(DGDA,6),$J(DGLA,8),?70,$J(DGLA/DGDA,7,1) W:DGA'="A" ?66,"0 0 0"
11 W ?83,"|",$J(DGTD,6),$J(DGTL,9),$J(DGTL/DGTD,7,1),?107,"|"
12 S DGTWW=$J((DGTD-DGLODC*DGWU)+(DG1DAY*DG1DAWW)+(DGHI*DGHIWW)+($S(DGLODAY>0&(DGLOTRIM>0):(DGLODAY/DGLOTRIM*DGWU),1:0)),0,5),DGTWW=$S(DGTWW'>0:DGWU,1:DGTWW),DGTT(7)=DGTT(7)+DGTWW W $J(DGTWW,9,2) Q
13 ;S X=DGTWW*DGWWCST,X2="2" D COMMA^%DTC W $J(X,13) Q
14AA S DGA="A",DGLA=$P(%,"^"),DGDA=$P(%,"^",2),DGHI=$P(%,"^",3),DGTT(3)=DGTT(3)+DGDA,DGTT(4)=DGTT(4)+DGLA Q:DGRNO=1 I '$D(^UTILITY($J,"DGLOS",DGSV,DRG,"AA")) S ^UTILITY($J,"DGLOS",DGSV,DRG,"AA")=% Q
15 S $P(^UTILITY($J,"DGLOS",DGSV,DRG,"AA"),"^")=$P(^UTILITY($J,"DGLOS",DGSV,DRG,"AA"),"^")+DGLA,$P(^("AA"),"^",2)=$P(^("AA"),"^",2)+DGDA,$P(^("AA"),"^",3)=$P(^("AA"),"^",3)+DGHI Q
16BA S DGU="B",DGLU=$P(%,"^"),DGDU=$P(%,"^",2),DG1DAY=DG1DAY+$P(%,"^",4),DGLODAY=$P(%,"^",5),DGLODC=$P(%,"^",6),DGTT(1)=DGTT(1)+DGDU,DGTT(2)=DGTT(2)+DGLU Q:DGRNO=1 I '$D(^UTILITY($J,"DGLOS",DGSV,DRG,"BA")) S ^UTILITY($J,"DGLOS",DGSV,DRG,"BA")=% Q
17 S $P(^UTILITY($J,"DGLOS",DGSV,DRG,"BA"),"^")=$P(^UTILITY($J,"DGLOS",DGSV,DRG,"BA"),"^")+DGLU,$P(^("BA"),"^",2)=$P(^("BA"),"^",2)+DGDU,$P(^("BA"),"^",4)=$P(^("BA"),"^",4)+DG1DAY
18 S $P(^UTILITY($J,"DGLOS",DGSV,DRG,"BA"),"^",5)=$P(^UTILITY($J,"DGLOS",DGSV,DRG,"BA"),"^",5)+DGLODAY,$P(^("BA"),"^",6)=$P(^("BA"),"^",6)+DGLODC Q
19PG S %=$S($D(IOSL):(IOSL-11),1:55) F I=$Y:1:% W !
20 D DIS^DGPTOD1 W !!?64,"-",DGPAG,"-",! Q
21SV F DGBS=0:0 D:DGBS>0 WB S DGBS=$O(^UTILITY($J,"DGPTFR","SB",DGSV,DGBS)) Q:DGBS'>0 S DGBNM=^(DGBS) D:$Y>$S($D(IOSL):(IOSL-14),1:52) HD^DGPTODA1 W !!,DGBNM F DRG=0:0 S DRG=$O(^UTILITY($J,"DGPTFR","SB",DGSV,DGBS,DRG)) Q:DRG'>0 S Z=^(DRG) D S,LN
22 Q
23S S:'$D(^UTILITY($J,"DGTC",DGBNM)) ^(DGBNM,DGPAG)="" I '$D(^UTILITY($J,"DGLOS",DGSV,DRG)) S ^UTILITY($J,"DGLOS",DGSV,DRG)=Z Q
24 F %=1:1:2 S $P(^UTILITY($J,"DGLOS",DGSV,DRG),"^",%)=$P(^UTILITY($J,"DGLOS",DGSV,DRG),"^",%)+$P(Z,"^",%)
25 Q
26WT W ?37,"|",$J(DGTT(1),6),$J(DGTT(2),8) S %=$S(DGTT(1)>0:(DGTT(2)/DGTT(1)),1:"") W $S(%]"":$J(%,7,1),1:" 0")," |"
27 W $J(DGTT(3),6),$J(DGTT(4),8) S %=$S(DGTT(3)>0:(DGTT(4)/DGTT(3)),1:"") W $S(%]"":$J(%,7,1),1:" 0")," |",$J(DGTT(5),6),$J(DGTT(6),9),$J(DGTT(6)/DGTT(5),7,1)," |",$J(DGTT(7),9,2),$J(DGTT(7)/DGTT(5),13,2) Q
28WM W !,DGLN,!?3,"Totals for Medical Center:" D WT,PG,TP^DGUTL Q
29WS F %=1:1:7 S:DGRNO=3 DGAMT(%)=DGAMT(%)+DGTT(%) I DGRNO=2 S DGTT(%)=DGAMT(%),DGMC(%)=DGMC(%)+DGAMT(%),DGAMT(%)=0
30 W !,DGLN,!?3,"Totals for Service:" D WT F %=1:1:7 S DGTT(%)=0
31 Q
32WB W !,DGLN2,!?3,"Totals for Specialty:" D WT F %=1:1:7 S DGAMT(%)=DGAMT(%)+DGTT(%),DGTT(%)=0
33 Q
Note: See TracBrowser for help on using the repository browser.