INHUTS1 ;JMB; 17 Jul 95 14:21;Monitoring utilities
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
Q
;
RD(PROMPT,DEF,RANGE) ;Read a parameter
;INPUT:
; PROMPT - prompt for user
; DEF - default value (default to no or 0)
; RANGE - type of question (yes/no (def) or numeric)
; nuemric range = hi , lo ex. "1,10"
;OUTPUT:
; function - user's answer (or "^" if user aborted)
;
N ANS
S ANS=U
;Handle yes/no type questions
I $G(RANGE)="YN"!($G(RANGE)="") S ANS=$$YN^UTSRD(PROMPT_": ;"_+$G(DEF)) S:ANS[U ANS=U Q ANS
;Handle numeric questions
W ! D ^UTSRD(PROMPT_": ;;;;"_+$G(DEF)_";"_RANGE)
S ANS=X S:X[U!$G(DTOUT) ANS=U
Q ANS
;
DES0 ;Load array of queues to check
; Includes Transmiters and Receivers
; Includes the Format Controler and Output Controller
;OUTPUT:
; INDEST - array of queues to check
;
N BP,BP0
K INDEST S BP=0
;Loop through Background Process Control file
F S BP=$O(^INTHPC(BP)) Q:'BP S BP0=$G(^INTHPC(BP,0)) D
. ;Check if process is NOT active
. Q:'$P(BP0,U,2)
. ;Place into list of queues
. S INDEST(BP)=$P(BP0,U)
Q
;
DES1 ;Load array of queues to check
; Includes Transmitters only (no Receivers)
; Does not include the Format Controller and Output Controller
;OUTPUT:
; INDEST - array of queues to check
; format -> queue name ^ location (global) of queue
;
K INDEST S BP=2
;Loop through Background Process Control file
F S BP=$O(^INTHPC(BP)) Q:'BP S BP0=$G(^INTHPC(BP,0)) D
. ;Check for a destination
. S D=$P(BP0,U,7) Q:'D
. ;Check if process is NOT active and no messages in queue
. Q:'$P(BP0,U,2)&'$D(^INLHDEST(D))
. ;Check for transmitters only (no receivers)
. Q:$P(^INTHPC(BP,0),U)'["TRANSMIT"
. ;Place into list of queues
. S INDEST(BP)=$P(BP0,U)_U_"INLHDEST("_D_")"
Q
INHUTS1 ;JMB; 17 Jul 95 14:21;Monitoring utilities
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
+3 QUIT
+4 ;
RD(PROMPT,DEF,RANGE) ;Read a parameter
+1 ;INPUT:
+2 ; PROMPT - prompt for user
+3 ; DEF - default value (default to no or 0)
+4 ; RANGE - type of question (yes/no (def) or numeric)
+5 ; nuemric range = hi , lo ex. "1,10"
+6 ;OUTPUT:
+7 ; function - user's answer (or "^" if user aborted)
+8 ;
+9 NEW ANS
+10 SET ANS=U
+11 ;Handle yes/no type questions
+12 IF $GET(RANGE)="YN"!($GET(RANGE)="")
SET ANS=$$YN^UTSRD(PROMPT_": ;"_+$GET(DEF))
IF ANS[U
SET ANS=U
QUIT ANS
+13 ;Handle numeric questions
+14 WRITE !
DO ^UTSRD(PROMPT_": ;;;;"_+$GET(DEF)_";"_RANGE)
+15 SET ANS=X
IF X[U!$GET(DTOUT)
SET ANS=U
+16 QUIT ANS
+17 ;
DES0 ;Load array of queues to check
+1 ; Includes Transmiters and Receivers
+2 ; Includes the Format Controler and Output Controller
+3 ;OUTPUT:
+4 ; INDEST - array of queues to check
+5 ;
+6 NEW BP,BP0
+7 KILL INDEST
SET BP=0
+8 ;Loop through Background Process Control file
+9 FOR
SET BP=$ORDER(^INTHPC(BP))
IF 'BP
QUIT
SET BP0=$GET(^INTHPC(BP,0))
Begin DoDot:1
+10 ;Check if process is NOT active
+11 IF '$PIECE(BP0,U,2)
QUIT
+12 ;Place into list of queues
+13 SET INDEST(BP)=$PIECE(BP0,U)
End DoDot:1
+14 QUIT
+15 ;
DES1 ;Load array of queues to check
+1 ; Includes Transmitters only (no Receivers)
+2 ; Does not include the Format Controller and Output Controller
+3 ;OUTPUT:
+4 ; INDEST - array of queues to check
+5 ; format -> queue name ^ location (global) of queue
+6 ;
+7 KILL INDEST
SET BP=2
+8 ;Loop through Background Process Control file
+9 FOR
SET BP=$ORDER(^INTHPC(BP))
IF 'BP
QUIT
SET BP0=$GET(^INTHPC(BP,0))
Begin DoDot:1
+10 ;Check for a destination
+11 SET D=$PIECE(BP0,U,7)
IF 'D
QUIT
+12 ;Check if process is NOT active and no messages in queue
+13 IF '$PIECE(BP0,U,2)&'$DATA(^INLHDEST(D))
QUIT
+14 ;Check for transmitters only (no receivers)
+15 IF $PIECE(^INTHPC(BP,0),U)'["TRANSMIT"
QUIT
+16 ;Place into list of queues
+17 SET INDEST(BP)=$PIECE(BP0,U)_U_"INLHDEST("_D_")"
End DoDot:1
+18 QUIT