Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ANRVRP

ANRVRP.m

Go to the documentation of this file.
ANRVRP ;BIRM/LDT - VIST ADDRESS/PHONE LIST ; 05 Aug 98 / 2:13 PM
 ;;4.0; Visual Impairment Service Team ;**1**;12 Jun 98
EN1 ;Entry point for Address List
 W @IOF,!!,"VIST ADDRESS/PHONE LIST",!!
 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 ROSTER ADDRESS/PHONE LIST",ZTRTN="DEQ^ANRVRP"
 I  D ^%ZTLOAD K ZTSK G QUIT
 U IO
DEQ ;Entry point when queued.
 K ^TMP("ANRV",$J)
 S HDR="VIST ROSTER ADDRESS/PHONE LIST"
 S (PG,QFLG)=0,$P(LN,"-",81)="" D NOW^%DTC S Y=$E(%,1,12) X ^DD("DD") S HDT=Y
 S ANRVP=0 F  S ANRVP=$O(^ANRV(2040,ANRVP)) Q:'ANRVP  I $P($G(^ANRV(2040,ANRVP,13)),U,2)'="I" S DFN=$P($G(^ANRV(2040,ANRVP,0)),U) D 4^VADPT,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,DFN,HDR,HDT,LN,NAME,PG,POP,QFLG,X,Y,XX,DTOUT,DUOUT,DIRUT,^TMP("ANRV",$J) D KVAR^VADPT,KVA^VADPT
 W:$E(IOST)'="C" @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
 Q
 ;
SETTMP ;Set ^TMP for report
 S ^TMP("ANRV",$J,VADM(1))=VADM(1)_U_VAPA(8)_U_VAPA(1)_U_VAPA(2)_U_VAPA(3)_U_VAPA(4)_U_$P(VAPA(5),U)_U_VAPA(6)
 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,?44,"Printed ",HDT,?71,"Page ",PG,!!,"NAME",?22,"PHONE NO.",?44,"ADDRESS",!,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:8 S ANRV(XX)=$P($G(^TMP("ANRV",$J,NAME)),U,XX)
 .W !,$E(ANRV(1),1,20),?22,ANRV(2),?44,ANRV(3)
 .W:ANRV(4)]"" !?44,ANRV(4) W:ANRV(5)]"" !?44,ANRV(5)
 .W:ANRV(6)]"" !?44,ANRV(6)_"," W:ANRV(7)>0 " "_$P(^DIC(5,+ANRV(7),0),U,2) W:ANRV(8)]"" " "_ANRV(8)
 .W !
 Q