source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCRPI01A.m@ 773

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

initial load of FOIAVistA 6/30/08 version

File size: 5.4 KB
Line 
1SCRPI01A ;ALB/SCK - IEMM REPORT OF INCOMPLETE ENCOUNTERS PRINT ; 6/24/97
2 ;;5.3;Scheduling;**66**;AUG 13, 1993
3 Q
4PRINT ; Begin printing report
5 ; Variables
6 ; PAGE - Page Number
7 ; SDIV - Division Name
8 ; SDCLN - Clinic Name
9 ; SDNAME - Patient Name
10 ; SDT - Encounter Date
11 ; SCABORT - Abort report flag
12 ;
13 N DASH,DBLDASH,PAGE,SDIV,SDCLN,SDNAME,SDT,SCABORT,NONAME
14 ;
15 S $P(DASH,"-",IOM-1)="",$P(DBLDASH,"=",IOM-1)=""
16 S PAGE=0,SDIV=""
17 ;
18 I '$D(^TMP("SCRPI ERR",$J)) D HDR1 Q
19 ;
20 F S SDIV=$O(^TMP("SCRPI ERR",$J,SDIV)) Q:SDIV']"" D Q:$G(SCABORT)
21 . S SDCLN=""
22 . F S SDCLN=$O(^TMP("SCRPI ERR",$J,SDIV,SDCLN)) Q:SDCLN']"" D Q:$G(SCABORT)
23 .. D HDR(SDIV,SDCLN)
24 .. Q:$G(SCABORT)
25 .. S SDNAME=""
26 .. F S SDNAME=$O(^TMP("SCRPI ERR",$J,SDIV,SDCLN,SDNAME)) Q:SDNAME']"" D Q:$G(SCABORT)
27 ... S SDT="",NONAME=0
28 ... F S SDT=$O(^TMP("SCRPI ERR",$J,SDIV,SDCLN,SDNAME,SDT)) Q:'SDT D Q:$G(SCABORT)
29 .... S SDER=""
30 .... F S SDER=$O(^TMP("SCRPI ERR",$J,SDIV,SDCLN,SDNAME,SDT,SDER)) Q:'SDER D LINE(^TMP("SCRPI ERR",$J,SDIV,SDCLN,SDNAME,SDT,SDER,0)) Q:$G(SCABORT)
31 ;
32 D SELPAGE
33 Q
34 ;
35LINE(SDTMP) ; Print formatted line of the report. Check if task has been stopped by user.
36 ; Set abort flag to quit if stopped.
37 ; Input
38 ; SDTMP - formatted line to print
39 ;
40 ; Output
41 ; SCABORT - 1 if user aborts report printing
42 ;
43 ; Variables
44 ; SCERR - Error Code form #409.76
45 ; SCERR1 - Error Description from #409.76
46 ;
47 N X,X1,X2,SCERR,SCERR1,DFN
48 ;
49 ; ** if task has been stopped, set abort flag and quit.
50 I $$S^%ZTLOAD D Q
51 . S SCABORT=1
52 . W !!,"Report stopped by user"
53 ;
54 I $Y>(IOSL-5) D HDR(SDIV,SDCLN)
55 ;
56 ; ** Check that error is still around and has not been corrected.
57 Q:'$G(^SD(409.75,SDER,0))
58 S SCERR=^SD(409.76,$P(^SD(409.75,SDER,0),U,2),0)
59 S SCERR1=^SD(409.76,$P(^SD(409.75,SDER,0),U,2),1)
60 ;
61 S DFN=$P(SDTMP,U)
62 D PID^VADPT6
63 W !,$S('NONAME:$E(SDNAME,1,25),1:" "),?27,$S('NONAME:VA("BID"),1:" ")
64 W ?33,$S($P(SDTMP,U,3)]"":$P(SDTMP,U,3),1:" ")," "
65 W $$FMTE^XLFDT(SDT,"2FP"),?55,$S($P(SCERR,U,2)="V":"VISTA",$P(SCERR,U,2)="N":"NPCD ",1:"UNK "),?62,$P(SCERR,U)
66 ;
67 ; ** Parse out error description to fit report. If description length >50, then
68 ; call parse procedure to break description into two lines.
69 S X=$P(SCERR1,U)
70 I $L(X)<50 D
71 . W ?68,X
72 E D
73 . K X1,X2
74 . D PARSE^SCRPIUT1(X,.X1,.X2,45,51)
75 . W ?68,X1,!?68,X2
76 S NONAME=1
77 K VA
78 Q
79 ;
80HDR(SDIV,SDCLN) ; Print report header, if abort flag is set, then quit
81 ; Input
82 ; SDIV - Division Name
83 ; SDCLN - Clinic Name
84 ;
85 ; Variables
86 ; SDL - Print line
87 ;
88 N SDL,X
89 ;
90 I 'PAGE,IOST?1"C-".E W @IOF
91 I PAGE,IOST?1"C-".E D Q:$G(SCABORT)
92 . S DIR(0)="E" D ^DIR K DIR S SCABORT='+$G(Y)
93 . W @IOF
94 E D
95 . I PAGE W @IOF
96 ;
97 S PAGE=PAGE+1
98 W !?2,"Date: ",$$FDATE^VALM1($$DT^XLFDT),?((IOM/2)-22),"Incomplete Encounter Management Error Listing",?(IOM-13),"Page: ",PAGE
99 ;
100 S X="Division: "_$S($G(SDIV)]"":SDIV,1:" ---")
101 D CTR^SCRPIUT1(.X,IOM)
102 W !,X
103 ;
104 S X="Clinic: "_$S($G(SDCLN)]"":SDCLN,1:" ---")
105 D CTR^SCRPIUT1(.X,IOM)
106 W !,X
107 ;
108 S X="Date Range: "_$$FMTE^XLFDT($P(SDDT,U))_" to "_$$FMTE^XLFDT($P(SDDT,U,2))
109 D CTR^SCRPIUT1(.X,IOM)
110 W !,X
111 ;
112 S X="Selection Method by "_$$SELMTHD^SCRPI01(SDSEL1)_" then by "_$$SELMTHD^SCRPI01(SDSEL2)
113 D CTR^SCRPIUT1(.X,IOM)
114 W !,X
115 ;
116 W !!!,?35,"Encounter",?54,"Error",?62,"Error"
117 W !,"Patient Name",?27,"SSN",?35,"Date/Time",?54,"Srce",?62,"Code",?68,"Description"
118 W !,DBLDASH
119 S X="[ '*' Indicates Deleted Outpatient Encounter for Transmission ]"
120 D CTR^SCRPIUT1(.X,IOM)
121 W !,X,!
122 Q
123 ;
124HDR1 ; Report header for no data found. Prints modified header.
125 ;
126 W !?2,"Date: ",$$FDATE^VALM1($$DT^XLFDT),?((IOM/2)-22),"Incomplete Encounter Management Error Listing"
127 S X="Date Range: "_$$FMTE^XLFDT($P(SDDT,U))_" to "_$$FMTE^XLFDT($P(SDDT,U,2))
128 D CTR^SCRPIUT1(.X,IOM)
129 W !,X
130 S X="Selection Method by "_$$SELMTHD^SCRPI01(SDSEL1)_" then by "_$$SELMTHD^SCRPI01(SDSEL2)
131 D CTR^SCRPIUT1(.X,IOM)
132 W !,X,!!
133 W !?5,"No errors found"
134 D NEXTLEV(SDSEL1)
135 D NEXTLEV(SDSEL2)
136 Q
137 ;
138SELPAGE ; Print on last page the user parameters used for the report.
139 N SDIV,SDCLN,SDERR,SDPAT,SDDSS
140 ;
141 I 'PAGE,IOST?1"C-".E W @IOF
142 I PAGE,IOST?1"C-".E D Q:$G(SCABORT)
143 . S DIR(0)="E" D ^DIR K DIR S SCABORT='+$G(Y)
144 . W @IOF
145 E D
146 . I PAGE W @IOF
147 ;
148 S PAGE=PAGE+1
149 W !?2,"Date: ",$$FDATE^VALM1($$DT^XLFDT),?((IOM/2)-22),"Incomplete Encounter Management Error Listing",?(IOM-13),"Page: ",PAGE
150 S X="Report Selection Criteria"
151 D CTR^SCRPIUT1(X,IOM)
152 S X="Date Range: "_$$FMTE^XLFDT($P(SDDT,U))_" to "_$$FMTE^XLFDT($P(SDDT,U,2))
153 D CTR^SCRPIUT1(X,IOM)
154 ;
155 W !!?10,"Divisions: ",$S(VAUTD:"All",1:"")
156 I 'VAUTD S SDIV="" F S SDIV=$O(VAUTD(SDIV)) Q:'SDIV W !?15,VAUTD(SDIV)
157 ;
158 D NEXTLEV(SDSEL1)
159 D NEXTLEV(SDSEL2)
160 Q
161 ;
162NEXTLEV(SRT) ; Print out any sublevels of the user selection parameters
163 N SDITEM
164 ;
165 I SRT["CLN" D
166 . W !!?10,"Clinics: ",$S(VAUTC:"All",1:"")
167 . I 'VAUTC S SDITEM="" F S SDITEM=$O(VAUTC(SDITEM)) Q:'SDITEM W !?15,VAUTC(SDITEM)
168 ;
169 I SRT["PAT" D
170 . W !!?10,"Patients: ",$S(VAUTN:"All",1:"")
171 . I 'VAUTN S SDITEM="" F S SDITEM=$O(VAUTN(SDITEM)) Q:'SDITEM W !?15,VAUTN(SDITEM)
172 ;
173 I SRT["ERR" D
174 . W !!?10,"Error Codes: ",$S(VAUER:"All",1:"")
175 . I 'VAUER S SDITEM="" F S SDITEM=$O(VAUER(SDITEM)) Q:'SDITEM W !?15,VAUER(SDITEM)," ",$E($P(^SD(409.76,SDITEM,1),U),1,60)
176 ;
177 I SRT["DSS" D
178 . W !!?10,"Clinic Stop Codes: ",$S(VAUDS:"All",1:"")
179 . I 'VAUDS S SDITEM="" F S SDITEM=$O(VAUDS(SDITEM)) Q:'SDITEM W !?15,VAUDS(SDITEM)
180 Q
Note: See TracBrowser for help on using the repository browser.