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

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

initial load of WorldVistAEHR

File size: 5.3 KB
RevLine 
[613]1DGCV1 ;ALB/ERC,BRM - COMBAT VET REPORTS; 07/10/2003 ; 2/5/04 2:52pm
2 ;;5.3;Registration;**528,565**; Aug 13, 1993
3 ;
4 ;first report is built during the initial seeding, and called by
5 ;POST^DG53528P
6RPT(DG) ;if, during initial seeding, a veteran could not be evaluated
7 ;for CV eligibility because of an imprecise date the veteran will be
8 ;added to the appropriate ^XTMP global
9 ; Input: DG - the code corresponding to the missing or imprecise date
10 ;
11 K VADM
12 I $G(DG)']"" Q
13 S ^XTMP("DGCV","REPORT",DFN,DG)=""
14 Q
15REPORT ;if there are veterans in the ^XTMP globals, create a report.
16 I '$D(^XTMP("DGCV","REPORT")) Q
17 N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK,ZUSR,POP,X,ERR
18 K IOP,%ZIS
19 I $G(XPDQUES("POS1","B"))]"" S ZTIO=$G(XPDQUES("POS1","B")) ;result of install question
20 I $G(ZTIO)']"" S IOP=$G(^XTMP("DGCV","DEVICE"))
21 S ZTSAVE("*")=""
22 S ZTRTN="PRINT^DGCV1",ZTDESC="IMPRECISE COMBAT DATE REPORT"
23 D ^%ZTLOAD
24EXIT ;
25 K XPDQUES
26 Q
27PRINT ;print report
28 N PAGE,QUIT,DFN
29 S PAGE=1
30 S QUIT=""
31 D HDR
32 N DGF,DGFD,DGLN,DGNAM,DGSSN
33 S (DGF,DFN)=""
34 F S DFN=$O(^XTMP("DGCV","REPORT",DFN)) Q:DFN']"" D
35 . Q:'$D(^DPT(DFN))
36 . S (DGNAM,DGSSN)=""
37 . D DEM(DFN)
38 . I $G(DGNAM)']""!($G(DGSSN)']"") Q
39 . S DGLN=DGNAM_"^"_DGSSN
40 . N DGC
41 . F S DGF=$O(^XTMP("DGCV","REPORT",DFN,DGF)) Q:DGF']""!(QUIT) D
42 . . N DGFF
43 . . I $L(DGF)=1 S DGFF=DGF S DGC=1 D SET
44 . . I $L(DGF)=2 D
45 . . . S DGFF=$E(DGF,1),DGC=1 D SET
46 . . . S DGFF=$E(DGF,2),DGC=2 D SET
47 W !,">>>>END OF REPORT"
48 Q
49SET ;
50 I DGFF["A"!(DGFF["F") S DGFD="SERVICE SEP"
51 I DGFF["B"!(DGFF["G") S DGFD="COMBAT TO"
52 I DGFF["C"!(DGFF["H") S DGFD="YUGOSLAVIA TO"
53 I DGFF["D"!(DGFF["I") S DGFD="SOMALIA TO"
54 I DGFF["E"!(DGFF["J") S DGFD="PERS GULF TO"
55 I $G(DGFD)']"" Q
56 S DGFD=DGFD_" DATE "_$S("ABCDE"[DGFF:"IMPRECISE",1:"MISSING")
57 S DGLN=$S(DGC=1:DGLN_"^"_DGFD,DGC=2:"^^"_DGFD,1:"")
58 D ADD(DGLN)
59 Q
60DEM(DFN) ;
61 N VADM
62 D DEM^VADPT
63 S DGNAM=$G(VADM(1))
64 S DGSSN=$P($G(VADM(2)),U,2)
65 Q
66ADD(DGLN) ;add the line to the report
67 N DGX
68 I $P(DGLN,U)]"" W !
69 W !?2,$P(DGLN,U),?39,$P(DGLN,U,2),?52,$P(DGLN,U,3)
70 I $E(IOST,1,2)="C-",($Y>(IOSL-4)) D
71 . D PAUSE
72 . Q:QUIT
73 . D TOP
74 I '$E(IOST,1,2)="C-",($Y>(IOSL-2)) D TOP
75 Q
76 ;
77TOP ;
78 W @IOF
79 D HDR
80 Q
81 ;
82HDR ;print header for report
83 N Y
84 W !!?5,"REPORT OF UPDATES REQUIRED FOR COMBAT VET STATUS" S Y=DT D DD^%DT W ?62,"Date: ",Y
85 W !,?62,"Page: ",PAGE
86 W !!?5,"The following patients could not be evaluated for Combat Veteran"
87 W !?5,"Eligibility status due to having imprecise or missing dates."
88 W !!!?2,"Patient Name",?39,"SSN",?52,"Date to be updated"
89 W !?2,"===================================",?39,"===========",?52,"=========================="
90 S PAGE=PAGE+1
91 Q
92 ;
93RPT2 ;second report is option DG CV STATUS, a report of what veterans were
94 ;assigned CV status during a specified date range
95 N DIR,DIRUT,X1,X2,X,Y,DGBEG,DGDT,DGEND
96 S DIR(0)="DAO^,"_DT
97 S X1=DT,X2=-7 D C^%DTC
98 S Y=X D DD^%DT
99 S DIR("A")="BEGINNING DATE: "
100 S DIR("B")=Y
101 S DIR("?")="ENTER THE BEGINNING DATE FOR THE REPORT"
102 S DIR("??")="^W !,""A BEGINNING AND AN END DATE MUST BE ENTERED FOR THIS REPORT"""
103 D ^DIR
104 Q:$D(DIRUT)
105 S DGBEG=Y
106 S DIR(0)="DAO^"_DGBEG_","_DT
107 S Y=DT D DD^%DT S DGDT=Y
108 S DIR("B")=DGDT
109 S DIR("A")="ENDING DATE: "
110 S DIR("?")="ENTER THE ENDING DATE FOR THE REPORT"
111 D ^DIR
112 Q:$D(DIRUT)
113 S DGEND=Y
114 D REPORT2(DGBEG,DGEND)
115 Q
116 ;
117REPORT2(DGBEG,DGEND) ;
118 I $G(DGBEG)']""!($G(DGEND)']"") W !!,"DATE RANGE NOT SET. EXITING" Q
119 N ZTDESC,ZTIO,ZTRTN,ZTSAVE,ZTSK,ZUSR,POP,X,ERR
120 K IOP,%ZIS
121 S %ZIS="Q" D ^%ZIS G:POP EXIT2
122 I $D(IO("Q")) D Q
123 . S (ZTSAVE("DGBEG"),ZTSAVE("DGEND"))=""
124 . S ZTRTN="PRINT2^DGCV1",ZTDESC="COMBAT VET DATE EDITED REPORT"
125 . D ^%ZTLOAD
126 . D ^%ZISC,HOME^%ZIS
127 . W !,$S($D(ZTSK):"REQUEST QUEUED!",1:"REQUEST CANCELLED!")
128 D PRINT2
129EXIT2 D ^%ZISC,HOME^%ZIS
130 ;Q +G(ZTSK)
131 Q
132PRINT2 ;
133 N DGLN,PAGE,QUIT
134 S QUIT=""
135 U IO
136 I $E(IOST,1,2)="C-" W @IOF
137 S DGLN=0
138 S PAGE=1
139 D HDR2
140 D DATA
141 I DGLN=0 D
142 . W !!!,?30,"No data to report."
143 . I $E(IOST,1,2)="C-" D PAUSE
144 D EXIT2
145 Q
146HDR2 ;
147 N DG1,DG2,Y
148 S Y=DGBEG D DD^%DT S DG1=Y
149 S Y=DGEND D DD^%DT S DG2=Y
150 W !!?15,"COMBAT VETERAN STATUS CHANGED REPORT"
151 S Y=DT D DD^%DT W ?60,"Date: ",Y
152 W !?20,DG1_" TO "_DG2
153 W ?60,"Page: "_PAGE
154 W !!!?3,"NAME",?41,"SSN",?63,"CV END DATE",!?41,"PRIORITY GROUP"
155 W !,?3,"===================================",?41,"=================",?63,"============"
156 S PAGE=PAGE+1
157 Q
158DATA ;
159 N DGENR,DFN,DGNAM,DGSSN,DGDT,DGX,QUIT,Y,VADM
160 S QUIT=""
161 Q:$G(DGBEG)']""!($G(DGEND)']"")
162 S DGX=DGBEG-1
163 F S DGX=$O(^DPT("E",DGX)) Q:DGX'>0!(DGX>DGEND) D
164 . S DFN=""
165 . F S DFN=$O(^DPT("E",DGX,DFN)) Q:DFN']""!(QUIT) D
166 . . Q:'$D(^DPT(DFN))
167 . . K VADM,DGENR
168 . . D DEM^VADPT
169 . . Q:'$D(VADM)
170 . . S DGNAM=VADM(1)
171 . . S DGSSN=$P(VADM(2),U,2)
172 . . S DGDT=$$GET1^DIQ(2,DFN_",",.5295,"E")
173 . . I $G(DGDT)']"" S DGDT="DELETED!!!!"
174 . . S DGENR=$$PRIOR(DFN)
175 . . I $G(DGENR)']"" S DGENR="NONE"
176 . . D ADD2
177 Q
178PRIOR(DFN) ;gets priority and sub group
179 ;
180 N DGEN,DGIEN,DGSUB
181 I $$GET^DGENA($$FINDCUR^DGENA(DFN),.DGEN) D
182 . S DGENR=$G(DGEN("PRIORITY"))
183 . S DGSUB=$G(DGEN("SUBGRP"))
184 . I $G(DGSUB)]"" S DGENR=DGENR_$$EXTERNAL^DILFD(27.11,.12,"F",DGSUB)
185 Q $G(DGENR)
186PAUSE ;
187 N DIR,DIRUT,X,Y
188 F Q:$Y>(IOSL-3) W !
189 S DIR(0)="E"
190 D ^DIR
191 I ('(+Y))!($D(DIRUT)) S QUIT=1
192 Q
193ADD2 ;
194 I $E(IOST,1,2)="C-",($Y>(IOSL-6)) D
195 . D PAUSE
196 . Q:QUIT
197 . D TOP2
198 I '$E(IOST,1,2)="C-",($Y>(IOSL-2)) D TOP2
199 I '(QUIT) D LINE
200 Q
201TOP2 ;
202 W @IOF
203 D HDR2
204 Q
205LINE ;add a line to the report
206 W !?3,DGNAM,?41,DGSSN,?63,DGDT,!?41,DGENR,!
207 S DGLN=1
208 Q
Note: See TracBrowser for help on using the repository browser.