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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1DGDEP5 ;ALB/CAW - Delete Duplicate Dependents ;12/15/94
2 ;;5.3;Registration;**45**;Aug 13, 1993
3EN ;
4 N BEG,DATE
5 I $G(DGMTI),$G(DGMTACT)="VEW" W !,"Cannot edit when viewing a means test." H 2 G ENQ
6 I '$D(DGMTI),$G(DGRPV)=1 W !,"Not while viewing" H 2 G ENQ
7 I '$D(^XUSEC("DG DEPDELETE",+DUZ)) W !!,"Access to this option requires a security key.",*7 H 2 G ENQ
8 S BEG=2 D SEL^DGDEPU G ENQ:$G(DGERR)
9 S DATE="" F S DATE=$O(DGDEP(DGW,DATE)) Q:'DATE I $P(DGDEP(DGW,DATE),U,3) W !!,"Dependent has been uploaded by IVM. Cannot delete." H 2 G ENQ
10 I '$$ASSOC(DFN,DGDEP(DGW)) D DEL(DFN,DGDEP(DGW),DGDEP(1),$G(DGMTI))
11ENQ S VALMBCK="R"
12 D INIT^DGDEP
13 Q
14 ;
15DEL(DFN,DGDEP,DGVDEP,DGMTI) ;Delete Dependent
16 ;
17 N DGPRI,DGINC,DGINP,DGINR,DGMTP,DGMTA,DGMTACT,DGMTINF
18 I $G(DGMTI) S DGMTACT="DDP",DGMTINF=1 D PRIOR^DGMTEVT
19 S DGPRI=$P(DGDEP,U,20)
20 S DGINP=+$P($G(^DGPR(408.12,+DGPRI,0)),U,3)
21 S DGINC=0 F S DGINC=$O(^DGMT(408.21,"C",DGPRI,DGINC)) Q:'DGINC D D DIK(DGINC,"^DGMT(408.21,")
22 .S DGINR=0 F S DGINR=$O(^DGMT(408.22,"AIND",DGINC,DGINR)) Q:'DGINR D DIK(DGINR,"^DGMT(408.22,")
23 D DIK(DGPRI,"^DGPR(408.12,")
24 D DIK(DGINP,"^DGPR(408.13,")
25 I $G(DGMTI) D
26 .S DGVIRI=$P(DGVDEP,U,22) D DEP^DGMTSC1,AFTER^DGMTEVT
27 .D SET^DGMTAUD
28 W !,"...deleting ANNUAL INCOME..."
29 W !,"...deleting INCOME RELATION..."
30 W !,"...deleting PERSON..."
31 W !,"...deleting INCOME PERSON..."
32 K DA,DIK
33Q Q
34 ;
35DIK(DA,DIK) ;Delete file entries
36 ;
37 D ^DIK
38 Q
39 ;
40ASSOC(DFN,DGDEP) ; Find out if dependent is associated with any MT
41 ;
42 N DGPER,DGINCP,DGX,DGY,DGZ
43 S (DGX,DGZ)=0
44 F S DGX=$O(^DGMT(408.31,"ADFN"_DFN,DGX)) Q:'DGX!(DGZ) S MTIEN=$O(^DGMT(408.31,"ADFN"_DFN,DGX,"")) I MTIEN D
45 .S DGY=0
46 .F S DGY=$O(^DGMT(408.22,"AMT",MTIEN,DFN,DGY)) Q:'DGY!(DGZ) D
47 ..S DGPER=$P($G(^DGMT(408.21,+DGY,0)),U,2)
48 ..I DGPER=$P(DGDEP,U,20) D
49 ...W !,"This dependent is associated with a means test. You must remove the"
50 ...W !,"dependent from ALL means/co-pay tests prior to deleting. Use the 'RE' action." H 2 S DGZ=1 Q
51ASSOCQ Q DGZ
Note: See TracBrowser for help on using the repository browser.