AQAQMIS ;IHS/ASU/RPL 4/17/89;MISSING STAFF CREDENTIAL REPORT ; 11/7/89 10:00 AM
;;STAFF CREDENTIALS Version 1.1;11/7/89
START ;
S AQAQSITE=$P(^DIC(4,DUZ(2),0),"^",1)
ZIS W !! S %IS="Q" D ^%ZIS G:POP QUIT I '$D(IO("Q")) U IO G DQUE
QUE K IO("Q"),IO("S") I IO=IO(0) W !,"Cannot Queue to Screen or Slave Printer!",! G ZIS
S ZTRTN="DQUE^AQAQMIS",ZTDESC="MISSING STAFF CREDENTIALS REPORT" S ZTSAVE("AQAQSITE")=""
D ^%ZTLOAD G QUIT
DQUE K ^UTILITY($J)
S AQAQSET=^DD(9002155,1,0),AQAQSET=$P(AQAQSET,"^",3),AQAQCTR=$L(AQAQSET,":")-1
F I=1:1:AQAQCTR S AQAQS=$P(AQAQSET,";",I) S AQAQ1=$P(AQAQS,":"),AQAQ2=$P(AQAQS,":",2) S AQAQS(AQAQ1)=AQAQ2
S AQAQDFN=0 F I=0:0 S AQAQDFN=$O(^AQAQ(AQAQDFN)) Q:AQAQDFN'=+AQAQDFN D C0
G PRINT
C0 S AQAQNM=$P(^DIC(16,AQAQDFN,0),"^")
S AQAQN0=^AQAQ(AQAQDFN,0)
S AQAQSC=$P(AQAQN0,"^",2) S AQAQSC=$S(AQAQSC]"":AQAQS(AQAQSC),1:"<No Staff Category on File>")
S AQAQCADT=$P(AQAQN0,"^",3) S Y=AQAQCADT X ^DD("DD") S AQAQCADT=Y
S AQAQDEA=$P(AQAQN0,"^",12),AQAQDEA=$S(AQAQDEA="N":1,AQAQDEA="":1,1:0)
S AQAQINT=$P(AQAQN0,"^",5),AQAQINT=$S(AQAQINT="N":1,AQAQINT="":1,1:0)
S AQAQRES=$P(AQAQN0,"^",4),AQAQRES=$S(AQAQRES="N":1,AQAQRES="":1,1:0)
S AQAQPDG=$P(AQAQN0,"^",6),AQAQPDG=$S(AQAQPDG="N":1,AQAQPDG="":1,1:0)
S AQAQPDV=$P(AQAQ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SET %IS="Q"
DO ^%ZIS
IF POP
GOTO QUIT
IF '$DATA(IO("Q"))
USE IO
GOTO DQUE
QUE KILL IO("Q"),IO("S")
IF IO=IO(0)
WRITE !,"Cannot Queue to Screen or Slave Printer!",!
GOTO ZIS
+1 SET ZTRTN="DQUE^AQAQMIS"
SET ZTDESC="MISSING STAFF CREDENTIALS REPORT"
SET ZTSAVE("AQAQSITE")=""
+2 DO ^%ZTLOAD
GOTO QUIT
DQUE KILL ^UTILITY($JOB)
+1 SET AQAQSET=^DD(9002155,1,0)
SET AQAQSET=$PIECE(AQAQSET,"^",3)
SET AQAQCTR=$LENGTH(AQAQSET,":")-1
+2 FOR I=1:1:AQAQCTR
SET AQAQS=$PIECE(AQAQSET,";",I)
SET AQAQ1=$PIECE(AQAQS,":")
SET AQAQ2=$PIECE(AQAQS,":",2)
SET AQAQS(AQAQ1)=AQAQ2
+3 SET AQAQDFN=0
FOR I=0:0
SET AQAQDFN=$ORDER(^AQAQ(AQAQDFN))
IF AQAQDFN'=+AQAQDFN
QUIT
DO C0
+4 GOTO PRINT
C0 SET AQAQNM=$PIECE(^DIC(16,AQAQDFN,0),"^")
+1 SET AQAQN0=^AQAQ(AQAQDFN,0)
+2 SET AQAQSC=$PIECE(AQAQN0,"^",2)
SET AQAQSC=$SELECT(AQAQSC]"":AQAQS(AQAQSC),1:"<No Staff Category on File>")
+3 SET AQAQCADT=$PIECE(AQAQN0,"^",3)
SET Y=AQAQCADT
XECUTE ^DD("DD")
SET AQAQCADT=Y
+4 SET AQAQDEA=$PIECE(AQAQN0,"^",12)
SET AQAQDEA=$SELECT(AQAQDEA="N":1,AQAQDEA="":1,1:0)
+5 SET AQAQINT=$PIECE(AQAQN0,"^",5)
SET AQAQINT=$SELECT(AQAQINT="N":1,AQAQINT="":1,1:0)
+6 SET AQAQRES=$PIECE(AQAQN0,"^",4)
SET AQAQRES=$SELECT(AQAQRES="N":1,AQAQRES="":1,1:0)
+7 SET AQAQPDG=$PIECE(AQAQN0,"^",6)
SET AQAQPDG=$SELECT(AQAQPDG="N":1,AQAQPDG="":1,1:0)
+8 SET AQAQPDV=$PIECE(AQAQN0,"^",14)
SET AQAQPDV=$SELECT(AQAQPDV="N":1,AQAQPDV="":1,1:0)
+9 SET AQAQBYL=$PIECE(AQAQN0,"^",9)
SET AQAQBYL=$SELECT(AQAQBYL="N":1,AQAQBYL="":1,1:0)
+10 SET AQAQIRL=$PIECE(AQAQN0,"^",10)
SET AQAQIRL=$SELECT(AQAQIRL="N":1,AQAQIRL="":1,1:0)
+11 SET AQAQCV=$PIECE(AQAQN0,"^",11)
SET AQAQCV=$SELECT(AQAQCV="N":1,AQAQCV="":1,1:0)
+12 SET AQAQ3LR=$PIECE(AQAQN0,"^",13)
SET AQAQ3LR=$SELECT(AQAQ3LR="N":1,AQAQ3LR="":1,1:0)
+13 KILL AQAQMLF
IF $PIECE(AQAQN0,"^",2)="AF"
SET (AQAQMLF,AQAQMLV)=0
GOTO C01
+14 IF '$DATA(^AQAQ(AQAQDFN,3))
SET (AQAQMLF,AQAQMLV)=1
GOTO C01
+15 SET AQAQ3=0
FOR J=0:0
SET AQAQ3=$ORDER(^AQAQ(AQAQDFN,3,AQAQ3))
IF 'AQAQ3
QUIT
SET AQAQMLF=0
SET AQAQMLV=$PIECE(^(AQAQ3,0),"^",2)
SET AQAQMLV=$SELECT(AQAQMLV="N":1,AQAQMLV="":1,1:0)
+16 IF '$DATA(AQAQMLF)
SET (AQAQMLV,AQAQMLF)=1
C01 IF '$DATA(^AQAQ(AQAQDFN,2))
SET AQAQHSS=1
GOTO C02
+1 SET AQAQHSS=$PIECE(^AQAQ(AQAQDFN,2),"^")
SET AQAQHSS=$SELECT(AQAQHSS="N":1,AQAQHSS="":1,1:0)
C02 KILL AQAQHSV
IF '$DATA(^AQAQ(AQAQDFN,6))
SET AQAQHSV=1
GOTO C03
+1 SET AQAQ6=0
FOR J=0:0
SET AQAQ6=$ORDER(^AQAQ(AQAQDFN,6,AQAQ6))
IF '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