source: WorldVistAEHR/trunk/r/POLICE_AND_SECURITY-ES/ESP122P1.m@ 1150

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

initial load of WorldVistAEHR

File size: 8.7 KB
Line 
1ESP122P1 ;ALB/JAP; POST-INSTALL FOR ES*1 cont.*22;3/98
2 ;;1.0;POLICE & SECURITY;**22,28**;Mar 31, 1994
3 ;
4EN ;setup for print of conversion reports
5 N ESPC,ESPU,DIR,DIRUT,DTOUT,DUOUT,X,Y,PAGE,POP,ZTRTN,ZTDESC,ZTSK,ZTREQ
6 S (ESPC,ESPU)=0
7 S DIR(0)="S^C:Converted;U:User Input Needed;B:Both"
8 S DIR("A")="Type of report to print: ",DIR("B")="B"
9 D ^DIR K DIR W !! Q:$G(DIRUT)
10 S:"Cc"[Y ESPC=1 S:"Uu"[Y ESPU=1 S:"Bb"[Y (ESPC,ESPU)=1
11 S %ZIS="Q" D ^%ZIS
12 I POP D Q
13 .W !,"No device selected...exiting.",!
14 I $D(IO("Q")) D Q
15 .S ZTRTN="PRINT^ESP122P1",ZTDESC="Print ES*1*22 Conversion Report",ZTREQ="@"
16 .S ZTSAVE("ESPC")="",ZTSAVE("ESPU")=""
17 .D ^%ZTLOAD
18 .I $G(ZTSK)>0 D Q
19 ..W !,"Request queued as Task #",ZTSK,".",!
20 .I '$G(ZTSK) D
21 ..W !,"Request to queue cancelled...exiting.",!
22 ..S POP=1
23 S PAGE=0 K ESPUSER,ESPDATE D PRINT
24 Q
25 ;
26PRINT ;print reports
27 N LN,RUNDT,PAGE,E S E=0
28 U IO
29 S $P(LN,"=",80)=""
30 D NOW^%DTC S Y=$E(%,1,12),RUNDT=$$FMTE^XLFDT(Y,1)
31 I ESPC S PAGE=0 D CONV I 'E,'ESPU,$E(IOST)="C" D EOR
32 I 'E,ESPU S PAGE=0 D USER I 'E,$E(IOST)="C" D EOR
33 D ^%ZISC
34 U 0
35 Q
36EOR ;Pause at end of report.
37 ; The following two lines were added to prevent the report from
38 ; hanging on the screen. - VAD - 09/23/1999.
39 D ^%ZISC
40 U 0
41 ;
42 N SS,JJ,DIR
43 S SS=22-$Y F JJ=1:1:SS W !
44 S DIR(0)="E",DIR("A")="Press ANY Key to Exit" D ^DIR S E=$D(DIRUT)
45 Q
46 ;
47CONV ;converted report
48 ;^XTMP("ESP","CONV",ESIEN,ESN)=old subtype^new subtype^user^date/time
49 N FLAG,ESIEN,ESN,ESOLD,ESOLDNM,ESLAST,ESLSTNM,ESNEW,ESL,ESPDTR,ESUSER,ESCNVDT,ESPPREV,NN,X,Y,DIC,DR,DA,DIQ
50 D HDRC Q:E S ESIEN=0
51 I '$D(^XTMP("ESP","CONV")) D Q
52 .W !!,"There is no data in ^XTMP(""ESP"",""CONV"", to print."
53 F S ESIEN=$O(^XTMP("ESP","CONV",ESIEN)) Q:ESIEN="" D Q:E
54 .D:$Y+6>IOSL HDRC I E Q
55 .S ESPDTR=$P($G(^ESP(912,ESIEN,0)),U,2) Q:ESPDTR=""
56 .W !!!,"File #912 ien: ",ESIEN
57 .W ?45,"UOR# ",$E(ESPDTR,2,3),"-",$E(ESPDTR,4,5),"-",$E(ESPDTR,6,7),"-",$TR($E($P(ESPDTR,".",2)_"ZZZZ",1,4),"Z",0)
58 .K ^UTILITY("DIQ1",$J)
59 .S DIC="^ESP(912,",DA=ESIEN,DR=".02;.03;.04;.06;.08;5.02;5.05;5.06;6.01;6.02",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912,DA))
60 .W !,"DATE/TIME RECEIVED: ",$G(^UTILITY("DIQ1",$J,912,DA,.02,"E"))
61 .W !,"DATE/TIME OF OFFENSE: ",$G(^UTILITY("DIQ1",$J,912,DA,.03,"E"))
62 .D:$Y+4>IOSL HDRC I E Q
63 .W !,"LOCATION: ",$G(^UTILITY("DIQ1",$J,912,DA,.04,"E"))
64 .W !,"INVESTIGATING OFFICER: ",$G(^UTILITY("DIQ1",$J,912,DA,.06,"E"))
65 .D:$Y+4>IOSL HDRC I E Q
66 .W !,"CASE STATUS: ",$G(^UTILITY("DIQ1",$J,912,DA,.08,"E"))
67 .W ?45,"COMPLETED FLAG: ",$G(^UTILITY("DIQ1",$J,912,DA,5.02,"E"))
68 .S FLAG=$G(^UTILITY("DIQ1",$J,912,DA,5.05,"E")) D Q:E
69 ..Q:FLAG="" Q:FLAG["NONE"
70 ..D:$Y+3>IOSL HDRC I E Q
71 ..W !,"DELETED/REOPENED FLAG: ",FLAG
72 ..I $E(FLAG,1)="D" W ?45,"DATE/TIME: ",$G(^UTILITY("DIQ1",$J,912,DA,5.06,"E"))
73 ..I ($E(FLAG,1)="R")&($D(^UTILITY("DIQ1",$J,912,DA,6.02,"E"))) W ?45,"DATE/TIME: ",^UTILITY("DIQ1",$J,912,DA,6.02,"E"),!?45,"PREVIOUS ID#: ",$G(^UTILITY("DIQ1",$J,912,DA,6.01,"E"))
74 .I $D(^ESP(912,ESIEN,90)) D Q:E
75 ..D:$Y+4>IOSL HDRC I E Q
76 ..W !,"LOST/STOLEN PROPERTY:"
77 ..S ESL=0 F S ESL=$O(^ESP(912,ESIEN,90,ESL)) Q:ESL="" D Q:E
78 ...S DIC="^ESP(912,"_ESIEN_",90,",DA=ESL,DR=".01;.03",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912.1,DA))
79 ...D:$Y+3>IOSL HDRC I E Q
80 ...W !?5,$G(^UTILITY("DIQ1",$J,912.1,DA,.01,"E"))
81 ...W ?45,"LOSS: $",$G(^UTILITY("DIQ1",$J,912.1,DA,.03,"E"))
82 .S ESN=0 F S ESN=$O(^ESP(912,ESIEN,10,ESN)) Q:ESN="" D
83 ..S (ESOLD,ESUSER,ESCNVDT)=0,ESOLDNM=""
84 ..S ESOLD=$P($G(^XTMP("ESP","CONV",ESIEN,ESN)),U,1),ESUSER=$P($G(^XTMP("ESP","CONV",ESIEN,ESN)),U,3),ESCNVDT=$P($G(^XTMP("ESP","CONV",ESIEN,ESN)),U,4)
85 ..S DIC="^ESP(912,"_ESIEN_",10,",DA=ESN,DR=".01;.02;.03",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
86 ..D:$Y+4>IOSL HDRC I E Q
87 ..I ESOLD D Q:E
88 ...W !,"Converted to: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
89 ...I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
90 ...I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
91 ...W !,"Converted by: ",$E($P($G(^VA(200,ESUSER,0)),U,1),1,24),?45,"Date/time: ",ESCNVDT
92 ...;show previous conversion data, if any
93 ...S ESPPREV=$O(^XTMP("ESP","PREV",ESIEN,ESN,""),-1)
94 ...I ESPPREV S ESOLD=$P($G(^XTMP("ESP","PREV",ESIEN,ESN,1)),U,1)
95 ...I ESPPREV F NN=ESPPREV:-1:1 D Q:E
96 ....D:$Y+3>IOSL HDRC I E Q
97 ....S (ESLAST,ESUSER,ESCNVDT)=0,ESLSTNM=""
98 ....S ESLAST=$P($G(^XTMP("ESP","PREV",ESIEN,ESN,NN)),U,2),ESUSER=$P($G(^XTMP("ESP","PREV",ESIEN,ESN,NN)),U,3),ESCNVDT=$P($G(^XTMP("ESP","PREV",ESIEN,ESN,NN)),U,4)
99 ....Q:'ESLAST
100 ....S ESLSTNM=$P($G(^ESP(912.9,ESLAST,0)),U,1)
101 ....W !,"Converted to: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
102 ....I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
103 ....W "/",ESLSTNM
104 ....W !,"Converted by: ",$E($P($G(^VA(200,ESUSER,0)),U,1),1,24),?45,"Date/time: ",ESCNVDT
105 ...S ESOLDNM=$P($G(^ESP(912.9,ESOLD,0)),U,1)
106 ...D:$Y+3>IOSL HDRC I E Q
107 ...W !,"Original",!,"Classification: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
108 ...I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
109 ...W "/",ESOLDNM
110 ..I 'ESOLD D
111 ...W !,"Classification: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
112 ...I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
113 ...I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
114 Q
115 ;
116HDRC ;header for converted report
117 N Y,JJ,SS
118 I $E(IOST)="C" D I E Q
119 .S SS=22-$Y F JJ=1:1:SS W !
120 .I PAGE>1 S DIR(0)="E" D ^DIR S E=$D(DIRUT) K DIR
121 W:$Y!($E(IOST)="C") @IOF
122 S PAGE=PAGE+1
123 W !,"Patch ES*1*22 Conversion Report ",?55,"Page: ",PAGE
124 W !,"List of Converted Entries in File #912" W:PAGE=1 ?52,"Printed: ",RUNDT
125 I $D(ESPUSER),$D(ESPDATE) D
126 .W !,"Patch ES*1*22 Conversion Completion Report (cont.)"
127 .W ?52,"Printed: ",RUNDT
128 .W !,"Completed by: "_$E($P($G(^VA(200,ESPUSER,0)),U,1),1,24)
129 W !,LN
130 Q
131 ;
132USER ;user intervention needed report
133 ;^XTMP("ESP","USER",ESIEN,ESN)=old subtype_"^"_total$loss
134 N FLAG,ESIEN,ESN,ESOLD,ESOLDNM,ESNEW,ESL,ESPDTR,ESSTAR,NN,X,Y,DIC,DR,DA,DIQ
135 D HDRU Q:E S ESIEN=0
136 I '$D(^XTMP("ESP","USER")) D Q
137 .W !!,"There is no data in ^XTMP(""ESP"",""USER"", to print."
138 F S ESIEN=$O(^XTMP("ESP","USER",ESIEN)) Q:ESIEN="" D Q:E
139 .D:$Y+6>IOSL HDRU I E Q
140 .S ESPDTR=$P($G(^ESP(912,ESIEN,0)),U,2) Q:ESPDTR=""
141 .W !!!,"File #912 ien: ",ESIEN
142 .W ?45,"UOR# ",$E(ESPDTR,2,3),"-",$E(ESPDTR,4,5),"-",$E(ESPDTR,6,7),"-",$TR($E($P(ESPDTR,".",2)_"ZZZZ",1,4),"Z",0)
143 .K ^UTILITY("DIQ1",$J)
144 .S DIC="^ESP(912,",DA=ESIEN,DR=".02;.03;.04;.06;.08;5.02;5.05;5.06;6.01;6.02",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912,DA))
145 .W !,"DATE/TIME RECEIVED: ",$G(^UTILITY("DIQ1",$J,912,DA,.02,"E"))
146 .W !,"DATE/TIME OF OFFENSE: ",$G(^UTILITY("DIQ1",$J,912,DA,.03,"E"))
147 .D:$Y+4>IOSL HDRU I E Q
148 .W !,"LOCATION: ",$G(^UTILITY("DIQ1",$J,912,DA,.04,"E"))
149 .W !,"INVESTIGATING OFFICER: ",$G(^UTILITY("DIQ1",$J,912,DA,.06,"E"))
150 .D:$Y+4>IOSL HDRU I E Q
151 .W !,"CASE STATUS: ",$G(^UTILITY("DIQ1",$J,912,DA,.08,"E"))
152 .W ?45,"COMPLETED FLAG: ",$G(^UTILITY("DIQ1",$J,912,DA,5.02,"E"))
153 .S FLAG=$G(^UTILITY("DIQ1",$J,912,DA,5.05,"E")) D Q:E
154 ..Q:FLAG="" Q:FLAG["NONE"
155 ..D:$Y+4>IOSL HDRU I E Q
156 ..W !,"DELETED/REOPENED FLAG: ",FLAG
157 ..I $E(FLAG,1)="D" W ?45,"DATE/TIME: ",$G(^UTILITY("DIQ1",$J,912,DA,5.06,"E"))
158 ..I ($E(FLAG,1)="R")&($D(^UTILITY("DIQ1",$J,912,DA,6.02,"E"))) W ?45,"DATE/TIME: ",^UTILITY("DIQ1",$J,912,DA,6.02,"E"),!?45,"PREVIOUS ID#: ",$G(^UTILITY("DIQ1",$J,912,DA,6.01,"E"))
159 .I $D(^ESP(912,ESIEN,90)) D Q:E
160 ..D:$Y+4>IOSL HDRU I E Q
161 ..W !,"LOST/STOLEN PROPERTY:"
162 ..S ESL=0 F S ESL=$O(^ESP(912,ESIEN,90,ESL)) Q:ESL="" D Q:E
163 ...S DIC="^ESP(912,"_ESIEN_",90,",DA=ESL,DR=".01;.03",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912.1,DA))
164 ...D:$Y+3>IOSL HDRU I E Q
165 ...W !?5,$G(^UTILITY("DIQ1",$J,912.1,DA,.01,"E"))
166 ...W ?45,"LOSS: $",$G(^UTILITY("DIQ1",$J,912.1,DA,.03,"E"))
167 .S ESN=0 F S ESN=$O(^ESP(912,ESIEN,10,ESN)) Q:ESN="" D Q:E
168 ..S ESOLD=0 S ESSTAR=" "
169 ..S ESOLD=$P($G(^XTMP("ESP","USER",ESIEN,ESN)),U,1) I ESOLD S ESSTAR="** "
170 ..S DIC="^ESP(912,"_ESIEN_",10,",DA=ESN,DR=".01;.02;.03",DIQ(0)="E" D EN^DIQ1 Q:'$D(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
171 ..D:$Y+3>IOSL HDRU I E Q
172 ..W !,ESSTAR W "Classification: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
173 ..I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
174 ..I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
175 Q
176 ;
177HDRU ;header for user report
178 N Y,JJ,SS
179 I $E(IOST)="C" D I E Q
180 .S SS=22-$Y F JJ=1:1:SS W !
181 .I PAGE>1!(ESPC) S DIR(0)="E" D ^DIR S E=$D(DIRUT) K DIR
182 W:$Y!($E(IOST)="C") @IOF
183 S PAGE=PAGE+1
184 W !,"Patch ES*1*22 Conversion Report ",?55,"Page: ",PAGE
185 W !,"List of Unconverted Entries in File #912" W:PAGE=1 ?52,"Printed: ",RUNDT
186 W !," to be Reviewed by User"
187 I $D(ESPUSER),$D(ESPDATE) D
188 .W !,"Patch ES*1*22 Conversion Completion Report (cont.)"
189 .W ?52,"Printed: ",RUNDT
190 .W !,"Completed by: "_$E($P($G(^VA(200,ESPUSER,0)),U,1),1,24)
191 W !,LN
192 Q
Note: See TracBrowser for help on using the repository browser.