ABSPOS2E ; IHS/FCS/DRS - print queues ;
;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
Q
QUEUES() ;EP - option ABSP SUP QUEUES
; Note: these don't LOCK anything, so you could get anomalous-looking
; results because of timing.
W ! N ROOT,STATUS,SET,WHICH,X
I '$D(IOM) N IOM S IOM=80
S ROOT="^ABSPT" ; because we hate typing all that
QUE1 F STATUS=0:1:98 D
.I '$D(@ROOT@("AD",STATUS)) Q
.W $$QCOUNT(STATUS)," in Q"
.W STATUS," ",$$STATI^ABSPOSU(STATUS)
.N X S X=""
.F S X=$O(@ROOT@("AD",STATUS,X)) Q:X="" Q:$X+$L(X)+1'<IOM D
..W " ",X
.W !
S SET="" F S SET=$O(^ABSPECX("POS",SET)) Q:SET="" D
.F WHICH="C","R" D
..Q:'$D(^ABSPECX("POS",SET,WHICH))
..W $$PQCOUNT(SET,WHICH)," packets in Set ",SET," "
..W $S(WHICH="C":"waiting to transmit",1:"received but unprocessed")
..S X="" F S X=$O(^ABSPECX("POS",SET,WHICH,X)) Q:X="" Q:$X+$L(X)+1'<IOM W " ",X
..W !
QUE50 S X=$$CONTINUE^ABSPOSUD("C")
I "Cc"[X G QUE1
I "Qq^"[X G QUE99
G QUE50
QUE99 ;
Q:$Q X Q
QCOUNT(N) N I,X S X="" F I=0:1 S X=$O(@ROOT@("AD",N,X)) Q:X=""
Q I
PQCOUNT(N,W) N I,X S X="" F I=0:1 S X=$O(^ABSPECX("POS",N,W,X)) Q:X=""
Q I
ABSPOS2E ; IHS/FCS/DRS - print queues ;
+1 ;;1.0;PHARMACY POINT OF SALE;;JUN 21, 2001
+2 QUIT
QUEUES() ;EP - option ABSP SUP QUEUES
+1 ; Note: these don't LOCK anything, so you could get anomalous-looking
+2 ; results because of timing.
+3 WRITE !
NEW ROOT,STATUS,SET,WHICH,X
+4 IF '$DATA(IOM)
NEW IOM
SET IOM=80
+5 ; because we hate typing all that
SET ROOT="^ABSPT"
QUE1 FOR STATUS=0:1:98
Begin DoDot:1
+1 IF '$DATA(@ROOT@("AD",STATUS))
QUIT
+2 WRITE $$QCOUNT(STATUS)," in Q"
+3 WRITE STATUS," ",$$STATI^ABSPOSU(STATUS)
+4 NEW X
SET X=""
+5 FOR
SET X=$ORDER(@ROOT@("AD",STATUS,X))
IF X=""
QUIT
IF $X+$LENGTH(X)+1'<IOM
QUIT
Begin DoDot:2
+6 WRITE " ",X
End DoDot:2
+7 WRITE !
End DoDot:1
+8 SET SET=""
FOR
SET SET=$ORDER(^ABSPECX("POS",SET))
IF SET=""
QUIT
Begin DoDot:1
+9 FOR WHICH="C","R"
Begin DoDot:2
+10 IF '$DATA(^ABSPECX("POS",SET,WHICH))
QUIT
+11 WRITE $$PQCOUNT(SET,WHICH)," packets in Set ",SET," "
+12 WRITE $SELECT(WHICH="C":"waiting to transmit",1:"received but unprocessed")
+13 SET X=""
FOR
SET X=$ORDER(^ABSPECX("POS",SET,WHICH,X))
IF X=""
QUIT
IF $X+$LENGTH(X)+1'<IOM
QUIT
WRITE " ",X
+14 WRITE !
End DoDot:2
End DoDot:1
QUE50 SET X=$$CONTINUE^ABSPOSUD("C")
+1 IF "Cc"[X
GOTO QUE1
+2 IF "Qq^"[X
GOTO QUE99
+3 GOTO QUE50
QUE99 ;
+1 IF $QUIT
QUIT X
QUIT
QCOUNT(N) NEW I,X
SET X=""
FOR I=0:1
SET X=$ORDER(@ROOT@("AD",N,X))
IF X=""
QUIT
+1 QUIT I
PQCOUNT(N,W) NEW I,X
SET X=""
FOR I=0:1
SET X=$ORDER(^ABSPECX("POS",N,W,X))
IF X=""
QUIT
+1 QUIT I