ESP122P1 ;ALB/JAP; POST-INSTALL FOR ES*1 cont.*22;3/98
;;1.0;POLICE & SECURITY;**22,28**;Mar 31, 1994
;
EN ;setup for print of conversion reports
N ESPC,ESPU,DIR,DIRUT,DTOUT,DUOUT,X,Y,PAGE,POP,ZTRTN,ZTDESC,ZTSK,ZTREQ
S (ESPC,ESPU)=0
S DIR(0)="S^C:Converted;U:User Input Needed;B:Both"
S DIR("A")="Type of report to print: ",DIR("B")="B"
D ^DIR K DIR W !! Q:$G(DIRUT)
S:"Cc"[Y ESPC=1 S:"Uu"[Y ESPU=1 S:"Bb"[Y (ESPC,ESPU)=1
S %ZIS="Q" D ^%ZIS
I POP D Q
.W !,"No device selected...exiting.",!
I $D(IO("Q")) D Q
.S ZTRTN="PRINT^ESP122P1",ZTDESC="Print ES*1*22 Conversion Report",ZTREQ="@"
.S ZTSAVE("ESPC")="",ZTSAVE("ESPU")=""
.D ^%ZTLOAD
.I $G(ZTSK)>0 D Q
..W !,"Request queued as Task #",ZTSK,".",!
.I '$G(ZTSK) D
..W !,"Request to queue cancelled...exiting.",!
..S POP=1
S PAGE=0 K ESPUSER,ESPDATE D PRINT
Q
;
PRINT ;print reports
N LN,RUNDT,PAGE,E S E=0
U IO
S $P(LN,"=",80)=""
D NOW^%DTC S Y=$E(%,1,12),RUNDT=$$FMTE^XLFDT(Y,1)
I ESPC S PAGE=0 D CONV I 'E,'ESPU,$E(IOST)="C" D EOR
I 'E,ESPU S PAGE=0 D USER I 'E,$E(IOST)="C" D EOR
D ^%ZISC
U 0
Q
EOR ;Pause at end of report.
; The following two lines were added to prevent the report from
; hanging on the screen. - VAD - 09/23/1999.
D ^%ZISC
U 0
;
N SS,JJ,DIR
S SS=22-$Y F JJ=1:1:SS W !
S DIR(0)="E",DIR("A")="Press ANY Key to Exit" D ^DIR S E=$D(DIRUT)
Q
;
CONV ;converted report
;^XTMP("ESP","CONV",ESIEN,ESN)=old subtype^new subtype^user^date/time
N FLAG,ESIEN,ESN,ESOLD,ESOLDNM,ESLAST,ESLSTNM,ESNEW,ESL,ESPDTR,ESUSER,ESCNVDT,ESPPREV,NN,X,Y,DIC,DR,DA,DIQ
D HDRC Q:E S ESIEN=0
I '$D(^XTMP("ESP","CONV")) D Q
.W !!,"There is no data in ^XTMP(""ESP"",""CONV"", to print."
F S ESIEN=$O(^XTMP("ESP","CONV",ESIEN)) Q:ESIEN="" D Q:E
.D:$Y+6>IOSL HDRC I E Q
.S ESPDTR=$P($G(^ESP(912,ESIEN,0)),U,2) Q:ESPDTR=""
.W !!!,"File #912 ien: ",ESIEN
.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)
.K ^UTILITY("DIQ1",$J)
.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))
.W !,"DATE/TIME RECEIVED: ",$G(^UTILITY("DIQ1",$J,912,DA,.02,"E"))
.W !,"DATE/TIME OF OFFENSE: ",$G(^UTILITY("DIQ1",$J,912,DA,.03,"E"))
.D:$Y+4>IOSL HDRC I E Q
.W !,"LOCATION: ",$G(^UTILITY("DIQ1",$J,912,DA,.04,"E"))
.W !,"INVESTIGATING OFFICER: ",$G(^UTILITY("DIQ1",$J,912,DA,.06,"E"))
.D:$Y+4>IOSL HDRC I E Q
.W !,"CASE STATUS: ",$G(^UTILITY("DIQ1",$J,912,DA,.08,"E"))
.W ?45,"COMPLETED FLAG: ",$G(^UTILITY("DIQ1",$J,912,DA,5.02,"E"))
.S FLAG=$G(^UTILITY("DIQ1",$J,912,DA,5.05,"E")) D Q:E
..Q:FLAG="" Q:FLAG["NONE"
..D:$Y+3>IOSL HDRC I E Q
..W !,"DELETED/REOPENED FLAG: ",FLAG
..I $E(FLAG,1)="D" W ?45,"DATE/TIME: ",$G(^UTILITY("DIQ1",$J,912,DA,5.06,"E"))
..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"))
.I $D(^ESP(912,ESIEN,90)) D Q:E
..D:$Y+4>IOSL HDRC I E Q
..W !,"LOST/STOLEN PROPERTY:"
..S ESL=0 F S ESL=$O(^ESP(912,ESIEN,90,ESL)) Q:ESL="" D Q:E
...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))
...D:$Y+3>IOSL HDRC I E Q
...W !?5,$G(^UTILITY("DIQ1",$J,912.1,DA,.01,"E"))
...W ?45,"LOSS: $",$G(^UTILITY("DIQ1",$J,912.1,DA,.03,"E"))
.S ESN=0 F S ESN=$O(^ESP(912,ESIEN,10,ESN)) Q:ESN="" D
..S (ESOLD,ESUSER,ESCNVDT)=0,ESOLDNM=""
..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)
..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"))
..D:$Y+4>IOSL HDRC I E Q
..I ESOLD D Q:E
...W !,"Converted to: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
...I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
...I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
...W !,"Converted by: ",$E($P($G(^VA(200,ESUSER,0)),U,1),1,24),?45,"Date/time: ",ESCNVDT
...;show previous conversion data, if any
...S ESPPREV=$O(^XTMP("ESP","PREV",ESIEN,ESN,""),-1)
...I ESPPREV S ESOLD=$P($G(^XTMP("ESP","PREV",ESIEN,ESN,1)),U,1)
...I ESPPREV F NN=ESPPREV:-1:1 D Q:E
....D:$Y+3>IOSL HDRC I E Q
....S (ESLAST,ESUSER,ESCNVDT)=0,ESLSTNM=""
....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)
....Q:'ESLAST
....S ESLSTNM=$P($G(^ESP(912.9,ESLAST,0)),U,1)
....W !,"Converted to: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
....I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
....W "/",ESLSTNM
....W !,"Converted by: ",$E($P($G(^VA(200,ESUSER,0)),U,1),1,24),?45,"Date/time: ",ESCNVDT
...S ESOLDNM=$P($G(^ESP(912.9,ESOLD,0)),U,1)
...D:$Y+3>IOSL HDRC I E Q
...W !,"Original",!,"Classification: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
...I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
...W "/",ESOLDNM
..I 'ESOLD D
...W !,"Classification: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
...I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
...I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
Q
;
HDRC ;header for converted report
N Y,JJ,SS
I $E(IOST)="C" D I E Q
.S SS=22-$Y F JJ=1:1:SS W !
.I PAGE>1 S DIR(0)="E" D ^DIR S E=$D(DIRUT) K DIR
W:$Y!($E(IOST)="C") @IOF
S PAGE=PAGE+1
W !,"Patch ES*1*22 Conversion Report ",?55,"Page: ",PAGE
W !,"List of Converted Entries in File #912" W:PAGE=1 ?52,"Printed: ",RUNDT
I $D(ESPUSER),$D(ESPDATE) D
.W !,"Patch ES*1*22 Conversion Completion Report (cont.)"
.W ?52,"Printed: ",RUNDT
.W !,"Completed by: "_$E($P($G(^VA(200,ESPUSER,0)),U,1),1,24)
W !,LN
Q
;
USER ;user intervention needed report
;^XTMP("ESP","USER",ESIEN,ESN)=old subtype_"^"_total$loss
N FLAG,ESIEN,ESN,ESOLD,ESOLDNM,ESNEW,ESL,ESPDTR,ESSTAR,NN,X,Y,DIC,DR,DA,DIQ
D HDRU Q:E S ESIEN=0
I '$D(^XTMP("ESP","USER")) D Q
.W !!,"There is no data in ^XTMP(""ESP"",""USER"", to print."
F S ESIEN=$O(^XTMP("ESP","USER",ESIEN)) Q:ESIEN="" D Q:E
.D:$Y+6>IOSL HDRU I E Q
.S ESPDTR=$P($G(^ESP(912,ESIEN,0)),U,2) Q:ESPDTR=""
.W !!!,"File #912 ien: ",ESIEN
.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)
.K ^UTILITY("DIQ1",$J)
.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))
.W !,"DATE/TIME RECEIVED: ",$G(^UTILITY("DIQ1",$J,912,DA,.02,"E"))
.W !,"DATE/TIME OF OFFENSE: ",$G(^UTILITY("DIQ1",$J,912,DA,.03,"E"))
.D:$Y+4>IOSL HDRU I E Q
.W !,"LOCATION: ",$G(^UTILITY("DIQ1",$J,912,DA,.04,"E"))
.W !,"INVESTIGATING OFFICER: ",$G(^UTILITY("DIQ1",$J,912,DA,.06,"E"))
.D:$Y+4>IOSL HDRU I E Q
.W !,"CASE STATUS: ",$G(^UTILITY("DIQ1",$J,912,DA,.08,"E"))
.W ?45,"COMPLETED FLAG: ",$G(^UTILITY("DIQ1",$J,912,DA,5.02,"E"))
.S FLAG=$G(^UTILITY("DIQ1",$J,912,DA,5.05,"E")) D Q:E
..Q:FLAG="" Q:FLAG["NONE"
..D:$Y+4>IOSL HDRU I E Q
..W !,"DELETED/REOPENED FLAG: ",FLAG
..I $E(FLAG,1)="D" W ?45,"DATE/TIME: ",$G(^UTILITY("DIQ1",$J,912,DA,5.06,"E"))
..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"))
.I $D(^ESP(912,ESIEN,90)) D Q:E
..D:$Y+4>IOSL HDRU I E Q
..W !,"LOST/STOLEN PROPERTY:"
..S ESL=0 F S ESL=$O(^ESP(912,ESIEN,90,ESL)) Q:ESL="" D Q:E
...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))
...D:$Y+3>IOSL HDRU I E Q
...W !?5,$G(^UTILITY("DIQ1",$J,912.1,DA,.01,"E"))
...W ?45,"LOSS: $",$G(^UTILITY("DIQ1",$J,912.1,DA,.03,"E"))
.S ESN=0 F S ESN=$O(^ESP(912,ESIEN,10,ESN)) Q:ESN="" D Q:E
..S ESOLD=0 S ESSTAR=" "
..S ESOLD=$P($G(^XTMP("ESP","USER",ESIEN,ESN)),U,1) I ESOLD S ESSTAR="** "
..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"))
..D:$Y+3>IOSL HDRU I E Q
..W !,ESSTAR W "Classification: ",$G(^UTILITY("DIQ1",$J,912.01,DA,.01,"E"))
..I $G(^UTILITY("DIQ1",$J,912.01,DA,.02,"E"))]"" W "/",^("E")
..I $G(^UTILITY("DIQ1",$J,912.01,DA,.03,"E"))]"" W "/",^("E")
Q
;
HDRU ;header for user report
N Y,JJ,SS
I $E(IOST)="C" D I E Q
.S SS=22-$Y F JJ=1:1:SS W !
.I PAGE>1!(ESPC) S DIR(0)="E" D ^DIR S E=$D(DIRUT) K DIR
W:$Y!($E(IOST)="C") @IOF
S PAGE=PAGE+1
W !,"Patch ES*1*22 Conversion Report ",?55,"Page: ",PAGE
W !,"List of Unconverted Entries in File #912" W:PAGE=1 ?52,"Printed: ",RUNDT
W !," to be Reviewed by User"
I $D(ESPUSER),$D(ESPDATE) D
.W !,"Patch ES*1*22 Conversion Completion Report (cont.)"
.W ?52,"Printed: ",RUNDT
.W !,"Completed by: "_$E($P($G(^VA(200,ESPUSER,0)),U,1),1,24)
W !,LN
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HESP122P1 9081 printed Dec 13, 2024@02:29:29 Page 2
ESP122P1 ;ALB/JAP; POST-INSTALL FOR ES*1 cont.*22;3/98
+1 ;;1.0;POLICE & SECURITY;**22,28**;Mar 31, 1994
+2 ;
EN ;setup for print of conversion reports
+1 NEW ESPC,ESPU,DIR,DIRUT,DTOUT,DUOUT,X,Y,PAGE,POP,ZTRTN,ZTDESC,ZTSK,ZTREQ
+2 SET (ESPC,ESPU)=0
+3 SET DIR(0)="S^C:Converted;U:User Input Needed;B:Both"
+4 SET DIR("A")="Type of report to print: "
SET DIR("B")="B"
+5 DO ^DIR
KILL DIR
WRITE !!
if $GET(DIRUT)
QUIT
+6 if "Cc"[Y
SET ESPC=1
if "Uu"[Y
SET ESPU=1
if "Bb"[Y
SET (ESPC,ESPU)=1
+7 SET %ZIS="Q"
DO ^%ZIS
+8 IF POP
Begin DoDot:1
+9 WRITE !,"No device selected...exiting.",!
End DoDot:1
QUIT
+10 IF $DATA(IO("Q"))
Begin DoDot:1
+11 SET ZTRTN="PRINT^ESP122P1"
SET ZTDESC="Print ES*1*22 Conversion Report"
SET ZTREQ="@"
+12 SET ZTSAVE("ESPC")=""
SET ZTSAVE("ESPU")=""
+13 DO ^%ZTLOAD
+14 IF $GET(ZTSK)>0
Begin DoDot:2
+15 WRITE !,"Request queued as Task #",ZTSK,".",!
End DoDot:2
QUIT
+16 IF '$GET(ZTSK)
Begin DoDot:2
+17 WRITE !,"Request to queue cancelled...exiting.",!
+18 SET POP=1
End DoDot:2
End DoDot:1
QUIT
+19 SET PAGE=0
KILL ESPUSER,ESPDATE
DO PRINT
+20 QUIT
+21 ;
PRINT ;print reports
+1 NEW LN,RUNDT,PAGE,E
SET E=0
+2 USE IO
+3 SET $PIECE(LN,"=",80)=""
+4 DO NOW^%DTC
SET Y=$EXTRACT(%,1,12)
SET RUNDT=$$FMTE^XLFDT(Y,1)
+5 IF ESPC
SET PAGE=0
DO CONV
IF 'E
IF 'ESPU
IF $EXTRACT(IOST)="C"
DO EOR
+6 IF 'E
IF ESPU
SET PAGE=0
DO USER
IF 'E
IF $EXTRACT(IOST)="C"
DO EOR
+7 DO ^%ZISC
+8 USE 0
+9 QUIT
EOR ;Pause at end of report.
+1 ; The following two lines were added to prevent the report from
+2 ; hanging on the screen. - VAD - 09/23/1999.
+3 DO ^%ZISC
+4 USE 0
+5 ;
+6 NEW SS,JJ,DIR
+7 SET SS=22-$Y
FOR JJ=1:1:SS
WRITE !
+8 SET DIR(0)="E"
SET DIR("A")="Press ANY Key to Exit"
DO ^DIR
SET E=$DATA(DIRUT)
+9 QUIT
+10 ;
CONV ;converted report
+1 ;^XTMP("ESP","CONV",ESIEN,ESN)=old subtype^new subtype^user^date/time
+2 NEW FLAG,ESIEN,ESN,ESOLD,ESOLDNM,ESLAST,ESLSTNM,ESNEW,ESL,ESPDTR,ESUSER,ESCNVDT,ESPPREV,NN,X,Y,DIC,DR,DA,DIQ
+3 DO HDRC
if E
QUIT
SET ESIEN=0
+4 IF '$DATA(^XTMP("ESP","CONV"))
Begin DoDot:1
+5 WRITE !!,"There is no data in ^XTMP(""ESP"",""CONV"", to print."
End DoDot:1
QUIT
+6 FOR
SET ESIEN=$ORDER(^XTMP("ESP","CONV",ESIEN))
if ESIEN=""
QUIT
Begin DoDot:1
+7 if $Y+6>IOSL
DO HDRC
IF E
QUIT
+8 SET ESPDTR=$PIECE($GET(^ESP(912,ESIEN,0)),U,2)
if ESPDTR=""
QUIT
+9 WRITE !!!,"File #912 ien: ",ESIEN
+10 WRITE ?45,"UOR# ",$EXTRACT(ESPDTR,2,3),"-",$EXTRACT(ESPDTR,4,5),"-",$EXTRACT(ESPDTR,6,7),"-",$TRANSLATE($EXTRACT($PIECE(ESPDTR,".",2)_"ZZZZ",1,4),"Z",0)
+11 KILL ^UTILITY("DIQ1",$JOB)
+12 SET DIC="^ESP(912,"
SET DA=ESIEN
SET DR=".02;.03;.04;.06;.08;5.02;5.05;5.06;6.01;6.02"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912,DA))
QUIT
+13 WRITE !,"DATE/TIME RECEIVED: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.02,"E"))
+14 WRITE !,"DATE/TIME OF OFFENSE: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.03,"E"))
+15 if $Y+4>IOSL
DO HDRC
IF E
QUIT
+16 WRITE !,"LOCATION: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.04,"E"))
+17 WRITE !,"INVESTIGATING OFFICER: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.06,"E"))
+18 if $Y+4>IOSL
DO HDRC
IF E
QUIT
+19 WRITE !,"CASE STATUS: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.08,"E"))
+20 WRITE ?45,"COMPLETED FLAG: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,5.02,"E"))
+21 SET FLAG=$GET(^UTILITY("DIQ1",$JOB,912,DA,5.05,"E"))
Begin DoDot:2
+22 if FLAG=""
QUIT
if FLAG["NONE"
QUIT
+23 if $Y+3>IOSL
DO HDRC
IF E
QUIT
+24 WRITE !,"DELETED/REOPENED FLAG: ",FLAG
+25 IF $EXTRACT(FLAG,1)="D"
WRITE ?45,"DATE/TIME: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,5.06,"E"))
+26 IF ($EXTRACT(FLAG,1)="R")&($DATA(^UTILITY("DIQ1",$JOB,912,DA,6.02,"E")))
WRITE ?45,"DATE/TIME: ",^UTILITY("DIQ1",$JOB,912,DA,6.02,"E"),!?45,"PREVIOUS ID#: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,6.01,"E"))
End DoDot:2
if E
QUIT
+27 IF $DATA(^ESP(912,ESIEN,90))
Begin DoDot:2
+28 if $Y+4>IOSL
DO HDRC
IF E
QUIT
+29 WRITE !,"LOST/STOLEN PROPERTY:"
+30 SET ESL=0
FOR
SET ESL=$ORDER(^ESP(912,ESIEN,90,ESL))
if ESL=""
QUIT
Begin DoDot:3
+31 SET DIC="^ESP(912,"_ESIEN_",90,"
SET DA=ESL
SET DR=".01;.03"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912.1,DA))
QUIT
+32 if $Y+3>IOSL
DO HDRC
IF E
QUIT
+33 WRITE !?5,$GET(^UTILITY("DIQ1",$JOB,912.1,DA,.01,"E"))
+34 WRITE ?45,"LOSS: $",$GET(^UTILITY("DIQ1",$JOB,912.1,DA,.03,"E"))
End DoDot:3
if E
QUIT
End DoDot:2
if E
QUIT
+35 SET ESN=0
FOR
SET ESN=$ORDER(^ESP(912,ESIEN,10,ESN))
if ESN=""
QUIT
Begin DoDot:2
+36 SET (ESOLD,ESUSER,ESCNVDT)=0
SET ESOLDNM=""
+37 SET ESOLD=$PIECE($GET(^XTMP("ESP","CONV",ESIEN,ESN)),U,1)
SET ESUSER=$PIECE($GET(^XTMP("ESP","CONV",ESIEN,ESN)),U,3)
SET ESCNVDT=$PIECE($GET(^XTMP("ESP","CONV",ESIEN,ESN)),U,4)
+38 SET DIC="^ESP(912,"_ESIEN_",10,"
SET DA=ESN
SET DR=".01;.02;.03"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
QUIT
+39 if $Y+4>IOSL
DO HDRC
IF E
QUIT
+40 IF ESOLD
Begin DoDot:3
+41 WRITE !,"Converted to: ",$GET(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
+42 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.02,"E"))]""
WRITE "/",^("E")
+43 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.03,"E"))]""
WRITE "/",^("E")
+44 WRITE !,"Converted by: ",$EXTRACT($PIECE($GET(^VA(200,ESUSER,0)),U,1),1,24),?45,"Date/time: ",ESCNVDT
+45 ;show previous conversion data, if any
+46 SET ESPPREV=$ORDER(^XTMP("ESP","PREV",ESIEN,ESN,""),-1)
+47 IF ESPPREV
SET ESOLD=$PIECE($GET(^XTMP("ESP","PREV",ESIEN,ESN,1)),U,1)
+48 IF ESPPREV
FOR NN=ESPPREV:-1:1
Begin DoDot:4
+49 if $Y+3>IOSL
DO HDRC
IF E
QUIT
+50 SET (ESLAST,ESUSER,ESCNVDT)=0
SET ESLSTNM=""
+51 SET ESLAST=$PIECE($GET(^XTMP("ESP","PREV",ESIEN,ESN,NN)),U,2)
SET ESUSER=$PIECE($GET(^XTMP("ESP","PREV",ESIEN,ESN,NN)),U,3)
SET ESCNVDT=$PIECE($GET(^XTMP("ESP","PREV",ESIEN,ESN,NN)),U,4)
+52 if 'ESLAST
QUIT
+53 SET ESLSTNM=$PIECE($GET(^ESP(912.9,ESLAST,0)),U,1)
+54 WRITE !,"Converted to: ",$GET(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
+55 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.02,"E"))]""
WRITE "/",^("E")
+56 WRITE "/",ESLSTNM
+57 WRITE !,"Converted by: ",$EXTRACT($PIECE($GET(^VA(200,ESUSER,0)),U,1),1,24),?45,"Date/time: ",ESCNVDT
End DoDot:4
if E
QUIT
+58 SET ESOLDNM=$PIECE($GET(^ESP(912.9,ESOLD,0)),U,1)
+59 if $Y+3>IOSL
DO HDRC
IF E
QUIT
+60 WRITE !,"Original",!,"Classification: ",$GET(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
+61 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.02,"E"))]""
WRITE "/",^("E")
+62 WRITE "/",ESOLDNM
End DoDot:3
if E
QUIT
+63 IF 'ESOLD
Begin DoDot:3
+64 WRITE !,"Classification: ",$GET(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
+65 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.02,"E"))]""
WRITE "/",^("E")
+66 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.03,"E"))]""
WRITE "/",^("E")
End DoDot:3
End DoDot:2
End DoDot:1
if E
QUIT
+67 QUIT
+68 ;
HDRC ;header for converted report
+1 NEW Y,JJ,SS
+2 IF $EXTRACT(IOST)="C"
Begin DoDot:1
+3 SET SS=22-$Y
FOR JJ=1:1:SS
WRITE !
+4 IF PAGE>1
SET DIR(0)="E"
DO ^DIR
SET E=$DATA(DIRUT)
KILL DIR
End DoDot:1
IF E
QUIT
+5 if $Y!($EXTRACT(IOST)="C")
WRITE @IOF
+6 SET PAGE=PAGE+1
+7 WRITE !,"Patch ES*1*22 Conversion Report ",?55,"Page: ",PAGE
+8 WRITE !,"List of Converted Entries in File #912"
if PAGE=1
WRITE ?52,"Printed: ",RUNDT
+9 IF $DATA(ESPUSER)
IF $DATA(ESPDATE)
Begin DoDot:1
+10 WRITE !,"Patch ES*1*22 Conversion Completion Report (cont.)"
+11 WRITE ?52,"Printed: ",RUNDT
+12 WRITE !,"Completed by: "_$EXTRACT($PIECE($GET(^VA(200,ESPUSER,0)),U,1),1,24)
End DoDot:1
+13 WRITE !,LN
+14 QUIT
+15 ;
USER ;user intervention needed report
+1 ;^XTMP("ESP","USER",ESIEN,ESN)=old subtype_"^"_total$loss
+2 NEW FLAG,ESIEN,ESN,ESOLD,ESOLDNM,ESNEW,ESL,ESPDTR,ESSTAR,NN,X,Y,DIC,DR,DA,DIQ
+3 DO HDRU
if E
QUIT
SET ESIEN=0
+4 IF '$DATA(^XTMP("ESP","USER"))
Begin DoDot:1
+5 WRITE !!,"There is no data in ^XTMP(""ESP"",""USER"", to print."
End DoDot:1
QUIT
+6 FOR
SET ESIEN=$ORDER(^XTMP("ESP","USER",ESIEN))
if ESIEN=""
QUIT
Begin DoDot:1
+7 if $Y+6>IOSL
DO HDRU
IF E
QUIT
+8 SET ESPDTR=$PIECE($GET(^ESP(912,ESIEN,0)),U,2)
if ESPDTR=""
QUIT
+9 WRITE !!!,"File #912 ien: ",ESIEN
+10 WRITE ?45,"UOR# ",$EXTRACT(ESPDTR,2,3),"-",$EXTRACT(ESPDTR,4,5),"-",$EXTRACT(ESPDTR,6,7),"-",$TRANSLATE($EXTRACT($PIECE(ESPDTR,".",2)_"ZZZZ",1,4),"Z",0)
+11 KILL ^UTILITY("DIQ1",$JOB)
+12 SET DIC="^ESP(912,"
SET DA=ESIEN
SET DR=".02;.03;.04;.06;.08;5.02;5.05;5.06;6.01;6.02"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912,DA))
QUIT
+13 WRITE !,"DATE/TIME RECEIVED: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.02,"E"))
+14 WRITE !,"DATE/TIME OF OFFENSE: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.03,"E"))
+15 if $Y+4>IOSL
DO HDRU
IF E
QUIT
+16 WRITE !,"LOCATION: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.04,"E"))
+17 WRITE !,"INVESTIGATING OFFICER: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.06,"E"))
+18 if $Y+4>IOSL
DO HDRU
IF E
QUIT
+19 WRITE !,"CASE STATUS: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,.08,"E"))
+20 WRITE ?45,"COMPLETED FLAG: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,5.02,"E"))
+21 SET FLAG=$GET(^UTILITY("DIQ1",$JOB,912,DA,5.05,"E"))
Begin DoDot:2
+22 if FLAG=""
QUIT
if FLAG["NONE"
QUIT
+23 if $Y+4>IOSL
DO HDRU
IF E
QUIT
+24 WRITE !,"DELETED/REOPENED FLAG: ",FLAG
+25 IF $EXTRACT(FLAG,1)="D"
WRITE ?45,"DATE/TIME: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,5.06,"E"))
+26 IF ($EXTRACT(FLAG,1)="R")&($DATA(^UTILITY("DIQ1",$JOB,912,DA,6.02,"E")))
WRITE ?45,"DATE/TIME: ",^UTILITY("DIQ1",$JOB,912,DA,6.02,"E"),!?45,"PREVIOUS ID#: ",$GET(^UTILITY("DIQ1",$JOB,912,DA,6.01,"E"))
End DoDot:2
if E
QUIT
+27 IF $DATA(^ESP(912,ESIEN,90))
Begin DoDot:2
+28 if $Y+4>IOSL
DO HDRU
IF E
QUIT
+29 WRITE !,"LOST/STOLEN PROPERTY:"
+30 SET ESL=0
FOR
SET ESL=$ORDER(^ESP(912,ESIEN,90,ESL))
if ESL=""
QUIT
Begin DoDot:3
+31 SET DIC="^ESP(912,"_ESIEN_",90,"
SET DA=ESL
SET DR=".01;.03"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912.1,DA))
QUIT
+32 if $Y+3>IOSL
DO HDRU
IF E
QUIT
+33 WRITE !?5,$GET(^UTILITY("DIQ1",$JOB,912.1,DA,.01,"E"))
+34 WRITE ?45,"LOSS: $",$GET(^UTILITY("DIQ1",$JOB,912.1,DA,.03,"E"))
End DoDot:3
if E
QUIT
End DoDot:2
if E
QUIT
+35 SET ESN=0
FOR
SET ESN=$ORDER(^ESP(912,ESIEN,10,ESN))
if ESN=""
QUIT
Begin DoDot:2
+36 SET ESOLD=0
SET ESSTAR=" "
+37 SET ESOLD=$PIECE($GET(^XTMP("ESP","USER",ESIEN,ESN)),U,1)
IF ESOLD
SET ESSTAR="** "
+38 SET DIC="^ESP(912,"_ESIEN_",10,"
SET DA=ESN
SET DR=".01;.02;.03"
SET DIQ(0)="E"
DO EN^DIQ1
if '$DATA(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
QUIT
+39 if $Y+3>IOSL
DO HDRU
IF E
QUIT
+40 WRITE !,ESSTAR
WRITE "Classification: ",$GET(^UTILITY("DIQ1",$JOB,912.01,DA,.01,"E"))
+41 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.02,"E"))]""
WRITE "/",^("E")
+42 IF $GET(^UTILITY("DIQ1",$JOB,912.01,DA,.03,"E"))]""
WRITE "/",^("E")
End DoDot:2
if E
QUIT
End DoDot:1
if E
QUIT
+43 QUIT
+44 ;
HDRU ;header for user report
+1 NEW Y,JJ,SS
+2 IF $EXTRACT(IOST)="C"
Begin DoDot:1
+3 SET SS=22-$Y
FOR JJ=1:1:SS
WRITE !
+4 IF PAGE>1!(ESPC)
SET DIR(0)="E"
DO ^DIR
SET E=$DATA(DIRUT)
KILL DIR
End DoDot:1
IF E
QUIT
+5 if $Y!($EXTRACT(IOST)="C")
WRITE @IOF
+6 SET PAGE=PAGE+1
+7 WRITE !,"Patch ES*1*22 Conversion Report ",?55,"Page: ",PAGE
+8 WRITE !,"List of Unconverted Entries in File #912"
if PAGE=1
WRITE ?52,"Printed: ",RUNDT
+9 WRITE !," to be Reviewed by User"
+10 IF $DATA(ESPUSER)
IF $DATA(ESPDATE)
Begin DoDot:1
+11 WRITE !,"Patch ES*1*22 Conversion Completion Report (cont.)"
+12 WRITE ?52,"Printed: ",RUNDT
+13 WRITE !,"Completed by: "_$EXTRACT($PIECE($GET(^VA(200,ESPUSER,0)),U,1),1,24)
End DoDot:1
+14 WRITE !,LN
+15 QUIT