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

APCLVST.m

Go to the documentation of this file.
APCLVST ; IHS/CMI/LAB - PRINTS A PATIENT'S LAST VISIT ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;V 2.41
 ;
 D START
 I APCXFLAG D EOJ Q
 D PRINT
 I POP D EOJ Q
 I $D(IO("Q")) D TSKMN,EOJ Q
 U IO
 D ^APCDVDSP
 D EOJ
 Q
 ;
START ;
 S APCXFLAG=0
 S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC I Y<1 S APCXFLAG=1 Q
 I '$D(^AUPNVSIT("AA",AUPNPAT)) S APCXFLAG=1 Q
 S APCXLAST=$O(^AUPNVSIT("AA",AUPNPAT,"")),APCXVDFN=$O(^AUPNVSIT("AA",AUPNPAT,APCXLAST,""))
 S APCDVDSP=APCXVDFN
 Q
 ;
PRINT ;
 W !! K IOP S %ZIS="PQ" K IO("Q") D ^%ZIS
 Q
 ;
TSKMN ;
 K ZTSAVE S ZTSAVE("APCDVDSP")="",ZTIO=ION,ZTRTN="ZTM^APCLVST",ZTDTH="",ZTDESC="LAST VISIT REPORT" D ^%ZTLOAD
 Q
 ;
ZTM ;ENTRY FOR TASK MANAGER
 I $D(ZTQUEUED) S ZTREQ="@"
 U IO
 D ^APCDVDSP
 D ^%ZISC
 Q
 ;
EOJ ;ENTRY POINT
 D ^%ZISC
 K APCXLAST,APCXVDFN,AUPNDOB,AUPNDOD,AUPNPAT,AUPNSEX,APCXFLAG,APCDVDSP,AUPNDAYS
 K DIC,DA,X,Y,ZTSK,ZTQUEUED
 Q