source: WorldVistAEHR/trunk/r/VISUAL_IMPAIRMENT_SERVICE_TEAM-ANRV/ANRVRP7.m@ 1306

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1ANRVRP7 ;BIRM/LDT - VIST ROSTER PRINTOUT ; 27 Apr 98 / 9:20 AM
2 ;;4.0; Visual Impairment Service Team ;;12 Jun 98
3EN1 ;Entry point for Roster Printout.
4 K ANRVLP W @IOF,!!,"VIST ROSTER PRINTOUT",!!
5 D SEL I '$D(ANRVLP),SEL'="A" G QUIT
6 W !!,"The right margin for this report is 132.",!
7 K %ZIS,IOP S %ZIS="QM",%ZIS("B")="" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!!" G QUIT
8 I $D(IO("Q")) K IO("Q") S ZTDESC="VIST ROSTER PRINTOUT",ZTRTN="DEQ^ANRVRP7" S:$D(ANRVLP) ZTSAVE("ANRVLP(")="" S:$D(SEL) ZTSAVE("SEL")=""
9 I D ^%ZTLOAD K ZTSK G QUIT
10 U IO
11DEQ ;Entry point when queued.
12 K ^TMP("ANRV",$J)
13 S ANRVP=0 F S ANRVP=$O(ANRVLP(ANRVP)) Q:'ANRVP S DFN=$P($G(^ANRV(2040,ANRVP,0)),U) D 2^VADPT,SETTMP
14 S HDR="VIST ROSTER PRINTOUT"
15 S (PG,QFLG)=0,$P(LN,"-",133)="" D NOW^%DTC S Y=$E(%,1,12) X ^DD("DD") S HDT=Y 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,ANRVLP,DFN,HDR,HDT,JJ,LN,NAME,PG,POP,SEL,QFLG,X,Y,XX,^TMP("ANRV",$J) D KVAR^VADPT,KVA^VADPT
20 W:$E(IOST)'="C" @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
21 Q
22 ;
23SETTMP ;Set TMP global
24 S:VADM(6)="" ^TMP("ANRV",$J,VADM(1))=VADM(1)_U_$P(VADM(2),U,2)_U_$P($G(^ANRV(2040,ANRVP,13)),U,2)_U_$P(VAEL(2),U,2)_U_$G(^ANRV(2040,ANRVP,2))
25 Q
26 ;
27HDR ;Report header
28 I $E(IOST)="C",PG>0 S DIR(0)="E" D ^DIR K DIR I 'Y S QFLG=1 Q
29 S PG=PG+1 W:$Y!($E(IOST)="C") @IOF Q:(PG>1)&($E(IOST)="C") W !,HDR,?73,"Printed ",HDT,?100,"Page ",PG,!!,"NAME",?27,"SSN",?47,"VIST ELIGIBLE",?73,"PERIOD OF",?93,"VIST ELIGIBILITY"
30 W !?73,"SERVICE",!,LN
31 Q
32 ;
33REPORT ;Print Report
34 S NAME="" F S NAME=$O(^TMP("ANRV",$J,NAME)) Q:NAME="" D:$Y+13>IOSL HDR Q:QFLG D
35 .F XX=1:1:5 S ANRV(XX)=$P($G(^TMP("ANRV",$J,NAME)),U,XX)
36 .D:$Y+13>IOSL HDR Q:QFLG W !,ANRV(1),?27,ANRV(2),?47,$S(ANRV(3)="001":"YES (001)",ANRV(3)="002":"NO - REVIEWED FOR BRC",ANRV(3)="003":"NO - OTHER (003)",ANRV(3)="NO":"NO - NOT LEGALLY BLIN",1:""),?73,ANRV(4),?93,ANRV(5)
37 Q
38SEL W !!,"Do you want the report to list:",!?3,"(A)ll patients, or",!?3,"(S)elect patients",!!
39 S DIR(0)="SAOBM^A:ALL;S:SELECTED",DIR("A")="Choose A or S: ",DIR("?")="^D HELPSEL^ANRVRP7" D ^DIR K DIR
40 S SEL=Y I SEL="A" G ANRVLP
41 S:SEL="" SEL="^" G:SEL="^" QUIT2
42 W !
43ASKPT S DIC="^ANRV(2040,",DIC(0)="QEAM",DIC("S")="I $P($G(^ANRV(2040,+Y,13)),U,2)'=""I""" D ^DIC K DIC I Y<0 Q
44 S DFN=$P($G(^ANRV(2040,+Y,0)),U),ANRVP=+Y D DEM^VADPT I VADM(6) W !?5,"Patient died "_$P($P(VADM(6),"^",2),"@")_"." G ASKPT
45 S ANRVLP(ANRVP)="" G ASKPT
46QUIT2 K:SEL="^"!(SEL="") %,DIC,X,Y Q
47HELPSEL ;
48 W !!,"Enter ""A"" to select all patients from the VIST ROSTER file.",!?6,"""S"" to select only specific patients.",!?6,"""^"" or <return> to halt." Q
49ANRVLP ;Set ANRVLP for all patients who are not inactive for AMIS
50 S JJ=0 F S JJ=$O(^ANRV(2040,JJ)) Q:'JJ I $P($G(^ANRV(2040,JJ,13)),U,2)'="I" S ANRVLP(JJ)=""
51 Q
Note: See TracBrowser for help on using the repository browser.