61 lines
3.3 KiB
Mathematica
61 lines
3.3 KiB
Mathematica
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
|