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

APCLPLCV.m

Go to the documentation of this file.
APCLPLCV ; IHS/CMI/LAB - PRINTS A PATIENT'S LAST CLINIC VISIT ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;V 2.41
 ;
 D START
 I APCLFLAG D EOJ Q
 I 'APCLFOUN W !!,?5,"** THIS PATIENT HAS NO RECORDED VISIT TO THE "_$P(^DIC(40.7,APCLCL,0),U)_" CLINIC **",! H 2 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 APCLFLAG=0
 S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC I Y<1 S APCLFLAG=1 Q
 ;Get Clinic
 W !!,?8,"**This Report will display the LAST Visit to a specific CLINIC **",!!,?30,"for: "_$P(^DPT(AUPNPAT,0),U) W !
 ;
 K DIC S DIC=40.7,DIC(0)="AEQMZ",DIC("A")="Enter a Clinic:  " D ^DIC K DIC
 ;
 G START:Y<1 S APCLCL=+Y
 ;
 I '$D(^AUPNVSIT("AA",AUPNPAT)) S APCLFLAG=1 Q
 S APCLDATE=""
 S APCLFOUN=0
 F  S APCLDATE=$O(^AUPNVSIT("AA",AUPNPAT,APCLDATE)) Q:APCLDATE=""  Q:APCLFOUN  D
 .S APCLVDFN=0 F  S APCLVDFN=$O(^AUPNVSIT("AA",AUPNPAT,APCLDATE,APCLVDFN)) Q:APCLVDFN=""  Q:APCLFOUN  D
 ..Q:$P(^AUPNVSIT(APCLVDFN,0),U,8)'=APCLCL
 ..S APCLFOUN=APCLVDFN
 ..Q
 I APCLFOUN S APCDVDSP=APCLFOUN
 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 APCLLAST,APCLVDFN,AUPNDOB,AUPNDOD,AUPNPAT,AUPNSEX,APCLFLAG,APCDVDSP,APCLFOUN,APCLCL,AUPNDAYS
 K DIC,DA,X,Y,ZTSK,ZTQUEUED
 Q