ANRVRP9 ;BIRM/LDT - VIST VARO CLAIMS LIST ; 12 Mar 98 / 1:01 PM
;;4.0; Visual Impairment Service Team ;**3**;12 Jun 98
EN1 ;Entry point for Address List
K ANRVLP W @IOF,!!,"VIST VARO CLAIMS LIST",!!
D SEL I '$D(ANRVLP),SEL'="A" G QUIT
K %ZIS,IOP S %ZIS="QM",%ZIS("B")="" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!!" G QUIT
I $D(IO("Q")) K IO("Q") S ZTDESC="VIST VARO CLAIMS LIST",ZTRTN="DEQ^ANRVRP9" S:$D(ANRVLP) ZTSAVE("ANRVLP(")="" S:$D(SEL) ZTSAVE("SEL")=""
I D ^%ZTLOAD K ZTSK G QUIT
U IO
DEQ ;Entry point when queued.
K ^TMP("ANRV",$J)
S HDR="VIST VARO CLAIMS LIST"
S (PG,QFLG)=0,$P(LN,"-",133)="" D NOW^%DTC S Y=$E(%,1,12) X ^DD("DD") S HDT=Y
S ANRVPX=0 F S ANRVPX=$O(ANRVLP(ANRVPX)) Q:'ANRVPX S DFN=$P($G(^ANRV(2040,ANRVPX,0)),U) D 2^VADPT S ANRVP=ANRVLP(ANRVPX) D SETTMP
D HDR
I '$D(^TMP("ANRV",$J)) W !,"NO DATA TO PRINT!" G QUIT
D REPORT
;
QUIT K %,%H,%I,%T,%Y,ANRVP,ANRV,ANRV2,ANRV,CLAIM,CDT,DATA,DFN,HDR,HDT,LN,NAME,PG,POP,RO,QFLG,VARO,X,Y,XX,XXX,DTOUT,DUOUT,DIRUT,^TMP("ANRV",$J) D KVAR^VADPT,KVA^VADPT
I $E(IOST)="C" S DIR(0)="E" D ^DIR
;; W:$E(IOST)'="C" @IOF
D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
Q
;
SETTMP ;Set ^TMP for report
S ^TMP("ANRV",$J,VADM(1),0)=VADM(1)_U_$P(VADM(2),U,2)_U_VAEL(7)
S VARO=0 F S VARO=$O(^ANRV(2043.5,ANRVP,1,VARO)) Q:'VARO S DATA=$G(^ANRV(2043.5,ANRVP,1,VARO,0)) D
.S CLAIM=$S($P(DATA,U,2)="01":"A&A/HB (IMPROVED PENSION)",$P(DATA,U,2)="02":"INCREASE SC RATING",$P(DATA,U,2)="03":"INITIAL SC RATING",$P(DATA,U,2)="04":"SWITCH TO IMPROVED PENSION",$P(DATA,U,2)="05":"OTHER",1:"")
.S Y=$P(DATA,U) X ^DD("DD") S CDT=Y S DIC="^DIC(4,",DIC(0)="NZ",X="`"_$P(DATA,U,3) D ^DIC K DIC S:Y<0 RO="" S:+Y>0 RO=Y(0,0)
.S ^TMP("ANRV",$J,VADM(1),VARO)=CDT_U_CLAIM_U_RO_U_$S($P(DATA,U,4)="A":"ACCEPTED",$P(DATA,U,4)="D":"DENIED",$P(DATA,U,4)="P":"PENDING",1:"")
Q
;
HDR ;Report header
I $E(IOST)="C",PG>0 S DIR(0)="E" D ^DIR K DIR I 'Y S QFLG=1 Q
S PG=PG+1 W:$Y!($E(IOST)="C") @IOF Q:(PG>1)&($E(IOST)="C") W !,HDR,?87,"Printed ",HDT,?124,"Page: ",PG,!!,"NAME",?25,"SSN",?35,"VA CLAIM #",?48,"DATE OF",?63,"CLAIM",?87,"REGIONAL OFFICE",?119,"VARO DECISION",!?49,"CLAIM",!,LN
Q
;
REPORT ;Print Report
S NAME="" F S NAME=$O(^TMP("ANRV",$J,NAME)) Q:NAME="" D D:$Y+4>IOSL HDR Q:QFLG
.F XX=1:1:3 S ANRV(XX)=$P($G(^TMP("ANRV",$J,NAME,0)),U,XX)
.W !!,$E(ANRV(1),1,20),?22,ANRV(2),?35,ANRV(3)
.S VARO=0 F S VARO=$O(^TMP("ANRV",$J,NAME,VARO)) Q:'VARO D
..F XXX=1:1:4 S ANRV2(XXX)=$P($G(^TMP("ANRV",$J,NAME,VARO)),U,XXX)
..W ?46,ANRV2(1),?59,ANRV2(2),?87,ANRV2(3),?119,ANRV2(4),!
..D:($Y+4)>IOSL HDR
Q
SEL W !!,"Do you want the report to list:",!?3,"(A)ll patients or",!?3,"(S)elect patients",!!
S DIR(0)="SAOBM^A:ALL;S:SELECTED",DIR("A")="Choose A or S: ",DIR("?")="^D HELPSEL^ANRVRP9" D ^DIR K DIR
S SEL=Y I SEL="A" G SETLP
S:SEL="" SEL="^" G:SEL="^" QUIT2
W !
ASKPT K X,Y S DIC(0)="QEAM",DIC("S")="I $O(^ANRV(2043.5,+Y,1,0))",DIC="^ANRV(2043.5," D ^DIC K DIC
I Y<0!($D(DTOUT))!($D(DUOUT)) G QUIT2
I Y>0 S ANRVLP($P(^ANRV(2043.5,+Y,0),"^"))=+Y G ASKPT
QUIT2 K %,DTOUT,DUOUT,X,Y Q
HELPSEL ;
W !!,"Enter:",!?3,"""A"" to list ALL patients the VIST VARO CLAIMS file.",!?3,"""S"" to select only specific patients.",!?3,"""^"" or <return> to halt." Q
SETLP ;
S ANRVP=0 F S ANRVP=$O(^ANRV(2043.5,ANRVP)) Q:'ANRVP I $O(^ANRV(2043.5,ANRVP,1,0)) S ANRVLP($P(^ANRV(2043.5,ANRVP,0),"^"))=ANRVP
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HANRVRP9 3433 printed Nov 22, 2024@17:55:53 Page 2
ANRVRP9 ;BIRM/LDT - VIST VARO CLAIMS LIST ; 12 Mar 98 / 1:01 PM
+1 ;;4.0; Visual Impairment Service Team ;**3**;12 Jun 98
EN1 ;Entry point for Address List
+1 KILL ANRVLP
WRITE @IOF,!!,"VIST VARO CLAIMS LIST",!!
+2 DO SEL
IF '$DATA(ANRVLP)
IF SEL'="A"
GOTO QUIT
+3 KILL %ZIS,IOP
SET %ZIS="QM"
SET %ZIS("B")=""
DO ^%ZIS
IF POP
WRITE !,"NO DEVICE SELECTED OR REPORT PRINTED!!"
GOTO QUIT
+4 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTDESC="VIST VARO CLAIMS LIST"
SET ZTRTN="DEQ^ANRVRP9"
if $DATA(ANRVLP)
SET ZTSAVE("ANRVLP(")=""
if $DATA(SEL)
SET ZTSAVE("SEL")=""
+5 IF $TEST
DO ^%ZTLOAD
KILL ZTSK
GOTO QUIT
+6 USE IO
DEQ ;Entry point when queued.
+1 KILL ^TMP("ANRV",$JOB)
+2 SET HDR="VIST VARO CLAIMS LIST"
+3 SET (PG,QFLG)=0
SET $PIECE(LN,"-",133)=""
DO NOW^%DTC
SET Y=$EXTRACT(%,1,12)
XECUTE ^DD("DD")
SET HDT=Y
+4 SET ANRVPX=0
FOR
SET ANRVPX=$ORDER(ANRVLP(ANRVPX))
if 'ANRVPX
QUIT
SET DFN=$PIECE($GET(^ANRV(2040,ANRVPX,0)),U)
DO 2^VADPT
SET ANRVP=ANRVLP(ANRVPX)
DO SETTMP
+5 DO HDR
+6 IF '$DATA(^TMP("ANRV",$JOB))
WRITE !,"NO DATA TO PRINT!"
GOTO QUIT
+7 DO REPORT
+8 ;
QUIT KILL %,%H,%I,%T,%Y,ANRVP,ANRV,ANRV2,ANRV,CLAIM,CDT,DATA,DFN,HDR,HDT,LN,NAME,PG,POP,RO,QFLG,VARO,X,Y,XX,XXX,DTOUT,DUOUT,DIRUT,^TMP("ANRV",$JOB)
DO KVAR^VADPT
DO KVA^VADPT
+1 IF $EXTRACT(IOST)="C"
SET DIR(0)="E"
DO ^DIR
+2 ;; W:$E(IOST)'="C" @IOF
+3 DO ^%ZISC
if $DATA(ZTQUEUED)
SET ZTREQ="@"
+4 QUIT
+5 ;
SETTMP ;Set ^TMP for report
+1 SET ^TMP("ANRV",$JOB,VADM(1),0)=VADM(1)_U_$PIECE(VADM(2),U,2)_U_VAEL(7)
+2 SET VARO=0
FOR
SET VARO=$ORDER(^ANRV(2043.5,ANRVP,1,VARO))
if 'VARO
QUIT
SET DATA=$GET(^ANRV(2043.5,ANRVP,1,VARO,0))
Begin DoDot:1
+3 SET CLAIM=$SELECT($PIECE(DATA,U,2)="01":"A&A/HB (IMPROVED PENSION)",$PIECE(DATA,U,2)="02":"INCREASE SC RATING",$PIECE(DATA,U,2)="03":"INITIAL SC RATING",$PIECE(DATA,U,2)="04":"SWITCH TO IMPROVED PENSION",$PIECE(DATA,U,2)="05":"OTHER",1:
"")
+4 SET Y=$PIECE(DATA,U)
XECUTE ^DD("DD")
SET CDT=Y
SET DIC="^DIC(4,"
SET DIC(0)="NZ"
SET X="`"_$PIECE(DATA,U,3)
DO ^DIC
KILL DIC
if Y<0
SET RO=""
if +Y>0
SET RO=Y(0,0)
+5 SET ^TMP("ANRV",$JOB,VADM(1),VARO)=CDT_U_CLAIM_U_RO_U_$SELECT($PIECE(DATA,U,4)="A":"ACCEPTED",$PIECE(DATA,U,4)="D":"DENIED",$PIECE(DATA,U,4)="P":"PENDING",1:"")
End DoDot:1
+6 QUIT
+7 ;
HDR ;Report header
+1 IF $EXTRACT(IOST)="C"
IF PG>0
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF 'Y
SET QFLG=1
QUIT
+2 SET PG=PG+1
if $Y!($EXTRACT(IOST)="C")
WRITE @IOF
if (PG>1)&($EXTRACT(IOST)="C")
QUIT
WRITE !,HDR,?87,"Printed ",HDT,?124,"Page: ",PG,!!,"NAME",?25,"SSN",?35,"VA CLAIM #",?48,"DATE OF",?63,"CLAIM",?87,"REGIONAL OFFICE",?119,"VARO DECISION",!?49,"CLAIM",!,LN
+3 QUIT
+4 ;
REPORT ;Print Report
+1 SET NAME=""
FOR
SET NAME=$ORDER(^TMP("ANRV",$JOB,NAME))
if NAME=""
QUIT
Begin DoDot:1
+2 FOR XX=1:1:3
SET ANRV(XX)=$PIECE($GET(^TMP("ANRV",$JOB,NAME,0)),U,XX)
+3 WRITE !!,$EXTRACT(ANRV(1),1,20),?22,ANRV(2),?35,ANRV(3)
+4 SET VARO=0
FOR
SET VARO=$ORDER(^TMP("ANRV",$JOB,NAME,VARO))
if 'VARO
QUIT
Begin DoDot:2
+5 FOR XXX=1:1:4
SET ANRV2(XXX)=$PIECE($GET(^TMP("ANRV",$JOB,NAME,VARO)),U,XXX)
+6 WRITE ?46,ANRV2(1),?59,ANRV2(2),?87,ANRV2(3),?119,ANRV2(4),!
+7 if ($Y+4)>IOSL
DO HDR
End DoDot:2
End DoDot:1
if $Y+4>IOSL
DO HDR
if QFLG
QUIT
+8 QUIT
SEL WRITE !!,"Do you want the report to list:",!?3,"(A)ll patients or",!?3,"(S)elect patients",!!
+1 SET DIR(0)="SAOBM^A:ALL;S:SELECTED"
SET DIR("A")="Choose A or S: "
SET DIR("?")="^D HELPSEL^ANRVRP9"
DO ^DIR
KILL DIR
+2 SET SEL=Y
IF SEL="A"
GOTO SETLP
+3 if SEL=""
SET SEL="^"
if SEL="^"
GOTO QUIT2
+4 WRITE !
ASKPT KILL X,Y
SET DIC(0)="QEAM"
SET DIC("S")="I $O(^ANRV(2043.5,+Y,1,0))"
SET DIC="^ANRV(2043.5,"
DO ^DIC
KILL DIC
+1 IF Y<0!($DATA(DTOUT))!($DATA(DUOUT))
GOTO QUIT2
+2 IF Y>0
SET ANRVLP($PIECE(^ANRV(2043.5,+Y,0),"^"))=+Y
GOTO ASKPT
QUIT2 KILL %,DTOUT,DUOUT,X,Y
QUIT
HELPSEL ;
+1 WRITE !!,"Enter:",!?3,"""A"" to list ALL patients the VIST VARO CLAIMS file.",!?3,"""S"" to select only specific patients.",!?3,"""^"" or <return> to halt."
QUIT
SETLP ;
+1 SET ANRVP=0
FOR
SET ANRVP=$ORDER(^ANRV(2043.5,ANRVP))
if 'ANRVP
QUIT
IF $ORDER(^ANRV(2043.5,ANRVP,1,0))
SET ANRVLP($PIECE(^ANRV(2043.5,ANRVP,0),"^"))=ANRVP
+2 QUIT