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

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

WorldVistAEHR overlayed on FOIAVistA

File size: 4.7 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**;Aug 13, 1993
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 S DGX=$S($D(^DPT(DFN,.321)):^(.321),1:"")
65 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")," "
66 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,"@")
67 Q
68 ;
69PAUSE F J=1:1 Q:($Y>(IOSL-3)) W !
70 S DGX1="" I $E(IOST,1,2)["C-" N DIR S DIR(0)="E" D ^DIR S DGQUIT='Y
71 Q
72 ;
73HDR ;Screen Header
74 W @IOF I $P(VAEL(6),"^",2)]"" S DGTYPE=$P(VAEL(6),"^",2)
75 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
76 S X="",$P(X,"=",80)="" W !,X Q
77 Q
78 ;
79MT I '$O(^DGMT(408.31,"AD",1,DFN,0)) W !," Means Test Status: NOT IN MEANS TEST FILE" Q
80 ;if patient is on a DOM ward, don't display Means Test required message
81 D DOM^DGMTR D:'$G(DGDOM) DIS^DGMTU(DFN) K DGDOM
82 Q
83 ;
84END D KVAR^VADPT
85 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
86 Q
87 ;
88RDIS(DGDFN,DGARR) ;API to return all Rated Disabilities from the
89 ;Patient file for a patient using an array. Returned in descending Service Connected percent.
90 ;
91 ; Integration Agreement #4807
92 ;
93 ;Input DGDFN - IEN of patient file (required)
94 ;Input/Output DGARR - name of array for returned disability info (required)
95 ; piece 1 - Disability IEN (in file 31)
96 ; piece 2 - Disability %
97 ; piece 3 - SC? (1,0)
98 ; piece 4 - extremity affected
99 ; piece 5 - original effective date
100 ; piece 6 - current effective date
101 ;Output 1=successful and array returned with data
102 ; 0=unsuccessful and no array
103 ;
104 N DGARR1,DGC,DGCC,DGERR,DGNODE,DGCT,DGE,DGEE
105 K DGW,DGARR
106 I $G(DGDFN)']"" Q 0
107 I '$D(^DPT(DGDFN,0)) Q 0
108 D GETS^DIQ(2,DGDFN,".3721*","I","DGARR1","DGERR")
109 I $D(DGERR) Q 0
110 S DGCC=0
111 S DGCC=$O(^DPT(DGDFN,.372,DGCC))
112 I 'DGCC Q 0
113 S DGC=""
114 F S DGC=$O(DGARR1(2.04,DGC)) Q:DGC']"" D
115 . S DGNODE=DGC
116 . 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")
117 S DGE=""
118 F S DGE=$O(DGARR(DGE)) Q:'DGE D
119 . I $P(DGARR(DGE),U,2)="" S $P(DGARR(DGE),U,2)=0
120 . S DGW($P(DGARR(DGE),U,2),$P(DGE,",",1))=DGARR(DGE)
121 S DGE="",DGCT=1
122 K DGARR
123 F S DGE=$O(DGW(DGE),-1) Q:DGE']"" D
124 . F DGEE=0:0 S DGEE=$O(DGW(DGE,DGEE)) Q:DGEE'>0 D
125 . . S DGARR(DGCT)=DGW(DGE,DGEE) S DGCT=DGCT+1
126 K DGW
127 Q 1
128 ;
Note: See TracBrowser for help on using the repository browser.