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

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

initial load of FOIAVistA 6/30/08 version

File size: 5.0 KB
Line 
1DGRPDB ;ALB/AAS,JAN,ERC,PHH - VIEW ONLY SCREEN TO DETERMINE BILLING ELIGIBILITY ; 3/23/06 8:16am
2 ;;5.3;Registration;**26,50,358,570,631,709,713,749**;Aug 13, 1993;Build 10
3 ;
4% S:'$D(DGQUIT) DGQUIT=0
5 G:DGQUIT END S DIC="^DPT(",DIC(0)="AEQMN" D ^DIC G:+Y<1 END S DFN=+Y D EN
6 G %
7 ;
8EN ;entry with DFN defined.
9 Q:'$D(DFN) D HOME^%ZIS,2^VADPT,HDR
10 D MT,AOIR,ELIG,DIS
11 N DGINS
12 I $$INSUR^IBBAPI(DFN,"","AR",.DGINS,1)
13 S C="",C=$O(DGINS("IBBAPI","INSUR",C),-1),C=+C+6
14 D:($Y>(IOSL-C)) PAUSE,HDR:'DGQUIT Q:DGQUIT D INS,PAUSE
15 Q
16 ;
17ELIG ;eligibility code(s)
18 W !!," Primary Elig. Code: ",$P(VAEL(1),"^",2)," -- ",$S(VAEL(8)']"":"NOT VERIFIED",1:$P(VAEL(8),"^",2))
19 I VAEL(8)]"" S Y=$S($D(^DPT(DFN,.361)):$P(^(.361),"^",2),1:"") W " " D DT^DIQ
20 W !,"Other Elig. Code(s): " I $D(VAEL(1))>9 S I1=0 F I=0:0 S I=$O(VAEL(1,I)) Q:'I S I1=I1+1 W:I1>1 !?21 W $P(VAEL(1,I),"^",2)
21 E W "NO ADDITIONAL ELIGIBILITIES IDENTIFIED"
22 Q
23 ;
24DIS ;rated disabilities - Integration Agreement #700
25 ;
26 ; This is called from the FEE and MCCR package!!!
27 ;
28 ; Input: DFN as IEN of PATIENT file
29 ; VAEL array (if no passed, it is set) of eligibility info
30 ;
31 I '$D(VAEL) D ELIG^VADPT S DGKVAR=1
32 W:'+VAEL(3) !!," Service Connected: NO" W:+VAEL(3) !!," SC Percent: ",$P(VAEL(3),"^",2)_"%"
33 N DGQUIT
34 W !," Rated Disabilities: " I 'VAEL(4),$S('$D(^DG(391,+VAEL(6),0)):1,$P(^(0),"^",2):0,1:1) W "NOT A VETERAN" G DISQ
35 S I3=0 F I=0:0 S I=$O(^DPT(DFN,.372,I)) Q:'I!($G(DGQUIT)=1) D
36 . S I1=^(I,0),I2=$S($D(^DIC(31,+I1,0)):$P(^(0),"^",1)_" ("_+$P(I1,"^",2)_"%-"_$S($P(I1,"^",3):"SC",$P(I1,"^",3)']"":"not specified",1:"NSC")_")",1:""),I3=I3+1
37 . I $Y>(IOSL-3) D PAUSE I $G(DGQUIT)=0 W @IOF
38 . I $G(DGQUIT)=1 Q
39 . W:I3>1 !?21 W I2
40 W:'I3 "NONE STATED"
41DISQ I $D(DGKVAR) D KVAR^VADPT K DGKVAR
42 K I,I1,I2,I3
43 Q
44 ;
45INS ;insurance information
46 ;
47 ; This is called form the FEE package!!!
48 ;
49 ; Input: DFN as IEN of PATIENT file
50 ; DGINSDT as date to compute insurance flag as of (default DT)
51 ;
52 Q:'$D(DFN)
53 W !!," Health Insurance: "
54 S Z=$$INSUR^IBBAPI(DFN,$S($D(DGINSDT):DGINSDT,1:DT))
55 W $S(Z:"YES",1:"NO")
56 D DISP^DGIBDSP
57INSQ K I,I1,DGX,Z
58 Q
59 ;
60IN ; Old code
61 Q
62 ;
63AOIR ;Agent Orange/ionizing radiation
64 N DGEC,NTA
65 S DGX=$S($D(^DPT(DFN,.321)):^(.321),1:"")
66 F I=2,3 S X=$P(DGX,"^",I) W:I=2 !," A/O Exp.: " W:I=3 "ION Rad.: " W $S(X="Y":"YES",X="N":"NO",X="U":"UNKNOWN",1:"NOT ANSWERED")," "
67 S X=$G(^DPT(DFN,.38)),X1=$P(X,"^",1) W "Medicaid Elig: ",$S(X1="":"NOT ANSWERED",'X1:"NO",1:"YES") I ($X+15)'>IOM W " - " S Y=$P(X,"^",2) D D^DIQ W $P(Y,"@")
68 S DGEC=$S($D(^DPT(DFN,.322)):^DPT(DFN,.322),1:"")
69 S X=$P(DGEC,U,13) W !," Env Contam.: " W $S(X="Y":"YES",X="N":"NO",X="U":"UNKNOWN",1:"NOT ANSWERED")," "
70 S NTA=$S($$GETCUR^DGNTAPI(DFN,"DGNTARR")>0:DGNTARR("INTRP"),1:"")
71 K DGNTARR
72 W "N/T Radium: " W $S(NTA'="":NTA,1:"NOT ANSWERED")
73 Q
74 ;
75PAUSE F J=1:1 Q:($Y>(IOSL-3)) W !
76 S DGX1="" I $E(IOST,1,2)["C-" N DIR S DIR(0)="E" D ^DIR S DGQUIT='Y
77 Q
78 ;
79HDR ;Screen Header
80 W @IOF I $P(VAEL(6),"^",2)]"" S DGTYPE=$P(VAEL(6),"^",2)
81 W $P(VADM(1),"^",1),?32,VA("PID"),?47,$P(VADM(3),"^",2) S X=$S($D(DGTYPE):$P(DGTYPE,"^",1),1:"PATIENT TYPE UNKNOWN"),X1=79-$L(X) W ?X1,X
82 S X="",$P(X,"=",80)="" W !,X Q
83 Q
84 ;
85MT I '$O(^DGMT(408.31,"AD",1,DFN,0)) W !," Means Test Status: NOT IN MEANS TEST FILE" Q
86 ;if patient is on a DOM ward, don't display Means Test required message
87 D DOM^DGMTR D:'$G(DGDOM) DIS^DGMTU(DFN) K DGDOM
88 Q
89 ;
90END D KVAR^VADPT
91 K A,C,I,I1,I2,I3,J,DIC,DIR,DFN,DGA1,DGMT,DGMTL,DGMTLA,DGX,DGX1,DGT,DGTYPE,DGQUIT,DGMTLL,X,X1,VAROOT,VA,Y,Z
92 Q
93 ;
94RDIS(DGDFN,DGARR) ;API to return all Rated Disabilities from the
95 ;Patient file for a patient using an array. Returned in descending Service Connected percent.
96 ;
97 ; Integration Agreement #4807
98 ;
99 ;Input DGDFN - IEN of patient file (required)
100 ;Input/Output DGARR - name of array for returned disability info (required)
101 ; piece 1 - Disability IEN (in file 31)
102 ; piece 2 - Disability %
103 ; piece 3 - SC? (1,0)
104 ; piece 4 - extremity affected
105 ; piece 5 - original effective date
106 ; piece 6 - current effective date
107 ;Output 1=successful and array returned with data
108 ; 0=unsuccessful and no array
109 ;
110 N DGARR1,DGC,DGCC,DGERR,DGNODE,DGCT,DGE,DGEE
111 K DGW,DGARR
112 I $G(DGDFN)']"" Q 0
113 I '$D(^DPT(DGDFN,0)) Q 0
114 D GETS^DIQ(2,DGDFN,".3721*","I","DGARR1","DGERR")
115 I $D(DGERR) Q 0
116 S DGCC=0
117 S DGCC=$O(^DPT(DGDFN,.372,DGCC))
118 I 'DGCC Q 0
119 S DGC=""
120 F S DGC=$O(DGARR1(2.04,DGC)) Q:DGC']"" D
121 . S DGNODE=DGC
122 . S DGARR(DGC)=DGARR1(2.04,DGNODE,.01,"I")_"^"_DGARR1(2.04,DGNODE,2,"I")_"^"_DGARR1(2.04,DGNODE,3,"I")_"^"_DGARR1(2.04,DGNODE,4,"I")_"^"_DGARR1(2.04,DGNODE,5,"I")_"^"_DGARR1(2.04,DGNODE,6,"I")
123 S DGE=""
124 F S DGE=$O(DGARR(DGE)) Q:'DGE D
125 . I $P(DGARR(DGE),U,2)="" S $P(DGARR(DGE),U,2)=0
126 . S DGW($P(DGARR(DGE),U,2),$P(DGE,",",1))=DGARR(DGE)
127 S DGE="",DGCT=1
128 K DGARR
129 F S DGE=$O(DGW(DGE),-1) Q:DGE']"" D
130 . F DGEE=0:0 S DGEE=$O(DGW(DGE,DGEE)) Q:DGEE'>0 D
131 . . S DGARR(DGCT)=DGW(DGE,DGEE) S DGCT=DGCT+1
132 K DGW
133 Q 1
134 ;
Note: See TracBrowser for help on using the repository browser.