source: WorldVistAEHR/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EASECE.m@ 1046

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1EASECE ;ALB/PHH,LBD - Edit an Existing LTC Co-Pay Test ;17 AUG 2001
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**5,7,34,40**;Mar 15, 2001
3 ;
4EN ;Entry point to edit an existing LTC co-pay test
5 N DGMDOD S DGMDOD="",DGMTYPT=3
6 S DIC("S")="I $D(^DGMT(408.31,""AID"",DGMTYPT,+Y))"
7 I $D(DGMTDFN)#2 K DGMTDFN
8 S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q:Y<0 S (DFN,DGMTDFN)=+Y
9 I $P($G(^DPT(DFN,.35)),U)'="" S DGMDOD=$P(^DPT(DFN,.35),U)
10 I $G(DGMDOD) W !,"Patient died on: ",$$FMTE^XLFDT(DGMDOD,"1D") Q
11 ;
12DT S DIC("A")="Select DATE OF LTC COPAY TEST: "
13 I $D(^DGMT(408.31,+$$LST^EASECU(DFN,"",DGMTYPT),0)) S DIC("B")=$P(^(0),"^")
14 S DIC("S")="I $P(^(0),U,2)=DFN,$P(^(0),U,19)=DGMTYPT"
15 S DIC="^DGMT(408.31,",DIC(0)="EQZ" W ! D EN^DGMTLK K DIC G Q:Y<0
16 S DGMTI=+Y,DGMTDT=$P(Y,"^",2),DGMT0=Y(0)
17 ;
18 ;If test is uneditable, print error message and allow user to view test
19 ;or print 10/10EC
20 ;
21 I '$P($G(^DG(408.34,+$P(Y(0),U,23),0)),U,2) D D:$G(DGMTERR) VIEWPRT G EN
22 .W !!?3,*7,"Warning: Uneditable LTC Copay test. The source of this test is "_$S($$SR^DGMTAUD1(Y(0))]"":$$SR^DGMTAUD1(Y(0)),1:"UNKNOWN")
23 .W !?12,"which has been flagged as an uneditable source.",!
24 .S DIR("A")="Would you like to view the LTC Copay test or print the 10-10EC",DIR("B")="NO",DIR(0)="Y"
25 .D ^DIR K DIR S DGMTERR=Y I $D(DTOUT)!($D(DUOUT)) K DGMTERR,DTOUT,DUOUT
26 ;
27 ; If user holds DG MTDELETE security key, allow test date to be edited.
28 ; LTC III (EAS*1*34)
29 I $D(^XUSEC("DG MTDELETE",+$G(DUZ))) D
30 .N DIR,DA,DR,DIE,X,Y,DTOUT,DUOUT,DIROUT,DIRUT,DGNEWDT
31 .S DIR(0)="D^:DT:EX",DIR("A")="DATE OF TEST",DIR("B")=$$FMTE^XLFDT(DGMTDT,1)
32 .S DIR("?")="Enter a date that is less than or equal to today."
33 .S DIR("?",1)="Enter the date of the LTC Copay Test."
34 .D ^DIR K DIR Q:'Y!(Y=DGMTDT) S DGNEWDT=Y
35 .S DIR(0)="Y",DIR("A")="Are you sure you want to change the date of the LTC Copay Test",DIR("B")="NO" D ^DIR Q:'Y
36 .S DIE="^DGMT(408.31,",DA=DGMTI,DR=".01////"_DGNEWDT_";2.02///NOW"
37 .D ^DIE
38 ;
39EXMPT ; Is veteran exempt?
40 S DGEXMPT=$$EXMPT^EASECU(DFN)
41 I DGEXMPT D EXMPT^EASECSCC(DFN,DGMTI,DGEXMPT) D Q G EN
42 ;
43 D DISPLAY^EASECU23(DGMTI,DGMTYPT),PAUSE I $D(DTOUT)!($D(DUOUT)) K DTOUT,DUOUT G EN
44 ;
45 ; Allow user to edit LTC copay test status or reason for exemption.
46 ; If veteran is exempt for reason other than low income, don't do
47 ; income check. Added for LTC Phase IV (EAS*1*40)
48 W ! S DGEFLG=1 D STA^EASECSCC K DGEFLG
49 I $G(DGSTA)="EXEMPT",$G(DGRE),"^2^12^"'[(U_DGRE_U) D EXMPT^EASECSCC(DFN,DGMTI,DGRE) D Q G EN
50 S DGNSTA=$G(DGSTA)
51 ;
52 ; Check if veteran's income is below the pension threshold
53 D EN^EASECMT I $G(DGOUT) D Q G EN
54 I DGEXMPT D EXMPT^EASECSCC(DFN,DGMTI,2) D Q G EN
55 S DGMT0=$G(^DGMT(408.31,DGMTI,0)) F I=4,5,15 I $P(DGMT0,U,I) G EDT
56 ; Display message for vets who declined to provide income info
57 ; LTC III (EAS*1*34)
58 I $P(DGMT0,U,14)=1 D
59 .W !! F I=1:1:80 W "="
60 .W !!,?10,"Veteran is NOT EXEMPT from Long Term Care copayments and"
61 .W !,?10,"must complete a 10-10EC form."
62 .W !! F I=1:1:80 W "="
63 ; Does veteran decline to provide income information?
64 W !!
65 D REF^EASECSCC I $D(DTOUT)!($D(DUOUT)) D Q G EN
66 I $D(DGREF) D D Q G EN
67 .; Ask if veteran agrees to pay copayments; complete LTC copay test
68 .D AGREE^EASECSCC Q:$D(DTOUT)!($D(DUOUT))
69 .S DGSTA="NON-EXEMPT",DGCAT="T" D STA^DGMTSCU2 S (DGINT,DGDET,DGNWT)=""
70 .D UPD^EASECSCC
71 ;
72EDT S DGMTACT="EDT",DGMTROU="EN^EASECE" G EN^EASECSC
73 ;
74Q K DFN,DGEXMPT,DGMTACT,DGMTDT,DGMTERR,DGMT0,DGMTI,DGMTROU,DGMTYPT,DGMTX,DGOUT,DTOUT,DUOUT,X,Y
75 K DGREF,DGSTA,DGCAT,DGINT,DGDET,DGNWT,I,DGFORM,DGMTS,DGRE,DGNSTA
76 Q
77 ;
78PAUSE S DIR(0)="E" D ^DIR
79 Q
80 ;
81VIEWPRT ; Select 1 to view an uneditable means test or 2 to print a 10/10EC
82 ;
83 S DIR(0)="S^1:View LTC Copay Test;2:Print LTC Copay Test 10-10EC",DIR("A")="Select Choice"
84 D ^DIR S DGMTANS=Y G:$D(DTOUT)!($D(DUOUT)) VIEWPRTQ
85 I DGMTANS=1 D EN1^EASECV
86 I DGMTANS=2 D OEN^EASEC10E
87VIEWPRTQ ;
88 K DGMTANS,DIR,DTOUT,DUOUT,Y
89 Q
90 ;
Note: See TracBrowser for help on using the repository browser.