[613] | 1 | DGJOTP1 ;MAF/ALB - TRANS PROD REPORT CONT. 1 ; SEP 11 1991@10:00
|
---|
| 2 | ;;1.0;Incomplete Records Tracking;;Jun 25, 2001
|
---|
| 3 | ;
|
---|
| 4 | I $D(DGJTMUL),DGJTMUL D DIVISION^VAUTOMA G:Y=-1 QUIT
|
---|
| 5 | I 'DGJTMUL S DGJTDV=$O(^DG(40.8,0))
|
---|
| 6 | D @(DGJTL) G:Y=-1 QUIT
|
---|
| 7 | D DAT^DGJOTP G:Y=-1 QUIT
|
---|
| 8 | S DIC("S")="I $S(""^OP REPORT^INTERIM SUMMARY^DISCHARGE SUMMARY^""[$P(^VAS(393.3,+Y,0),U,1):1,1:0)"
|
---|
| 9 | S VAUTVB="VAUTY",DIC="^VAS(393.3,",VAUTSTR="Summary Type",VAUTNI=2 D FIRST^VAUTOMA Q:Y=-1
|
---|
| 10 | W !!,*7,"This output requires 132 column output",!
|
---|
| 11 | D NOW^%DTC S Y=$E(%,1,12) S VADAT("W")=Y D ^VADATE S DGJTDAT=VADATE("E")
|
---|
| 12 | S DGVAR="DGJTDV^DGJTDIR^DGJTDAT^DGJTLPG^DGJTSTAT^DGJTCK^DGJTFL^DGJTMESS^DGJTSR^DGJTSR1^DGJTMUL^DGJTL^DGJTBG^DGJTEND^VAUTD#^VAUTN#^VAUTT#^VAUTY#",DGPGM="START^DGJOTP1" D ZIS^DGJUTQ I 'POP U IO G START^DGJOTP1
|
---|
| 13 | G QUIT
|
---|
| 14 | START S (DGJTPAG,DGJTDV1,DGJDICTO,DGJTRNTO,DGJCOTO,DGJDYAVG,DGJ30AVG)=0 F IFN=0:0 S IFN=$O(^VAS(393,IFN)) Q:'IFN S DGJTNODE=^VAS(393,IFN,0) D CK
|
---|
| 15 | I DGJTLPG=1!(DGJTLPG=3),$D(^UTILITY("VAS",$J)) S (DGJ,DGJTF,DGJTFF,DGJY,DGJTDV,DGJTDT,DGJTSV,DGJTSP,DGJTPHY,DGJTPT,DGU,DFN,IFN)=0,$P(DGJTLN,"=",133)="" G ^DGJOTP2
|
---|
| 16 | I DGJTLPG=2,$D(^UTILITY("VAS",$J)) S (DGJ,DGJTF,DGJTFF,DGJY,DGJTDV,DGJTDT,DGJTSV,DGJTSP,DGJTPHY,DGJTPT,DGU,DFN,IFN)=0,$P(DGJTLN,"=",133)="" G ^DGJOTP3
|
---|
| 17 | I '$D(^UTILITY("VAS",$J)) W !!,"NO RECORDS"
|
---|
| 18 | QUIT G QUIT^DGJOTP
|
---|
| 19 | CNT S DGJT5PC=DGJT2PC+DGJT3PC+DGJT4PC
|
---|
| 20 | S $P(DGJTOT(DGJTDVN),"^",1)=+DGJTOT(DGJTDVN)+1 I DGJT5PC>30 S $P(DGJTOT(DGJTDVN),"^",2)=$P(DGJTOT(DGJTDVN),"^",2)+1
|
---|
| 21 | I DGJTL="PHY" S:'$D(DGJPHTOT(DGJTDVN,DGJTPHY)) DGJPHTOT(DGJTDVN,DGJTPHY)=0 S $P(DGJPHTOT(DGJTDVN,DGJTPHY),"^",1)=$P(DGJPHTOT(DGJTDVN,DGJTPHY),"^",1)+1 S:DGJT5PC>30 $P(DGJPHTOT(DGJTDVN,DGJTPHY),"^",2)=$P(DGJPHTOT(DGJTDVN,DGJTPHY),"^",2)+1
|
---|
| 22 | I DGJTL="PHY" D PC Q
|
---|
| 23 | I DGJTL="SER" S:'$D(DGJSVTOT(DGJTDVN,DGJTSV)) DGJSVTOT(DGJTDVN,DGJTSV)=0 S $P(DGJSVTOT(DGJTDVN,DGJTSV),"^",1)=$P(DGJSVTOT(DGJTDVN,DGJTSV),"^",1)+1 S:DGJT5PC>30 $P(DGJSVTOT(DGJTDVN,DGJTSV),"^",2)=$P(DGJSVTOT(DGJTDVN,DGJTSV),"^",2)+1 D PC
|
---|
| 24 | I DGJTL="SER" S:'$D(DGJSPTOT(DGJTDVN,DGJTSV,DGJTSP)) DGJSPTOT(DGJTDVN,DGJTSV,DGJTSP)=0 S DGJSPTOT(DGJTDVN,DGJTSV,DGJTSP)=DGJSPTOT(DGJTDVN,DGJTSV,DGJTSP)+1
|
---|
| 25 | Q
|
---|
| 26 | CK I $D(VAUTD),'VAUTD I $P(DGJTNODE,"^",6)]"",'$D(VAUTD($P(DGJTNODE,"^",6))) Q
|
---|
| 27 | I $D(DGJTDV),$P(DGJTNODE,"^",6)]"" I $P(DGJTNODE,"^",6)'=DGJTDV Q
|
---|
| 28 | I DGJTSR1=1,$P(DGJTNODE,"^",13)'=1 Q
|
---|
| 29 | I DGJTSR1=2,$P(DGJTNODE,"^",13)]"" Q
|
---|
| 30 | I DGJTSR1'=2 I $P(DGJTNODE,"^",2)=$O(^VAS(393.3,"B","DISCHARGE SUMMARY",0)) S X=$P(DGJTNODE,"^",4) I X]"" I $D(^DGPM(X,0)) S X=$P(^DGPM(X,0),"^",17) Q:X']""
|
---|
| 31 | S DGJTPC=$S(DGJTL="SER":8,DGJTL="PHY":14,1:"")
|
---|
| 32 | Q:$P(DGJTNODE,"^",2)']"" Q:'$D(^VAS(393.3,$P(DGJTNODE,"^",2),0)) I "^OP REPORT^DISCHARGE SUMMARY^INTERIM SUMMARY^"'[$P(^VAS(393.3,$P(DGJTNODE,"^",2),0),"^",1) Q
|
---|
| 33 | I $D(VAUTN),'VAUTN I '$D(VAUTN(+$P(DGJTNODE,"^",DGJTPC))) Q
|
---|
| 34 | I $D(VAUTT),'VAUTT I '$D(VAUTT(+$P(DGJTNODE,"^",7))) Q
|
---|
| 35 | I $D(VAUTY),'VAUTY I '$D(VAUTY(+$P(DGJTNODE,"^",2))) Q
|
---|
| 36 | I $P(DGJTNODE,"^",3)<DGJTBG!($P(DGJTNODE,"^",3)>DGJTEND) Q
|
---|
| 37 | D ^DGJOTPUL I 'DGJTREC Q
|
---|
| 38 | S DGJTDIV=$P(DGJTNODE,"^",6),DGJTDVN=$S($P(DGJTNODE,"^",6)]""&($D(^DG(40.8,+$P(DGJTNODE,"^",6),0))):$P(^(0),"^",1),1:"NOT SPECIFIED") I DGJTL'="SER" I '$D(DGJTOT(DGJTDVN)) S DGJTOT(DGJTDVN)=0
|
---|
| 39 | I DGJTL="SER" S DGJTDVN=$E(DGJTDVN,1,23) I '$D(DGJTOT(DGJTDVN)) S DGJTOT(DGJTDVN)=0
|
---|
| 40 | S DFN=$P(DGJTNODE,"^",1) I $D(^DPT(DFN,0)) S DGJTPT=$P(^(0),"^",1)
|
---|
| 41 | I DGJTL="PHY" S DGJTPHY=$S($P(DGJTNODE,"^",DGJTPC)]""&($D(^VA(200,+$P(DGJTNODE,"^",DGJTPC),0))):$P(^(0),"^",1),1:"NOT SPECIFIED") S ^UTILITY("VAS",$J,DGJTDVN,DGJTPHY,DGJTPT,DFN,IFN)=DGJTDL_"^"_DGJT2PC_"^"_DGJT3PC_"^"_DGJT4PC D CNT Q
|
---|
| 42 | I DGJTL="SER" S DGJTSV=$S($P(DGJTNODE,"^",DGJTPC)]""&($D(^DG(393.1,+$P(DGJTNODE,"^",DGJTPC),0))):$P(^(0),"^",1),1:"NOT SPECIFIED"),DGJTSP=$S($P(DGJTNODE,"^",7)]""&($D(^DIC(45.7,+$P(DGJTNODE,"^",7),0))):$P(^(0),"^",1),1:"NOT SPECIFIED")
|
---|
| 43 | I DGJTL="SER" S DGJTSV=$E(DGJTSV,1,16),DGJTSP=$E(DGJTSP,1,16),DGJTPT=$E(DGJTPT,1,16) S ^UTILITY("VAS",$J,DGJTDVN,DGJTSV,DGJTSP,DGJTPT,DFN,IFN)=DGJTDL_"^"_DGJT2PC_"^"_DGJT3PC_"^"_DGJT4PC D CNT Q
|
---|
| 44 | Q
|
---|
| 45 | PC S DGJJX=$S(DGJTL="PHY":DGJPHTOT(DGJTDVN,DGJTPHY),1:DGJSVTOT(DGJTDVN,DGJTSV)) S $P(DGJJX,"^",3)=$P(DGJJX,"^",3)+DGJT2PC,$P(DGJJX,"^",4)=$P(DGJJX,"^",4)+DGJT3PC,$P(DGJJX,"^",5)=$P(DGJJX,"^",5)+DGJT4PC D TOT
|
---|
| 46 | I DGJTL="PHY" S DGJPHTOT(DGJTDVN,DGJTPHY)=DGJJX
|
---|
| 47 | I DGJTL="SER" S DGJSVTOT(DGJTDVN,DGJTSV)=DGJJX
|
---|
| 48 | Q
|
---|
| 49 | TOT S $P(DGJJX,"^",6)=$P(DGJJX,"^",6)+DGJT2PC+DGJT3PC+DGJT4PC S X=$S((DGJT2PC+DGJT3PC+DGJT4PC)>30:(DGJT2PC+DGJT3PC+DGJT4PC)-30,1:0) S $P(DGJJX,"^",7)=$P(DGJJX,"^",7)+X
|
---|
| 50 | Q
|
---|
| 51 | PHY S VAUTVB="VAUTN",DIC="^VA(200,",VAUTSTR="Physician",VAUTNI=2 D FIRST^VAUTOMA S:Y=-1 DGJFL=1 Q:DGJFL
|
---|
| 52 | Q
|
---|
| 53 | SER S VAUTVB="VAUTN",DIC="^DG(393.1,",VAUTSTR="Service",VAUTNI=2 D FIRST^VAUTOMA Q:Y=-1
|
---|
| 54 | S VAUTVB="VAUTT",DIC="^DIC(45.7,",VAUTSTR="Specialty",VAUTNI=2 D FIRST^VAUTOMA
|
---|
| 55 | Q
|
---|