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

ADEDQUE.m

Go to the documentation of this file.
ADEDQUE ; IHS/HQT/MJL  - DEQUEUES FROM ^ADEPOST ;12:29 PM  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;;APRIL 1999
INIT D ^XBKVAR S X="ERR^ADEDQUE",@^%ZOSF("TRAP"),ADEDQ1=0
CTRL F ADEDQ=0:0 D ROLL Q:'+ADEDQ1  S ADEQIT=0 D DQ1 Q:ADEQIT  D ZTM^ADEGRL6,UNLOCK D DQKILL
 G:ADEQIT E1
END K ADEDQ,ADEDQ1,ADEDQNOD
 K ^ADEUTL("ADEDQUE")
E1 D DQKILL
 I $D(ZTQUEUED) S ZTREQ="@"
 Q
UNLOCK Q:'$D(ADEDQ1)
 Q:'+ADEDQ1
 K ^ADEPOST(ADEDQ1)
 L -^ADEPOST(ADEDQ1)
 Q
ROLL S ADEDQ1=$O(^ADEPOST(ADEDQ1))
 Q
DQ1 I '$D(^ADEPOST(ADEDQ1)) S ADEQIT=1 Q
 S ADEDQNOD=^ADEPOST(ADEDQ1)
 ;I $P(ADEDQNOD,U) H 2 G DQ1
 L +^ADEPOST(ADEDQ1):.1 I '$T S ADEQIT=1 Q
 ;S $P(^ADEPOST(ADEDQ1),U)=1
 S ADENEWVS=$P(ADEDQNOD,U,2)
 S ADEPAT=$P(ADEDQNOD,U,3)
 S:$P(ADEDQNOD,U,4) ADEDFN=$P(ADEDQNOD,U,4)
 S ADELOED=$P(ADEDQNOD,U,5)
 S ADEPVNMD=$P(ADEDQNOD,U,6)
 S ADENOTE=$P(ADEDQNOD,U,7)
 S ADERDNMD=$P(ADEDQNOD,U,8)
 S ADEVDATE=$P(ADEDQNOD,U,9)
 S ADECON=$P(ADEDQNOD,U,10)
 S ADEDIR=$P(ADEDQNOD,U,11)
 S ADETCH=$P(ADEDQNOD,U,12)
 S ADEJ=0 F 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