source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCRPI02.m@ 1383

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

initial load of FOIAVistA 6/30/08 version

File size: 5.9 KB
Line 
1SCRPI02 ;ALB/SCK - Incomplete Encounter Mgmt Statistical Summary Report ; 2/4/97
2 ;;5.3;Scheduling;**66**;AUG 13, 1993
3 ;
4EN ; Entry point for summary report
5 ; Variables
6 ; VAUTD,VAUTC - VA variables
7 ; SDDT - Date range, Begin^End
8 ; SDRTYP - Report type S - Summary Only
9 ; D - Summary with Detail
10 ;
11 N VAUTD,VAUTC,SDDT,ZTSAVE,SDRTYP
12 ;
13 W !!,"Select Summary Report Only, or Summary Report with Detail",!
14 Q:$$REPORT(.SDRTYP)'>-1
15 ;
16 S:SDRTYP["S" (VAUTD,VAUTC)=1
17 I SDRTYP["D",$$DIV^SCRPIUT1<0 G ENQ
18 I SDRTYP["D",$$CLN^SCRPIUT1<0 G ENQ
19 ;
20 I '$$ASKDT(.SDDT) G ENQ
21 W !
22 F X="SDDT","VAUTC","VAUTD","VAUTC(","VAUTD(","SDRTYP" D
23 . S ZTSAVE(X)=""
24 ;
25 D EN^XUTMDEVQ("RPT^SCRPI02","IEMM Summary Error Report",.ZTSAVE)
26 D HOME^%ZIS
27ENQ Q
28 ;
29ENBLT ; Entry point for bulletin generation of summary only report
30 ; Variables
31 ; SDBLT - Flag to send output to a bulletin
32 ; SDRTYP - See above
33 ; SDDT - See above
34 ;
35 N SDBLT,VAUTC,VAUTD,SDRTYP,SDDT
36 ;
37 S SDBLT=1,SDRTYP="S",(VAUTD,VAUTC)=1
38 S SDDT=$$FMADD^XLFDT($$DT^XLFDT,-2)_"^"_$$DT^XLFDT
39 D RPT^SCRPI02
40 Q
41 ;
42RPT ; Entry point for building the summary report
43 N SCCNT
44 ;
45 K ^TMP("SCRPI SUM",$J)
46 S SCCNT=0
47 Q:"SD"'[SDRTYP
48 ;
49 I '$G(SDBLT) I '$D(ZTQUEUED),IOST?1"C-".E D WAIT^DICD
50 D BLD,BLDDEL
51 D PRINT^SCRPI02A
52 ;
53EXIT ;
54 K ^TMP("SCRPI SUM",$J)
55 Q
56 ;
57BLD ; Search for errors in the transmitted outpatient encounter error file
58 ; and begin building the report
59 ;
60 ; Variables
61 ; SDEND - Ending date of date range
62 ; SDOEDT - Encounter date
63 ; SDOE - Encounter IEN in #409.68
64 ;
65 ; Output
66 ; ^TMP("SCRPI SUM",$J,Division Name,Clinic Name,0)=P1^P2^P3^P4
67 ; P1 - Total Incomplete Encounters
68 ; P2 - Total Incomplete Deleted Encounters
69 ; P3 - Total Encounters
70 ; P4 - Total Deleted Encounters
71 ;
72 N SDEND,SDOE,SDOEDT
73 ;
74 S SDCNT=0
75 S SDOEDT=$P(SDDT,U)-.1,SDEND=$P(SDDT,U,2)+.9
76 F S SDOEDT=$O(^SCE("B",SDOEDT)) Q:'SDOEDT!(SDOEDT>SDEND) D
77 . S SDOE=0 F S SDOE=$O(^SCE("B",SDOEDT,SDOE)) Q:'SDOE D
78 .. Q:'$D(^SD(409.73,"AENC",SDOE))
79 .. S SDIV=+$P($G(^SCE(SDOE,0)),U,11) Q:'SDIV
80 .. S SDIVN=$P($G(^DG(40.8,SDIV,0)),U)
81 .. Q:$S(VAUTD:0,$D(VAUTD(SDIV)):0,1:1)
82 .. S SDDCL=+$P($G(^SCE(SDOE,0)),U,4) Q:'SDDCL
83 .. S SDDCLN=$P($G(^SC(SDDCL,0)),U)
84 .. Q:$S(VAUTC:0,$D(VAUTC(SDDCL)):0,1:1)
85 .. S SDXMT=$O(^SD(409.73,"AENC",SDOE,0)) Q:'$D(^SD(409.73,SDXMT))
86 .. S $P(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,0),U,3)=+$P($G(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,0)),U,3)+1
87 .. Q:'$D(^SD(409.75,"B",SDXMT))
88 .. S $P(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,0),U)=+$P($G(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,0)),U)+1
89 .. D ADD(SDXMT,SDIV,SDIVN,SDDCL,SDDCLN,1)
90 Q
91 ;
92BLDDEL ; Search for entries in the Deleted Outpatient Encounter File and add to
93 ; the report.
94 ; Variables
95 ; See list in BLD
96 ;
97 N SDOEDT,SDEND,SDOE
98 ;
99 S SDCNT=0
100 S SDOEDT=$P(SDDT,U)-.1,SDEND=$P(SDDT,U,2)+.9
101 F S SDOEDT=$O(^SD(409.74,"B",SDOEDT)) Q:'SDOEDT!(SDOEDT>SDEND) D
102 . S SDOE=0 F S SDOE=$O(^SD(409.74,"B",SDOEDT,SDOE)) Q:'SDOE D
103 .. Q:'$D(^SD(409.73,"ADEL",SDOE))
104 .. S SDIV=+$P($G(^SD(409.74,SDOE,1)),U,11) Q:'SDIV
105 .. S SDIVN=$P($G(^DG(40.8,SDIV,0)),U)
106 .. Q:$S(VAUTD:0,$D(VAUTD(SDIV)):0,1:1)
107 .. S SDDCL=+$P($G(^SD(409.74,SDOE,1)),U,4) Q:'SDDCL
108 .. S SDDCLN=$P($G(^SC(SDDCL,0)),U)
109 .. Q:$S(VAUTC:0,$D(VAUTC(SDDCL)):0,1:1)
110 .. S SDXMT=$O(^SD(409.73,"ADEL",SDOE,0)) Q:'$D(^SD(409.73,SDXMT))
111 .. Q:'$D(^SD(409.75,"B",SDXMT))
112 .. S $P(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,0),U,4)=+$P($G(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,0)),U,4)+1
113 .. D ADD(SDXMT,SDIV,SDIVN,SDDCL,SDDCLN,2)
114 Q
115 ;
116ADD(SDXMT,SDIV,SDIVN,SDDCL,SDDCLN,SDPCE) ; Add error entries from #409.75
117 ; for transmission entry.
118 ; Input
119 ; SDXMT - Pointer to #409.75
120 ; SDIV - Division IEN
121 ; SDIVN - Division Name
122 ; SDDCL - Clinic IEN
123 ; SDDCLN - Clinic Name
124 ; SDPCE - Piece to increment in ^TMP("SCRPI SUM",$J...
125 ; 1 - Incomplete Encounter (P1)
126 ; 2 - Deleted Incomplete Encounter (P2)
127 ;
128 ; Output
129 ; ^TMP("SCRPI SUM",$J,Div Name, Clin Name, Error Table IEN,0)=P1^P2
130 ;
131 ; Variables
132 ; SCDE - #409.75 IEN
133 ; SCER - Pointer to #409.76
134 ;
135 N SCDE,SCER
136 ;
137 S SCDE=0 F S SCDE=$O(^SD(409.75,"B",SDXMT,SCDE)) Q:'SCDE D
138 . S SCER=$P($G(^SD(409.75,SCDE,0)),U,2) Q:'SCER
139 . S $P(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,SCER,0),U,SDPCE)=+$P($G(^TMP("SCRPI SUM",$J,SDIVN,SDDCLN,SCER,0)),U)+1
140 . S SDCNT=SDCNT+1
141 . I '$D(ZTQUEUED),(IOST?1"C-".E),(SDCNT#10=0) W "."
142 Q
143 ;
144REPORT(SDR) ; Select type of summary report
145 ; Variable Input
146 ; SDR - Returns with Report Type S - Summary Only,
147 ; D - Summary with detail
148 ;
149 ; Returns
150 ; 1 - Ok
151 ; -1 - No report type selected
152 N NX,Y
153 ;
154 S SDR=""
155 S DIR(0)="YA",DIR("A")="Summary report only? ",DIR("B")="YES"
156 S DIR("?")="Answer with Yes or No."
157 S DIR("??")="^D HELP^SCRPI02"
158 D ^DIR K DIR I $D(DIRUT) S Y=-1 G RPTQ
159 S SDR=$S(Y:"S",1:"D")
160RPTQ Q Y
161 ;
162ASKDT(SDT) ; Ask for date range for report
163 ; Variable Input
164 ; SDT - Returns date range as Begin^End
165 ;
166 ; Returns
167 ; 1 - Date range selected
168 ; 0 - No date range selected
169 ;
170 S SDBDT=$$FMADD^XLFDT($$DT^XLFDT,-7)
171 W !!,"Date Range for Encounters"
172 S DIR(0)="DA^2961001:NOW:EXP",DIR("A")="Enter beginning date for search: "
173 S DIR("?")="^D HELP^%DTC"
174 S DIR("B")=$$FMTE^XLFDT(SDBDT)
175 D ^DIR I $D(DIRUT) K SDT G ASKQ
176 K DIRUT
177 S SDT=Y
178 ;
179 S DIR("A")="Enter ending date for search: "
180 S DIR("B")="TODAY"
181 D ^DIR K DIR I $D(DIRUT) K SDT G ASKQ
182 K DIRUT
183 S $P(SDT,U,2)=Y
184ASKQ Q $G(SDT)>0
185 ;
186HELP ;
187 W !?2,"Answering YES, will provide a table of all clinics,"
188 W !?2,"showing total encounters, number of incomplete encounters, and"
189 W !?2,"percentage. Answering NO will include a list of error details "
190 W !?2,"for each selected clinic, in decsending order of occurrence,"
191 W !?2,"and the number of encounters and incomplete encounters.",!
192 Q
Note: See TracBrowser for help on using the repository browser.