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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1DGDEP4 ;ALB/CAW - Dependents Utilities (con't) ;12/1/94
2 ;;5.3;Registration;**45**;Aug 13, 1993
3 ;
4EN ; Spouse Demographics
5 N BEG,CNT,END,FLAG,QUIT,DGERR S CNT=0
6 I $G(DGMTI),$G(DGMTACT)="VEW" W !,"Cannot edit when viewing a means test." H 2 G ENQ
7 I '$D(DGMTI),$G(DGRPV)=1 W !,"Not while viewing" H 2 G ENQ
8 F S CNT=$O(DGDEP(CNT)) Q:'CNT D
9 .I $P(DGDEP(CNT),U,2)="SPOUSE" S FLAG=$G(FLAG)+1
10 I '$G(FLAG) W !,"There is no spouse to choose from." H 2 G ENQ
11 I $G(FLAG)>1 D G:'$G(DGERR) EN1
12 .S BEG=2,END=FLAG+1 D SEL^DGDEPU Q:$G(DGERR)
13 .S DGREL("S")=$P(DGDEP(DGW),U,20)_U_$P(^DGPR(408.12,+$P(DGDEP(DGW),U,20),0),U,3)
14 I $G(DGERR) G ENQ
15 I '$G(DGREL("S")) S DGREL("S")=$P(DGDEP(2),U,20)_U_$P(^DGPR(408.12,+$P(DGDEP(2),U,20),0),U,3)
16EN1 S DGPRI=$P(DGDEP(1),U,20),DGIRI=$P(DGDEP(1),U,22) D SPOUSE1^DGMTSC1
17ENQ D INIT^DGDEP
18 Q
19 ;
20COPY ; Copy information
21 I $G(DGMTI),$G(DGMTACT)="VEW" W !,"Cannot edit when viewing a means test." H 2 G COPYQ
22 I '$D(DGMTI),$G(DGRPV)=1 W !,"Not while viewing" H 2 G COPYQ
23 D COPY^DGMTU22(DFN,$S($G(DGMTDT):DGMTDT,1:DT),$G(DGMTI))
24 D INIT^DGDEP
25COPYQ S VALMBCK="R"
26 Q
27 ;
28ADDEP ; Add a new dependent
29 ;
30 N DGANS
31 S VALMBCK=""
32 I $G(DGMTI),$G(DGMTACT)="VEW" W !,"Cannot edit when viewing a means test." H 2 G ADDEPQ
33 I '$D(DGMTI),$G(DGRPV)=1 W !,"Not while viewing" H 2 G ADDEPQ
34 S DIR(0)="S^S:Spouse;D:Dependent",DIR("A")="Do you want to add (S)pouse or (D)ependent"
35 D ^DIR S DGANS=Y K DIR,Y I DGANS="D",$G(DGMTI) S DGANS="C"
36 I $D(DIRUT) G ADDEPQ
37 D GETREL^DGMTU11(DFN,"S",$S($G(DGMTD):DGMTD,1:DT))
38 I DGANS="S",$G(DGREL("S")) W !,"An active spouse is currently on file. Use the 'ES - Edit Spouse'",!,"action to edit." H 3 G ADDEPQ
39 I DGANS="S",$G(DGMTI) S CNT=0 F S CNT=$O(DGDEP(CNT)) Q:'CNT I $P(DGDEP(CNT),U,2)="SPOUSE" D REMOVE^DGDEP2(DFN,DGDEP(CNT),DGMTI)
40 D CLEAR^VALM1
41 D ADD^DGRPEIS(DFN,DGANS,$S($G(DGMTI):$P(^DGMT(408.31,DGMTI,0),U),1:DT))
42 S PERSON=DGPRI
43 I DGFL=-1!(DGFL=-2) G ADDEPQ
44 D INIT^DGDEP
45 I $G(DGMTI) D
46 .N CNT
47 .S CNT=0
48 .F S CNT=$O(DGDEP(CNT)) Q:'CNT I $P(DGDEP(CNT),U,20)=PERSON D
49 ..D ADD^DGDEP2(DFN,DGDEP(CNT),DGMTI)
50 ..D EDITD^DGDEP2(DFN,DGDEP(CNT),CNT,DGMTI)
51ADDEPQ S VALMBCK="R"
52 D INIT^DGDEP
53 K DGFL Q
54 ;
55EDITDEP ; Edit dependent demo
56 ;
57 S VALMBCK=""
58 N DGSAVE1,DGSAVE2,DGMTD,DGBEG,I
59 I $G(DGMTI),$G(DGMTACT)="VEW" W !,"Cannot edit when viewing a means test." H 2 G EDITDEPQ
60 I '$D(DGMTI),$G(DGRPV)=1 W !,"Not while viewing" H 2 G EDITDEPQ
61 S I=0 F S I=$O(DGDEP(I)) Q:'I!($G(DGBEG)) I $P(DGDEP(I),U,2)'="SELF",$P(DGDEP(I),U,2)'="SPOUSE" S DGBEG=I
62 S VALMBCK="",DGSAVE1=VALMBG,DGSAVE2=VALMLST,VALMBG=$S($G(DGBEG):DGBEG,1:0)
63 S VALMLST=DGCNT D SEL^VALM2 S VALMBG=DGSAVE1,VALMLST=DGSAVE2 G EDITDEPQ:'$O(VALMY(0))
64 N CTR S CTR=0 F S CTR=$O(VALMY(CTR)) Q:'CTR D
65 .D EDITC(DFN,DGDEP(CTR),CTR,$G(DGMTI))
66EDITDEPQ S VALMBCK="R"
67 K DGDEP D INIT^DGDEP
68 Q
69 ;
70EDITC(DFN,DGDEP,DGW,DGMTI) ; Edit
71 N DA,DR,DIE,DGMTDT,DEP,DGSAVE
72 S DGMTDT=$S($G(DGMTI):$P(^DGMT(408.31,+DGMTI,0),U),1:DT)
73 I $G(DGMTI),$G(DGMTACT)="VEW" W !,"Cannot edit when viewing a means test." H 2 G EDITCQ
74 S DEP=$S($G(DGMTI):"C",1:"D"),DGSAVE=DGDEP
75 D GETREL^DGMTU11(DFN,DEP,$$LYR^DGMTSCU1($S($G(DGMTDT):DGMTDT,1:DT)),$G(DGMTI))
76 S DGDEP=DGSAVE
77 N CNTR
78 S CNTR=0
79 F S CNTR=$O(DGREL(DEP,CNTR)) Q:'CNTR I $P(DGDEP,U,20)=+DGREL(DEP,CNTR) D
80 .D EDIT^DGRPEIS(DGREL(DEP,CNTR),DEP)
81EDITCQ ;
82 K ^TMP("DGMTEP",$J)
83 Q
Note: See TracBrowser for help on using the repository browser.