source: WorldVistAEHR/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EASECDP2.m@ 1111

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1EASECDP2 ;ALB/LBD Dependent Utilities ;19 AUG 2001
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**5,7**;Mar 15, 2001
3 ;
4 ; NOTE: This routine was modified from DGDEP2 for LTC Co-pay
5 ;
6EN1 ; Add dependent to means test
7 ;
8 N DGSAVE,DGMTD,DGSAVE1
9 I '$G(DGMTI),$G(DGMTYPT)'=3 W !,"Not a LTC copay test - use LTC copay test options." H 2 G EN1Q
10 I $G(DGMTACT)="VEW" W !,"Cannot edit when viewing a LTC copay test." H 2 G EN1Q
11 S VALMBCK="",DGSAVE=VALMLST,DGSAVE1=VALMBG
12 S VALMBG=1,VALMLST=DGCNT D SEL^VALM2 S VALMBG=DGSAVE1,VALMLST=DGSAVE G EN1Q:'$O(VALMY(0))
13 N CTR S CTR=0 F S CTR=$O(VALMY(CTR)) Q:'CTR D
14 .D ADD(DFN,DGDEP(CTR),$G(DGMTI))
15 S DGMTD=$S($G(DGMTI):$P(^DGMT(408.31,DGMTI,0),U),1:DT)
16 D ALL^EASECU21(DFN,"VSC",DGMTD,"IPR",DGMTI)
17 K DGDEP D INIT^EASECDEP
18EN1Q S VALMBCK="R" Q
19 ;
20ADD(DFN,DGDEP,DGMTI) ;Add
21 N DA,DR,DIE,DGMTD,DGIRI
22 I '$G(DGMTI),$G(DGMTYPT)'=3 W !,"Not a LTC copay test - use LTC copay test options." H 2 G ADDQ
23 I $G(DGMTACT)="VEW" W !,"Cannot edit when viewing a LTC copay test." G ADDQ
24 S DGMTR=$O(^DG(408.11,"B",$P(DGDEP,U,2),"")) I '$P(^DG(408.11,DGMTR,0),U,4) D G ADDQ
25 .W !,"Cannot add a "_$P(DGDEP,U,2)_" as a dependent to the LTC copay test." H 2
26 S DGMTD=$S($G(DGMTI):$P($G(^DGMT(408.31,DGMTI,0)),U),1:DT)
27 D GETIENS^EASECU2(DFN,$P(DGDEP,U,20),DGMTD)
28 S DA=DGIRI
29 S DIE="^DGMT(408.22,",DR="31////"_DGMTI
30 D ^DIE
31ADDQ Q
32 ;
33EN2 ; Remove dependent from means test
34 ;
35 N DGSAVE1,DGSAVE2,DGMTD
36 I '$G(DGMTI),$G(DGMTYPT)'=3 W !,"Not a LTC copay test - use LTC copay test options." H 2 G EN2Q
37 I $G(DGMTACT)="VEW" W !,"Cannot edit when viewing a LTC copay test." H 2 G EN2Q
38 S VALMBCK="",DGSAVE1=VALMBG,DGSAVE2=VALMLST,VALMBG=2
39 S VALMLST=DGCNT D SEL^VALM2 S VALMBG=DGSAVE1,VALMLST=DGSAVE2 G EN1Q:'$O(VALMY(0))
40 N CTR S CTR=0 F S CTR=$O(VALMY(CTR)) Q:'CTR D
41 .D REMOVE(DFN,DGDEP(CTR),$G(DGMTI))
42 S DGMTD=$S($G(DGMTI):$P(^DGMT(408.31,DGMTI,0),U),1:DT)
43 D ALL^EASECU21(DFN,"VSC",DGMTD,"IPR",DGMTI)
44EN2Q S VALMBCK="R" Q
45 ;
46REMOVE(DFN,DGDEP,DGMTI) ;Remove
47 N DA,DR,DIE,DGMTD
48 I '$G(DGMTI),$G(DGMTYPT)'=3 W !,"Not a LTC copay test - use LTC copay test options." H 2 G REMOVEQ
49 I $G(DGMTACT)="VEW" W !,"Cannot edit when viewing a LTC copay test." H 2 G EN2Q
50 S DGMTD=$S($G(DGMTI):$P($G(^DGMT(408.31,DGMTI,0)),U),1:DT)
51 D GETIENS^EASECU2(DFN,$P(DGDEP,U,20),DGMTD)
52 S DA=DGIRI
53 S DIE="^DGMT(408.22,",DR="31////@"
54 D ^DIE S DGREMOVE=1
55 K DGDEP D INIT^EASECDEP
56REMOVEQ K DGREMOVE Q
57 ;
58EN3 ; Edit dependent demo
59 ;
60 S VALMBCK=""
61 N DGSAVE1,DGSAVE2,DGMTD,DGBEG,I
62 I $G(DGMTACT)="VEW" W !,"Cannot edit when viewing a LTC copay test." H 2 G EN3Q
63 I '$D(DGMTI),$G(DGRPV)=1 W !,"Not while viewing" H 2 G EN3Q
64 S VALMBCK="",DGSAVE1=VALMBG,DGSAVE2=VALMLST,VALMBG=1
65 S VALMLST=DGCNT D SEL^VALM2 S VALMBG=DGSAVE1,VALMLST=DGSAVE2 G EN1Q:'$O(VALMY(0))
66 N CTR S CTR=0 F S CTR=$O(VALMY(CTR)) Q:'CTR D
67 .D EDITD(DFN,DGDEP(CTR),CTR,$G(DGMTI))
68 S VALMBCK="R"
69 K DGDEP D INIT^EASECDEP
70EN3Q Q
71 ;
72EDITD(DFN,DGDEP,DGW,DGMTI) ; Edit
73 N DA,DR,DIE,DGMTDT,SPOUSE,DGREL,DGDR,CNT,RELATION
74 I $G(DGMTACT)="VEW" W !,"Cannot edit when viewing a LTC copay test." H 2 G EDITDQ
75 W !!,$P(DGDEP,U)
76 I '$G(DGMTI),$P(DGDEP,U,2)="SELF" D G EDITDQ
77 .S DGREL("V")=$P(DGDEP,U,20) D SPOUSE^EASECED2
78 I '$G(DGMTI) W !,"Can only input information for veteran." H 2 G EN3Q
79 S DGMTDT=$P(^DGMT(408.31,DGMTI,0),U)
80 I $P(DGDEP,U,2)="SPOUSE" W !,"Married information is entered under the veteran." H 2 G EDITDQ
81 I $P(DGDEP,U,2)="SELF" D G EDITDQ
82 .S DGDR=101
83 .D GETREL^DGMTU11(DFN,"S",$S($G(DGMTDT):DGMTDT,1:DT))
84 .S DA=DGVIRI,DIE="^DGMT(408.22,",DR="[EASEC EDIT MARITAL STATUS]" D ^DIE K DA,DIE,DR
85 .I $G(DGMTI),$G(DGREL("S")) D
86 ..S SPOUSE=+DGREL("S")
87 ..D INIT^EASECDEP
88 ..S CNT=0 F S CNT=$O(DGDEP(CNT)) Q:'CNT I $P(DGDEP(CNT),U,20)=SPOUSE D ADD(DFN,DGDEP(CNT),DGMTI)
89 S RELATION=$O(^DG(408.11,"B",$P(DGDEP,U,2),""))
90 I '$P(^DG(408.11,+RELATION,0),U,4) W !,"Not applicable for LTC copay test" H 2 G EDITDQ
91 S DGPRI=$P(DGDEP,U,20)
92 D EDT
93 I $G(DGFL)'<0 D ADD(DFN,DGDEP,DGMTI)
94EDITDQ ;
95 Q
96 ;
97EDT ;Edit dependent child data
98 ; NOTE: this code was modified from DGMTSC11
99 N DA,DGERR,DGFIN,DGINI,DGIRI,DIE,DR
100 D GETIENS^EASECU2(DFN,+DGPRI,DGMTDT) G EDTQ:DGERR
101 S DA=DGIRI,DIE="^DGMT(408.22,",DR="[EASEC EDIT DEPENDENTS]" D ^DIE
102 S:'$D(DGFIN) DGFL=$S($D(DTOUT):-2,$D(DUOUT):-1,($D(Y))=10:-1,1:0)
103EDTQ Q
Note: See TracBrowser for help on using the repository browser.