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

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

initial load of FOIAVistA 6/30/08 version

File size: 5.4 KB
Line 
1DGPSEU2 ;ALB/ERC - REPORTS FOR PSEUDO SSN ; 1/9/06 7:46am
2 ;;5.3;Registration;**653**;Aug 13, 1993;Build 2
3 ;
4 ;creates a report of all dependents with pseudo SSNs
5 ;can call for one Pseudo SSN Reason or can call for all reasons
6 ;sorted by reason
7 ;
8TSK2 ;
9 N DGQ,DGQUIT,DGREAS,DGXREAS,DGTXT
10 N ZTRTN,ZTDESC,ZTSK,ZTIO,ZTDTH,POP,IO,IOBS,IOF,IOHG,IOM,ION,IOPAR
11 N IOS,IOSL,IOST,IOT,IOUPAR,IOXY,%ZIS,ZTSAVE
12 K ^TMP("DGEVC",$J)
13 S DGQUIT=0
14 D QUESREAS^DGPSEUDO Q:DGQUIT
15 S %ZIS="Q"
16 D ^%ZIS I $G(POP) D ^%ZISC,HOME^%ZIS W !,"Job Terminated!" Q
17 I $D(IO("Q")) D Q
18 . S ZTRTN="RPT2^DGPSEU2"
19 . S ZTDESC="DEPENDENTS WITH PSEUDO SOCIAL SECURITY NUMBERS"
20 . S (ZTSAVE("DGXREAS"),ZTSAVE("DGXVET"))=""
21 . D ^%ZTLOAD
22 . S DGTXT=$S($G(ZTSK):"Task: "_ZTSK_" Queued.",1:"Error: Process not queued!")
23 . W !,DGTXT
24RPT2 ;
25 N DGC,DGPAGE,DGQ
26 S (DGQUIT,DGPAGE)=0
27 S DGC=0
28 D LOOP2
29 D HDR2
30 I $G(DGC)'>0 W !!?25,"****NO RECORDS TO REPORT****" W ! D PAUSE^DGPSEUDO Q
31 D REP2(DGXREAS)
32 D ^%ZISC,HOME^%ZIS
33 K ^TMP("DGEVC",$J)
34 Q
35LOOP2 ;
36 I $E(IOST,1,2)["C-" U IO(0) W !!,"Scanning file...."
37 U IO
38 N DGCT,DGIEN13,DGX
39 K ^TMP("DGEVC",$J)
40 S DGX=999999999
41 S DGCT=0
42 S ^TMP("DGEVC",$J,"COUNT")=0
43 S ^TMP("DGEVC",$J,"COUNT","REFUSED TO PROVIDE")=0
44 S ^TMP("DGEVC",$J,"COUNT","SSN UNKNOWN/FOLLOW-UP REQUIRED")=0
45 S ^TMP("DGEVC",$J,"COUNT","NO SSN ASSIGNED")=0
46 S ^TMP("DGEVC",$J,"COUNT","NULL")=0
47 F S DGX=$O(^DGPR(408.13,"SSN",DGX)) Q:DGX="" D
48 . I DGX'["P" Q
49 . S DGIEN13=0
50 . F S DGIEN13=$O(^DGPR(408.13,"SSN",DGX,DGIEN13)) Q:'DGIEN13 D
51 . . Q:'$D(^DGPR(408.13,DGIEN13,0))
52 . . D PSEU2
53 Q
54PSEU2 ;
55 N DGARR,DGCT,DGDFN,DGDOB,DGERR,DGIEN12,DGNAM,DGPAT,DGPSSN,DGSSN
56 I $D(^TMP("DGEVC",$J,DGIEN13)) Q
57 D GETS^DIQ(408.13,DGIEN13_",",".01;.09;.1","EI","DGARR","DGERR")
58 I $D(DGERR) K DGERR Q
59 I $G(DGARR(408.13,DGIEN13_",",.09,"I"))'["P" K DGARR Q
60 S DGDEPNAM=$G(DGARR(408.13,DGIEN13_",",.01,"I"))
61 S DGDEPSSN=$G(DGARR(408.13,DGIEN13_",",.09,"I"))
62 S DGREASON=$G(DGARR(408.13,DGIEN13_",",.1,"E"))
63 I $G(DGREASON)']"" S DGREASON="NULL"
64 I DGXREAS'="ALL",DGXREAS'=DGREASON K DGARR Q
65 S DGIEN12=0
66 S DGIEN12=$O(^DGPR(408.12,"C",DGIEN13_";DGPR(408.13,",DGIEN12))
67 I $G(DGIEN12)']"" K DGARR Q
68 I '$D(^DGPR(408.12,DGIEN12,0)) K DGARR Q
69 D GETS^DIQ(408.12,DGIEN12_",",".01;.02","EI","DGARR","DGERR")
70 I $D(DGERR) K DGARR,DGERR Q
71 S DGDFN=$G(DGARR(408.12,DGIEN12_",",.01,"I"))
72 I '$D(^DPT(DGDFN)),($G(^DPT(DGDFN,0))']"") K DGARR Q
73 S DGREL=$G(DGARR(408.12,DGIEN12_",",.02,"E"))
74 S DGREL=$$GETREL(DGREL)
75 D GETS^DIQ(2,DGDFN_",",".01;.09","EI","DGARR","DGERR")
76 I $D(DGERR) K DGARR,DGERR Q
77 S DGPATNAM=$G(DGARR(2,DGDFN_",",.01,"E"))
78 S DGPATSSN=$G(DGARR(2,DGDFN_",",.09,"I"))
79 S DGC=DGC+1
80 S ^TMP("DGEVC",$J,DGPATNAM,DGDFN,DGDEPNAM,DGIEN13)=DGPATSSN_"^"_DGREL_"^"_DGDEPSSN_"^"_DGREASON
81 S ^TMP("DGEVC",$J,"COUNT")=DGC
82 S ^TMP("DGEVC",$J,"COUNT",DGREASON)=$G(^TMP("DGEVC",$J,"COUNT",DGREASON))+1
83 K DGARR,DGDFN,DGERR,DGDEPNAM,DGDEPSSN,DGPATNAM,DGPATSSN,DGREASON,DGREL
84 Q
85HDR2 ;
86 N DGDATE,DGL,DGLINE,DGT,Y ;display veteran, non-vet or both
87 I $E(IOST,1,2)["C-" W @IOF
88 S DGPAGE=DGPAGE+1
89 W !?((IOM-46)\2),"Pseudo SSN Report for Means Test Dependents",?70,"Page:"_DGPAGE
90 S DGT="Report shows "_$S(DGXREAS="NULL":"<NONE ENTERED>",1:DGXREAS)
91 S DGL=$L(DGT)
92 W !?((IOM-DGL)\2),DGT
93 S Y=DT X ^DD("DD") S DGDATE=Y
94 W !?62,"Date: "_$G(DGDATE)
95 W !!,"PATIENT",?27,"PATIENT SSN"
96 W !?5,"DEPENDENT",?38,"RELATIONSHIP",?52,"DEP. PSSN",?64,"PSSN REASON"
97 N DGZ
98 W !
99 F DGZ=1:1:IOM W "-"
100 Q
101REP2(DGXREAS) ;
102 N DG0,DGCT,DGDNAM,DGIEN,DGN,DGPNAM,DGRR
103 S (DGDNAM,DGN,DGDFN,DGPNAM)=""
104 S DGCT=0
105 F S DGPNAM=$O(^TMP("DGEVC",$J,DGPNAM)) Q:DGPNAM']""!($G(DGQ)) D
106 . I DGPNAM="COUNT",($O(^TMP("DGEVC",$J,DGPNAM,""))'>0) Q
107 . F S DGDFN=$O(^TMP("DGEVC",$J,DGPNAM,DGDFN)) Q:DGDFN'>0!($G(DGQ)) D
108 . . N DG0
109 . . I $E(IOST,1,2)["C-",($Y>(IOSL-4)) D PAUSE^DGPSEUDO Q:$G(DGQ)
110 . . I $Y>(IOSL-4) D
111 . . . W @IOF
112 . . . D HDR2
113 . . S DG0=^DPT(DGDFN,0)
114 . . S DGSSN=$P(DG0,U,9)
115 . . W !!,$E($G(DGPNAM),1,25),?27,$G(DGSSN)
116 . . S (DGDNAM,DGIEN)=""
117 . . F S DGDNAM=$O(^TMP("DGEVC",$J,DGPNAM,DGDFN,DGDNAM)) Q:DGDNAM']""!($G(DGQ)) D
118 . . . F S DGIEN=$O(^TMP("DGEVC",$J,DGPNAM,DGDFN,DGDNAM,DGIEN)) Q:DGIEN'>0!($G(DGQ)) D
119 . . . . S DGN=^TMP("DGEVC",$J,DGPNAM,DGDFN,DGDNAM,DGIEN)
120 . . . . S DGRR=$P(DGN,U,4)
121 . . . . S DGRR=$S(DGRR["REF":"REF TO PROVIDE",DGRR["UNKN":"SSN UNK-F/U REQ",DGRR["NULL":"<NONE ENTERED>",1:DGRR)
122 . . . . I $E(IOST,1,2)["C-",($Y>(IOSL-4)) D PAUSE^DGPSEUDO Q:$G(DGQ)
123 . . . . I $Y>(IOSL-4) D
124 . . . . . W @IOF
125 . . . . . D HDR2
126 . . . . . W !,$E($G(DGPNAM),1,25),?27,$G(DGSSN)
127 . . . . W !?5,$G(DGDNAM),?38,$E($P(DGN,U,2),1,12),?52,$P(DGN,U,3),?64,$G(DGRR)
128 . . . . S DGCT=DGCT+1
129 I DGCT=DGC D
130 . I $E(IOST,1,2)["C-",($Y>(IOSL-6)) D PAUSE^DGPSEUDO Q:$G(DGQ)
131 . I $Y>(IOSL-6) D
132 . . W @IOF
133 . . D HDR2
134 . W !!?5,"Total number of dependents with Pseudo SSNs for this report: "_DGC
135 . I DGXREAS="ALL" D
136 . . W !?31,"Dependents who REFUSED TO PROVIDE: "_^TMP("DGEVC",$J,"COUNT","REFUSED TO PROVIDE")
137 . . W !?29,"Dependents who have NO SSN ASSIGNED: "_^TMP("DGEVC",$J,"COUNT","NO SSN ASSIGNED")
138 . . W !?33,"Dependents who have SSN UNKNOWN: "_^TMP("DGEVC",$J,"COUNT","SSN UNKNOWN/FOLLOW-UP REQUIRED")
139 . . W !?22,"Dependents who have no PSSN Reason entered: "_^TMP("DGEVC",$J,"COUNT","NULL")
140 W !
141 I $E(IOST,1,2)["C-",('$G(DGQ)) D PAUSE^DGPSEUDO
142 D ^%ZISC,HOME^%ZIS
143 Q
144GETREL(DGREL) ;some relationships will need to be abbreviated to fit the 12
145 ; char spacing limit
146 I DGREL']"" Q DGREL
147 I $P(DGREL,"-")="GREAT" S $P(DGREL,"-")="GR"
148 Q DGREL
Note: See TracBrowser for help on using the repository browser.