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

ACDPVH1M.m

Go to the documentation of this file.
ACDPVH1M ;IHS/ADC/EDE/KML - DISPLAY PATIENT VISITS FOR 1 MO; 
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;
 ; This routine displays a patient's CDMIS visits for one month.
 ;
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
 D DSPHIST ;                             display visit history
 D GETMONTH
 Q:ACDQ
 S ACDSTART=$$FMADD^XLFDT(ACDMONTH_"01",-1)
 S X=$O(^TMP("ACD",$J,"VISITS",ACDSTART))
 I $E(X,1,5)'=ACDMONTH W !!,"No CDMIS VISITs during selected month for patient ",ACDDFN,! Q
 I $D(IO("Q")) D  Q
 . S ZTRTN="DISPLAY^ACDPVH1M",ZTDESC="CDMIS VISITS ONE MONTH",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   ;       select device
 I $D(ACDSLAVE)!(IO'=IO(0)) D DISPLAY
 K ACDSLAVE S IO=IO(0)
 Q
 ;
DSPHIST ; DISPLAY VISIT HISTORY TO HELP USER SELECT
 NEW IOST
 S IOST="C-VT100"
 D DSPHIST^ACDDEU ;                      display visit history
 Q
 ;
DISPLAY ; EP - FOR TASKMAN
 I $D(ACDSLAVE) S IOP=ACDSLAVE D ^%ZIS
 U IO
 D DISPLAY2
 I $E(IOST,1,2)="P-" W @IOF
 I $D(ACDSLAVE) D ^%ZISC
 U 0
 I $D(ZTQUEUED) D EOJ S ZTREQ="@"
 Q
 ;
DISPLAY2 ; DISPLAY VISIT FOR SELECTED MONTH
 D CONF^ACDDEU W !
 W "CDMIS VISIT history for client ",ACDDFN,!!
 W "----------",!
 S ACDX=ACDSTART
 F  S ACDX=$O(^TMP("ACD",$J,"VISITS",ACDX)) Q:$E(ACDX,1,5)'=ACDMONTH  S ACDY=0 F  S ACDY=$O(^TMP("ACD",$J,"VISITS",ACDX,ACDY)) Q:'ACDY  D DSPV^ACDDEU I $P(^ACDVIS(ACDY,0),U,4)="CS" S ACDVIEN=ACDY D DSPCSH^ACDDEU
 W "----------",!
 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
 ;
GETMONTH ; GET MONTH
 S ACDQ=1
 S DIR(0)="DO^::E",DIR("A")="Enter month/year" K DA D ^DIR K DIR
 Q:$D(DIRUT)
 Q:Y=""
 S ACDMONTH=$E(Y,1,5)
 S ACDQ=0
 Q
 ;
EOJ ;
 D ^%ZISC
 D ^ACDKILL
 Q