source: FOIAVistA/tag/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPTSUD1.m@ 1424

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1DGPTSUD1 ;ALB/AS/ADL - Look for the same DRG in consecutive RAM movements ; Feb 23 87
2 ;;5.3;Registration;**510,478**;Aug 13, 1993
3 ;;ADL;Update for CSV Project;;Mar 27, 2003
4 ;
5 ;called from ONE+2^DGPTSUDO
6 F I=0:0 S I=$O(^DGPT(PTF,"M",I)) Q:I'>0 I $D(^DGPT(PTF,"M",I,"P")) S DGNODE=^("P"),DGSUDO(+$P(DGNODE,"^",3))=I_"^"_$P(DGNODE,"^",1)
7 G Q:'$D(DGSUDO) S (DGSUNX,DGSUPR)=$O(DGSUDO(0)) F XX=0:0 S DGSUNX=$O(DGSUDO(DGSUPR)) Q:DGSUNX'>0 D SAME
8Q K DGSUPR,DGSUNX,DGNODE,DGSUDO,DG1,DG2,DGMV1,DGMV2,DGSUB,DGSUR,DGSURDT,%,I,J,X1,X2 Q
9SAME I $P(DGSUDO(DGSUPR),"^",2)']""!($P(DGSUDO(DGSUPR),"^",2)'=$P(DGSUDO(DGSUNX),"^",2)) S DGSUPR=DGSUNX Q
10 S DG1=+$P(DGSUDO(DGSUPR),"^",1),DG2=+$P(DGSUDO(DGSUNX),"^",1),DGMV1=$S($D(^DGPT(PTF,"M",+DG1,"P")):^("P"),1:""),DGMV2=$S($D(^DGPT(PTF,"M",+DG2,"P")):^("P"),1:"")
11 ;Fiscal year 89 discharges are checked for a surgery performed while on Surgery Service if the DRG is a surgical DRG
12 G 88:'$P($$DRG^ICDGTDRG($P(DGSUDO(DGSUNX),"^",2),$$GETDATE^ICDGTDRG(PTF)),"^",6)
13 I $D(^DGPT(PTF,70)),$P(^DGPT(PTF,70),"^",1)<2881000 G 88
14 I $P(DGMV1,"^",2)'="S"&($P(DGMV2,"^",2)'="S") G 88
15 I $P(DGMV1,"^",2)="S" S I=DGADM F J=0:0 S J=$O(DGSUDO(J)) Q:J=DGSUPR!(J'>0) S I=J
16 S X1=$S($P(DGMV1,"^",2)="S":I,1:DGSUPR),X2=$S($P(DGMV1,"^",2)="S":DGSUPR,1:DGSUNX),X1=$P(X1,".",1),X2=$P(X2,".",1)_.99,DGSUR=0
17 F I=0:0 S I=$O(^DGPT(PTF,"S",I)) Q:I'>0 S DGSURDT=$S($D(^DGPT(PTF,"S",I,0)):+^(0),1:9999999) I X1<DGSURDT&(DGSURDT<X2) S DGSUR=1 Q
18 I DGSUR S DGSUB=$S($P(DGMV1,"^",2)="S":DG1,1:DG2) G KILL
1988 S DGSUB=$S($P(DGMV1,"^",4)>$P(DGMV2,"^",4):DG1,1:DG2)
20KILL N DGFDA,DGMSG,FLD
21 S DGFDA(45.02,DGSUB_","_PTF_",",23)=$P(DGMV1,"^",4)+$P(DGMV2,"^",4)
22 D FILE^DIE("","DGFDA","DGMSG")
23 I DGSUB=DG1 D Q
24 .K DGFDA,DGMSG
25 .S DGFDA(45.02,DG1_","_PTF_",",25)=$P(DGMV2,"^",6)
26 .D FILE^DIE("","DGFDA","DGMSG")
27 .K DGFDA,DGMSG
28 .F FLD=20:1:25 S DGFDA(45.02,DG2_","_PTF_",",FLD)="@"
29 .D FILE^DIE("","DGFDA","DGMSG")
30 .K DGSUDO(DGSUNX)
31 K DGFDA,DGMSG
32 F FLD=20:1:25 S DGFDA(45.02,DG1_","_PTF_",",FLD)="@"
33 D FILE^DIE("","DGFDA","DGMSG")
34 K DGSUDO(DGSUPR)
35 S DGSUPR=DGSUNX
36 Q
Note: See TracBrowser for help on using the repository browser.