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

ACDPVHST.m

Go to the documentation of this file.
ACDPVHST ;IHS/ADC/EDE/KML - DISPLAY PATIENT VISIT HISTORY; 
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;
 ; This routine displays a patient's CDMIS visit history.
 ;
START ;
 F  D PATLOOP Q:ACDQ
 D EOJ
 Q
 ;
PATLOOP ; DISPLAY PATIENTS UNTIL DONE
 D GETPAT
 Q:ACDQ
 D GETVSITS^ACDDEU
 Q:ACDQ
 I '$D(^TMP("ACD",$J,"VISITS")) W !!,"No CDMIS VISIT history for patient ",ACDDFN,! Q
 I $D(IO("Q")) D  Q
 . S ZTRTN="DISPLAY^ACDPVHST",ZTDESC="CDMIS VISIT HISTORY",ZTDTH=$H,ZTSAVE("ACD*")="",ZTSAVE("^TMP(""ACD"",$J,""VISITS"",")=""
 . D ^%ZTLOAD
 . Q
 D DISPLAY
 I '$D(ACDSLAVE),$E(IOST,1,2)'="P-" D PAUSE^ACDDEU
 D DEV^ACDDEU Q:ACDQ
 I $D(ACDSLAVE)!(IO'=IO(0)) D DISPLAY
 K ACDSLAVE S IO=IO(0)
 Q
 ;
DISPLAY ; EP - FOR TASKMAN
 I $D(ACDSLAVE) S IOP=ACDSLAVE D ^%ZIS
 U IO
 W:IO'=IO(0) @IOF
 D DSPHIST^ACDDEU
 I $D(ACDSLAVE) W @IOF D ^%ZISC
 U 0
 I $D(ZTQUEUED) D EOJ S ZTREQ="@"
 Q
 ;
GETPAT ; GET PATIENT
 S ACDQ=1
 S AUPNLK("ALL")=1
 S DIC="^AUPNPAT(",DIC(0)="AEMQ",DIC("S")="I $D(^ACDVIS(""D"",+Y))" D DIC^ACDFMC
 K AUPNLK("ALL")
 Q:Y<0
 S ACDDFNP=+Y,ACDDFN=$P(^DPT(ACDDFNP,0),U)
 S ACDQ=0
 Q
 ;
EOJ ;
 D ^%ZISC
 D ^ACDKILL
 Q