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

ACDLVBD.m

Go to the documentation of this file.
ACDLVBD ;IHS/ADC/EDE/KML - LIST VISITS FOR DATE; 
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;
 ; This routine lists visits for one date
 ;
START ;
 W !
 F  D DATELOOP Q:ACDQ
 D EOJ
 Q
 ;
DATELOOP ; LIST VISITS BY DATE UNTIL DONE
 D GETDATE
 Q:ACDQ
 D LSTVSITS
 D DEV^ACDDEU Q:ACDQ
 I $D(ACDSLAVE)!(IO'=IO(0)) D LSTVSITS
 K ACDSLAVE S IO=IO(0)
 U 0
 Q
 ;
GETDATE ; GET DATE
 S ACDQ=1
 S DIR(0)="9002172.1,.01",DIR("A")="VISIT DATE" K DA D ^DIR K DIR
 Q:$D(DIRUT)
 S ACDVDTI=Y,ACDVDTE=Y(0)
 S ACDQ=0
 Q
 ;
 ;
LSTVSITS ; LIST VISITS FOR ONE DATE
 I $D(IO("Q")) D  Q
 . S ZTRTN="LSTVSITQ^ACDLVBD",ZTDESC="CDMIS VISIT LIST FOR DATE",ZTDTH=$H,ZTSAVE("ACD*")=""
 . D ^%ZTLOAD
 . Q
 D LSTVSITQ
 S ACDQ=0
 Q
 ;
LSTVSITQ ; EP - FOR TASKMAN
 I $D(ACDSLAVE) S IOP=ACDSLAVE D ^%ZIS
 U IO
 W:IO'=IO(0) @IOF
 D:$E(IOST,1,2)="P-" CONF^ACDDEU
 W !
 I '$D(^ACDVIS("B",ACDVDTI)) W !,"----------",!,"No CDMIS visits for ",ACDVDTE,!,"----------",! Q
 S ACDY=0,ACDLC=0
 F  S ACDY=$O(^ACDVIS("B",ACDVDTI,ACDY)) Q:'ACDY  S X=^ACDVIS(ACDY,0) I $P($G(^("BWP")),U)=ACDPGM D  Q:ACDQ
 . S ACDQ=0
 . S ACDLC=ACDLC+1
 . S DIC="9002172.1",DA=ACDY,DR=".01;1;3;4;5",DIQ="ACDPDD(",DIQ(0)="EI"
 . D DIQ1^ACDFMC
 . S X=ACDPDD(9002172.1,ACDY,.01,"I") W $E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3),?9," - ",ACDPDD(9002172.1,ACDY,4,"E")," - ",ACDPDD(9002172.1,ACDY,1,"E"),"/",ACDPDD(9002172.1,ACDY,5,"E")," ",ACDPDD(9002172.1,ACDY,3,"E"),!
 . K ACDPDD
 . I '(ACDLC#20) D PAUSE^ACDDEU S:$D(DIRUT) ACDQ=1
 . Q
 D:$E(IOST,1,2)'="P-" PAUSE^ACDDEU
 I $D(ACDSLAVE) W @IOF D ^%ZISC
 U 0
 I $D(ZTQUEUED) D EOJ S ZTREQ="@"
 Q
 ;
EOJ ;
 D ^%ZISC
 D ^ACDKILL
 Q