source: WorldVistAEHR/trunk/r/VISUAL_IMPAIRMENT_SERVICE_TEAM-ANRV/ANRVRP9.m@ 701

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1ANRVRP9 ;BIRM/LDT - VIST VARO CLAIMS LIST ; 12 Mar 98 / 1:01 PM
2 ;;4.0; Visual Impairment Service Team ;**3**;12 Jun 98
3EN1 ;Entry point for Address List
4 K ANRVLP W @IOF,!!,"VIST VARO CLAIMS LIST",!!
5 D SEL I '$D(ANRVLP),SEL'="A" G QUIT
6 K %ZIS,IOP S %ZIS="QM",%ZIS("B")="" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!!" G QUIT
7 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")=""
8 I D ^%ZTLOAD K ZTSK G QUIT
9 U IO
10DEQ ;Entry point when queued.
11 K ^TMP("ANRV",$J)
12 S HDR="VIST VARO CLAIMS LIST"
13 S (PG,QFLG)=0,$P(LN,"-",133)="" D NOW^%DTC S Y=$E(%,1,12) X ^DD("DD") S HDT=Y
14 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
15 D HDR
16 I '$D(^TMP("ANRV",$J)) W !,"NO DATA TO PRINT!" G QUIT
17 D REPORT
18 ;
19QUIT 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
20 I $E(IOST)="C" S DIR(0)="E" D ^DIR
21 ;; W:$E(IOST)'="C" @IOF
22 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
23 Q
24 ;
25SETTMP ;Set ^TMP for report
26 S ^TMP("ANRV",$J,VADM(1),0)=VADM(1)_U_$P(VADM(2),U,2)_U_VAEL(7)
27 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
28 .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:"")
29 .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)
30 .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:"")
31 Q
32 ;
33HDR ;Report header
34 I $E(IOST)="C",PG>0 S DIR(0)="E" D ^DIR K DIR I 'Y S QFLG=1 Q
35 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
36 Q
37 ;
38REPORT ;Print Report
39 S NAME="" F S NAME=$O(^TMP("ANRV",$J,NAME)) Q:NAME="" D D:$Y+4>IOSL HDR Q:QFLG
40 .F XX=1:1:3 S ANRV(XX)=$P($G(^TMP("ANRV",$J,NAME,0)),U,XX)
41 .W !!,$E(ANRV(1),1,20),?22,ANRV(2),?35,ANRV(3)
42 .S VARO=0 F S VARO=$O(^TMP("ANRV",$J,NAME,VARO)) Q:'VARO D
43 ..F XXX=1:1:4 S ANRV2(XXX)=$P($G(^TMP("ANRV",$J,NAME,VARO)),U,XXX)
44 ..W ?46,ANRV2(1),?59,ANRV2(2),?87,ANRV2(3),?119,ANRV2(4),!
45 ..D:($Y+4)>IOSL HDR
46 Q
47SEL W !!,"Do you want the report to list:",!?3,"(A)ll patients or",!?3,"(S)elect patients",!!
48 S DIR(0)="SAOBM^A:ALL;S:SELECTED",DIR("A")="Choose A or S: ",DIR("?")="^D HELPSEL^ANRVRP9" D ^DIR K DIR
49 S SEL=Y I SEL="A" G SETLP
50 S:SEL="" SEL="^" G:SEL="^" QUIT2
51 W !
52ASKPT 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
53 I Y<0!($D(DTOUT))!($D(DUOUT)) G QUIT2
54 I Y>0 S ANRVLP($P(^ANRV(2043.5,+Y,0),"^"))=+Y G ASKPT
55QUIT2 K %,DTOUT,DUOUT,X,Y Q
56HELPSEL ;
57 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
58SETLP ;
59 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
60 Q
Note: See TracBrowser for help on using the repository browser.